diff options
author | Philippe Langlais <philippe.langlais@linaro.org> | 2012-04-18 15:52:59 +0200 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:01:42 +0200 |
commit | 3fc05771a4957963c8108ecbdc0308f02e21a935 (patch) | |
tree | ab8d317a29db2f7c9c777de3599f7e541cffbbe7 /drivers/mfd/ab8500-gpadc.c | |
parent | c5030b1731024660f643f8481237fddf1770248d (diff) |
ab8500: gpadc: Use new mainline ab8500_gpadc_get() with name parameter
Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org>
Diffstat (limited to 'drivers/mfd/ab8500-gpadc.c')
-rw-r--r-- | drivers/mfd/ab8500-gpadc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c index d4135706529..d06f4826619 100644 --- a/drivers/mfd/ab8500-gpadc.c +++ b/drivers/mfd/ab8500-gpadc.c @@ -136,12 +136,16 @@ static LIST_HEAD(ab8500_gpadc_list); * ab8500_gpadc_get() - returns a reference to the primary AB8500 GPADC * (i.e. the first GPADC in the instance list) */ -struct ab8500_gpadc *ab8500_gpadc_get(void) +struct ab8500_gpadc *ab8500_gpadc_get(char *name) { struct ab8500_gpadc *gpadc; - gpadc = list_first_entry(&ab8500_gpadc_list, struct ab8500_gpadc, node); - return gpadc; + list_for_each_entry(gpadc, &ab8500_gpadc_list, node) { + if (!strcmp(name, dev_name(gpadc->dev))) + return gpadc; + } + + return ERR_PTR(-ENOENT); } EXPORT_SYMBOL(ab8500_gpadc_get); |