Skip to content

Commit dd69a63

Browse files
robherringvinodkoul
authored andcommitted
phy: Drop unnecessary of_match_device() calls
If probe is reached, we've already matched the device and in the case of DT matching, the struct device_node pointer will be set. Therefore, there is no need to call of_match_device() in probe. Signed-off-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 8b6fba3 commit dd69a63

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

drivers/phy/motorola/phy-cpcap-usb.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <linux/io.h>
1616
#include <linux/module.h>
1717
#include <linux/of.h>
18-
#include <linux/of_platform.h>
1918
#include <linux/iio/consumer.h>
2019
#include <linux/pinctrl/consumer.h>
2120
#include <linux/platform_device.h>
@@ -612,14 +611,8 @@ static int cpcap_usb_phy_probe(struct platform_device *pdev)
612611
struct phy *generic_phy;
613612
struct phy_provider *phy_provider;
614613
struct usb_otg *otg;
615-
const struct of_device_id *of_id;
616614
int error;
617615

618-
of_id = of_match_device(of_match_ptr(cpcap_usb_phy_id_table),
619-
&pdev->dev);
620-
if (!of_id)
621-
return -EINVAL;
622-
623616
ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
624617
if (!ddata)
625618
return -ENOMEM;

drivers/phy/ti/phy-dm816x-usb.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <linux/pm_runtime.h>
1414
#include <linux/delay.h>
1515
#include <linux/phy/phy.h>
16-
#include <linux/of_platform.h>
1716

1817
#include <linux/mfd/syscon.h>
1918

@@ -161,15 +160,13 @@ static UNIVERSAL_DEV_PM_OPS(dm816x_usb_phy_pm_ops,
161160
dm816x_usb_phy_runtime_resume,
162161
NULL);
163162

164-
#ifdef CONFIG_OF
165163
static const struct of_device_id dm816x_usb_phy_id_table[] = {
166164
{
167165
.compatible = "ti,dm8168-usb-phy",
168166
},
169167
{},
170168
};
171169
MODULE_DEVICE_TABLE(of, dm816x_usb_phy_id_table);
172-
#endif
173170

174171
static int dm816x_usb_phy_probe(struct platform_device *pdev)
175172
{
@@ -178,14 +175,8 @@ static int dm816x_usb_phy_probe(struct platform_device *pdev)
178175
struct phy *generic_phy;
179176
struct phy_provider *phy_provider;
180177
struct usb_otg *otg;
181-
const struct of_device_id *of_id;
182178
int error;
183179

184-
of_id = of_match_device(of_match_ptr(dm816x_usb_phy_id_table),
185-
&pdev->dev);
186-
if (!of_id)
187-
return -EINVAL;
188-
189180
phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL);
190181
if (!phy)
191182
return -ENOMEM;
@@ -272,7 +263,7 @@ static struct platform_driver dm816x_usb_phy_driver = {
272263
.driver = {
273264
.name = "dm816x-usb-phy",
274265
.pm = &dm816x_usb_phy_pm_ops,
275-
.of_match_table = of_match_ptr(dm816x_usb_phy_id_table),
266+
.of_match_table = dm816x_usb_phy_id_table,
276267
},
277268
};
278269

0 commit comments

Comments
 (0)