Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions drivers/dpll/dpll_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ void dpll_init_pin(struct dpll_pin **pin, enum dpll_pin_type type,
(*pin)->type = type;
(*pin)->priv = priv;
(*pin)->id = id;
refcount_set(&((*pin)->ref_count), 0);
if (name)
snprintf((*pin)->name, PIN_NAME_LENGTH, "%s", name);
else
Expand Down Expand Up @@ -241,7 +242,7 @@ int dpll_pin_register(struct dpll_device *dpll, struct dpll_pin *pin)
mutex_lock(&dpll->lock);
ret = pin_register(&dpll->pins, pin);
if (!ret) {
pin->ref_count++;
refcount_inc(&pin->ref_count);
change_pin_count(dpll, pin, true);
xa_set_mark(&dpll->pins, dpll->id, DPLL_REGISTERED);
}
Expand Down Expand Up @@ -287,9 +288,7 @@ int dpll_pin_deregister(struct dpll_device *dpll, struct dpll_pin *pin)
mutex_unlock(&dpll->lock);

if (!ret) {
mutex_lock(&pin->lock);
pin->ref_count--;
mutex_unlock(&pin->lock);
refcount_dec(&pin->ref_count);
dpll_notify_pin_deregister(dpll->id, pin->id);
}

Expand All @@ -311,7 +310,7 @@ void dpll_pin_free(struct dpll_device *dpll, struct dpll_pin *pin)
if (!pin_found)
return;

if (pin->ref_count)
if (refcount_read(&pin->ref_count) != 0)
return;

xa_destroy(&pin->muxed_pins);
Expand All @@ -333,7 +332,7 @@ void dpll_muxed_pin_free(struct dpll_pin *parent_pin, struct dpll_pin *pin)
if (!pin_found)
return;

if (pin->ref_count)
if (refcount_read(&pin->ref_count) != 0)
return;

xa_destroy(&pin->muxed_pins);
Expand All @@ -348,9 +347,7 @@ int dpll_muxed_pin_register(struct dpll_pin *parent_pin, struct dpll_pin *pin)
ret = pin_register(&parent_pin->muxed_pins, pin);

if (!ret) {
mutex_lock(&pin->lock);
pin->ref_count++;
mutex_unlock(&pin->lock);
refcount_inc(&pin->ref_count);
dpll_notify_muxed_pin_register(parent_pin, pin->id);
}

Expand All @@ -370,9 +367,7 @@ int dpll_muxed_pin_deregister(struct dpll_pin *parent_pin, struct dpll_pin *pin)
mutex_unlock(&parent_pin->lock);

if (!ret) {
mutex_lock(&pin->lock);
pin->ref_count--;
mutex_unlock(&pin->lock);
refcount_dec(&pin->ref_count);
dpll_notify_muxed_pin_deregister(parent_pin, pin->id);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/dpll/dpll_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
struct dpll_pin {
int id;
enum dpll_pin_type type;
int ref_count;
refcount_t ref_count;
struct dpll_pin_ops *ops;
struct mutex lock;
void *priv;
Expand Down
8 changes: 4 additions & 4 deletions drivers/dpll/dpll_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ static int __dpll_cmd_dump_sources(struct dpll_device *dpll,
}
ret = 0;
}
if (pin->ops->get_prio) {
prio = pin->ops->get_prio(pin, dpll);
if (dpll->ops->get_prio) {
prio = dpll->ops->get_prio(dpll, pin);
if (nla_put_u32(msg, DPLLA_SOURCE_PIN_PRIO, prio)) {
nla_nest_cancel(msg, src_attr);
ret = -EMSGSIZE;
Expand Down Expand Up @@ -393,10 +393,10 @@ static int dpll_genl_cmd_set_source_prio(struct sk_buff *skb, struct genl_info *

mutex_lock(&dpll->lock);
pin = dpll_pin_get_by_id(dpll, src_id);
if (!pin || !pin->ops || !pin->ops->set_prio)
if (!dpll->ops || !dpll->ops->set_prio)
ret = -EOPNOTSUPP;
else
ret = pin->ops->set_prio(pin, dpll, prio);
ret = dpll->ops->set_prio(dpll, pin, prio);
mutex_unlock(&dpll->lock);

if (!ret)
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/intel/ice/ice.h
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,8 @@ struct ice_pf {
#define ICE_VF_AGG_NODE_ID_START 65
#define ICE_MAX_VF_AGG_NODES 32
struct ice_agg_node vf_agg_node[ICE_MAX_VF_AGG_NODES];
struct ice_synce synce;
struct ice_dpll dpll_synce;
struct ice_dpll dpll_ptp;
};

struct ice_netdev_priv {
Expand Down
Loading