]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
drm/msm/mdp4: Deduplicate bus_find_device() by name matching
authorLukas Wunner <lukas@wunner.de>
Sat, 25 Nov 2017 10:10:19 +0000 (11:10 +0100)
committerRob Clark <robdclark@gmail.com>
Wed, 13 Dec 2017 16:09:31 +0000 (11:09 -0500)
No need to reinvent the wheel, we have bus_find_device_by_name().

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h

index 940de51ac5cdaaab128acc40a2b18a8834c6026a..a1b3e31e959e46fb0f5fc6068832cbeff1f9148a 100644 (file)
@@ -234,10 +234,6 @@ static inline struct clk *mpd4_lvds_pll_init(struct drm_device *dev)
 #endif
 
 #ifdef DOWNSTREAM_CONFIG_MSM_BUS_SCALING
-static inline int match_dev_name(struct device *dev, void *data)
-{
-       return !strcmp(dev_name(dev), data);
-}
 /* bus scaling data is associated with extra pointless platform devices,
  * "dtv", etc.. this is a bit of a hack, but we need a way for encoders
  * to find their pdata to make the bus-scaling stuff work.
@@ -245,8 +241,7 @@ static inline int match_dev_name(struct device *dev, void *data)
 static inline void *mdp4_find_pdata(const char *devname)
 {
        struct device *dev;
-       dev = bus_find_device(&platform_bus_type, NULL,
-                       (void *)devname, match_dev_name);
+       dev = bus_find_device_by_name(&platform_bus_type, NULL, devname);
        return dev ? dev->platform_data : NULL;
 }
 #endif