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 <robh@kernel.org> Link: https://lore.kernel.org/r/20231009172923.2457844-16-robh@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
@@ -15,7 +15,6 @@
|
|||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/of_platform.h>
|
|
||||||
#include <linux/iio/consumer.h>
|
#include <linux/iio/consumer.h>
|
||||||
#include <linux/pinctrl/consumer.h>
|
#include <linux/pinctrl/consumer.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
@@ -612,14 +611,8 @@ static int cpcap_usb_phy_probe(struct platform_device *pdev)
|
|||||||
struct phy *generic_phy;
|
struct phy *generic_phy;
|
||||||
struct phy_provider *phy_provider;
|
struct phy_provider *phy_provider;
|
||||||
struct usb_otg *otg;
|
struct usb_otg *otg;
|
||||||
const struct of_device_id *of_id;
|
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
of_id = of_match_device(of_match_ptr(cpcap_usb_phy_id_table),
|
|
||||||
&pdev->dev);
|
|
||||||
if (!of_id)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
|
ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
|
||||||
if (!ddata)
|
if (!ddata)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@@ -13,7 +13,6 @@
|
|||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/phy/phy.h>
|
#include <linux/phy/phy.h>
|
||||||
#include <linux/of_platform.h>
|
|
||||||
|
|
||||||
#include <linux/mfd/syscon.h>
|
#include <linux/mfd/syscon.h>
|
||||||
|
|
||||||
@@ -161,7 +160,6 @@ static UNIVERSAL_DEV_PM_OPS(dm816x_usb_phy_pm_ops,
|
|||||||
dm816x_usb_phy_runtime_resume,
|
dm816x_usb_phy_runtime_resume,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
|
||||||
static const struct of_device_id dm816x_usb_phy_id_table[] = {
|
static const struct of_device_id dm816x_usb_phy_id_table[] = {
|
||||||
{
|
{
|
||||||
.compatible = "ti,dm8168-usb-phy",
|
.compatible = "ti,dm8168-usb-phy",
|
||||||
@@ -169,7 +167,6 @@ static const struct of_device_id dm816x_usb_phy_id_table[] = {
|
|||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(of, dm816x_usb_phy_id_table);
|
MODULE_DEVICE_TABLE(of, dm816x_usb_phy_id_table);
|
||||||
#endif
|
|
||||||
|
|
||||||
static int dm816x_usb_phy_probe(struct platform_device *pdev)
|
static int dm816x_usb_phy_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
@@ -178,14 +175,8 @@ static int dm816x_usb_phy_probe(struct platform_device *pdev)
|
|||||||
struct phy *generic_phy;
|
struct phy *generic_phy;
|
||||||
struct phy_provider *phy_provider;
|
struct phy_provider *phy_provider;
|
||||||
struct usb_otg *otg;
|
struct usb_otg *otg;
|
||||||
const struct of_device_id *of_id;
|
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
of_id = of_match_device(of_match_ptr(dm816x_usb_phy_id_table),
|
|
||||||
&pdev->dev);
|
|
||||||
if (!of_id)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL);
|
phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL);
|
||||||
if (!phy)
|
if (!phy)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@@ -272,7 +263,7 @@ static struct platform_driver dm816x_usb_phy_driver = {
|
|||||||
.driver = {
|
.driver = {
|
||||||
.name = "dm816x-usb-phy",
|
.name = "dm816x-usb-phy",
|
||||||
.pm = &dm816x_usb_phy_pm_ops,
|
.pm = &dm816x_usb_phy_pm_ops,
|
||||||
.of_match_table = of_match_ptr(dm816x_usb_phy_id_table),
|
.of_match_table = dm816x_usb_phy_id_table,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user