提交 8dcbde0f 编写于 作者: L Lukas Wunner 提交者: Rob Clark

drm/msm/mdp4: Deduplicate bus_find_device() by name matching

No need to reinvent the wheel, we have bus_find_device_by_name().
Signed-off-by: NLukas Wunner <lukas@wunner.de>
Signed-off-by: NRob Clark <robdclark@gmail.com>
上级 ad40dfdc
...@@ -234,10 +234,6 @@ static inline struct clk *mpd4_lvds_pll_init(struct drm_device *dev) ...@@ -234,10 +234,6 @@ static inline struct clk *mpd4_lvds_pll_init(struct drm_device *dev)
#endif #endif
#ifdef DOWNSTREAM_CONFIG_MSM_BUS_SCALING #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, /* 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 * "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. * 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) ...@@ -245,8 +241,7 @@ static inline int match_dev_name(struct device *dev, void *data)
static inline void *mdp4_find_pdata(const char *devname) static inline void *mdp4_find_pdata(const char *devname)
{ {
struct device *dev; struct device *dev;
dev = bus_find_device(&platform_bus_type, NULL, dev = bus_find_device_by_name(&platform_bus_type, NULL, devname);
(void *)devname, match_dev_name);
return dev ? dev->platform_data : NULL; return dev ? dev->platform_data : NULL;
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册