diff mbox series

[RFC,47/57] drivers: mfd: Use driver_find_device_by_name helper

Message ID 1559577023-558-48-git-send-email-suzuki.poulose@arm.com
State New
Headers show
Series [RFC,01/57] drivers: s390/cio: Use driver_for_each_device | expand

Commit Message

Suzuki K Poulose June 3, 2019, 3:50 p.m. UTC
Use the new driver_find_device_by_name() helper.

Cc: Lee Jones <lee.jones@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

---
 drivers/mfd/syscon.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

-- 
2.7.4

Comments

Arnd Bergmann June 4, 2019, 9:45 a.m. UTC | #1
On Mon, Jun 3, 2019 at 5:52 PM Suzuki K Poulose <suzuki.poulose@arm.com> wrote:
>

> Use the new driver_find_device_by_name() helper.

>

> Cc: Lee Jones <lee.jones@linaro.org>

> Cc: Arnd Bergmann <arnd@arndb.de>

> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>


I see that there are currently no callers of this function, and I never
liked the interface anyway, so how about just removing
syscon_regmap_lookup_by_pdevname instead?

       Arnd
Suzuki K Poulose June 4, 2019, 11:42 a.m. UTC | #2
Hi Arnd,

On 04/06/2019 10:45, Arnd Bergmann wrote:
> On Mon, Jun 3, 2019 at 5:52 PM Suzuki K Poulose <suzuki.poulose@arm.com> wrote:

>>

>> Use the new driver_find_device_by_name() helper.

>>

>> Cc: Lee Jones <lee.jones@linaro.org>

>> Cc: Arnd Bergmann <arnd@arndb.de>

>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

> 

> I see that there are currently no callers of this function, and I never

> liked the interface anyway, so how about just removing

> syscon_regmap_lookup_by_pdevname instead?


If that works for you, sure. I can send in a patch separately
and hopefully I can remove this patch depending when the said
change lands.

Cheers
Suzuki
Arnd Bergmann June 4, 2019, 11:47 a.m. UTC | #3
On Tue, Jun 4, 2019 at 1:42 PM Suzuki K Poulose <suzuki.poulose@arm.com> wrote:
> On 04/06/2019 10:45, Arnd Bergmann wrote:

> > On Mon, Jun 3, 2019 at 5:52 PM Suzuki K Poulose <suzuki.poulose@arm.com> wrote:

> >>

> >> Use the new driver_find_device_by_name() helper.

> >>

> >> Cc: Lee Jones <lee.jones@linaro.org>

> >> Cc: Arnd Bergmann <arnd@arndb.de>

> >> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

> >

> > I see that there are currently no callers of this function, and I never

> > liked the interface anyway, so how about just removing

> > syscon_regmap_lookup_by_pdevname instead?

>

> If that works for you, sure. I can send in a patch separately

> and hopefully I can remove this patch depending when the said

> change lands.


Sounds good, thanks.

      Arnd
diff mbox series

Patch

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index 4f39ba5..e51e39a 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -190,18 +190,12 @@  struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
 }
 EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_compatible);
 
-static int syscon_match_pdevname(struct device *dev, const void *data)
-{
-	return !strcmp(dev_name(dev), (const char *)data);
-}
-
 struct regmap *syscon_regmap_lookup_by_pdevname(const char *s)
 {
 	struct device *dev;
 	struct syscon *syscon;
 
-	dev = driver_find_device(&syscon_driver.driver, NULL, (void *)s,
-				 syscon_match_pdevname);
+	dev = driver_find_device_by_name(&syscon_driver.driver, NULL, s);
 	if (!dev)
 		return ERR_PTR(-EPROBE_DEFER);