Skip to content

Commit

Permalink
drm/msm/mdp4: Deduplicate bus_find_device() by name matching
Browse files Browse the repository at this point in the history
No need to reinvent the wheel, we have bus_find_device_by_name().

Signed-off-by: Lukas Wunner <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
  • Loading branch information
l1k authored and robclark committed Dec 13, 2017
1 parent ad40dfd commit 8dcbde0
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,19 +234,14 @@ 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.
*/
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
Expand Down

0 comments on commit 8dcbde0

Please sign in to comment.