Skip to content

Commit

Permalink
EDAC: Get rid of edac_handlers
Browse files Browse the repository at this point in the history
Use mc_devices list instead to check whether we have EDAC driver
instances successfully registered with EDAC core.

Signed-off-by: Borislav Petkov <bp@suse.de>
  • Loading branch information
Borislav Petkov committed Apr 10, 2017
1 parent db47d5f commit 97bb6c1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
6 changes: 2 additions & 4 deletions drivers/edac/edac_mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,6 @@ static int add_mc_to_global_list(struct mem_ctl_info *mci)
}

list_add_tail_rcu(&mci->link, insert_before);
atomic_inc(&edac_handlers);
return 0;

fail0:
Expand All @@ -619,7 +618,6 @@ static int add_mc_to_global_list(struct mem_ctl_info *mci)

static int del_mc_from_global_list(struct mem_ctl_info *mci)
{
int handlers = atomic_dec_return(&edac_handlers);
list_del_rcu(&mci->link);

/* these are for safe removal of devices from global list while
Expand All @@ -628,7 +626,7 @@ static int del_mc_from_global_list(struct mem_ctl_info *mci)
synchronize_rcu();
INIT_LIST_HEAD(&mci->link);

return handlers;
return list_empty(&mc_devices);
}

struct mem_ctl_info *edac_mc_find(int idx)
Expand Down Expand Up @@ -763,7 +761,7 @@ struct mem_ctl_info *edac_mc_del_mc(struct device *dev)
/* mark MCI offline: */
mci->op_state = OP_OFFLINE;

if (!del_mc_from_global_list(mci))
if (del_mc_from_global_list(mci))
edac_mc_owner = NULL;

mutex_unlock(&mem_ctls_mutex);
Expand Down
3 changes: 0 additions & 3 deletions drivers/edac/edac_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
int edac_op_state = EDAC_OPSTATE_INVAL;
EXPORT_SYMBOL_GPL(edac_op_state);

atomic_t edac_handlers = ATOMIC_INIT(0);
EXPORT_SYMBOL_GPL(edac_handlers);

int edac_err_assert = 0;
EXPORT_SYMBOL_GPL(edac_err_assert);

Expand Down
1 change: 0 additions & 1 deletion include/linux/edac.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ struct device;

extern int edac_op_state;
extern int edac_err_assert;
extern atomic_t edac_handlers;

extern struct bus_type *edac_get_sysfs_subsys(void);

Expand Down

0 comments on commit 97bb6c1

Please sign in to comment.