Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy/rockchip: Use of_device_get_match_data()

Use of_device_get_match_data() to simplify the code.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220304011755.2061529-1-chi.minghao@zte.com.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Minghao Chi (CGEL ZTE) and committed by
Vinod Koul
2404387f 3eb836df

+2 -4
+2 -4
drivers/phy/rockchip/phy-rockchip-typec.c
··· 1105 1105 struct phy_provider *phy_provider; 1106 1106 struct resource *res; 1107 1107 const struct rockchip_usb3phy_port_cfg *phy_cfgs; 1108 - const struct of_device_id *match; 1109 1108 int index, ret; 1110 1109 1111 1110 tcphy = devm_kzalloc(dev, sizeof(*tcphy), GFP_KERNEL); 1112 1111 if (!tcphy) 1113 1112 return -ENOMEM; 1114 1113 1115 - match = of_match_device(dev->driver->of_match_table, dev); 1116 - if (!match || !match->data) { 1114 + phy_cfgs = of_device_get_match_data(dev); 1115 + if (!phy_cfgs) { 1117 1116 dev_err(dev, "phy configs are not assigned!\n"); 1118 1117 return -EINVAL; 1119 1118 } ··· 1122 1123 if (IS_ERR(tcphy->base)) 1123 1124 return PTR_ERR(tcphy->base); 1124 1125 1125 - phy_cfgs = match->data; 1126 1126 /* find out a proper config which can be matched with dt. */ 1127 1127 index = 0; 1128 1128 while (phy_cfgs[index].reg) {