diff options
author | Chunfeng Yun <chunfeng.yun@mediatek.com> | 2017-08-09 12:17:58 +0300 |
---|---|---|
committer | Kishon Vijay Abraham I <kishon@ti.com> | 2017-08-20 11:29:52 +0300 |
commit | e0ed408260dbbb2d6235f2478e2b2778255089d2 (patch) | |
tree | 289c8b1a0dd06131026223eaa76dd0d04c975351 /drivers/phy/samsung/phy-samsung-usb2.c | |
parent | cd4ec4b03dc15b164390c9d3e02e64935c3dd369 (diff) | |
download | linux-e0ed408260dbbb2d6235f2478e2b2778255089d2.tar.xz |
phy: samsung: use of_device_get_match_data()
reduce the boilerplate code to get the specific data
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/phy/samsung/phy-samsung-usb2.c')
-rw-r--r-- | drivers/phy/samsung/phy-samsung-usb2.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/phy/samsung/phy-samsung-usb2.c b/drivers/phy/samsung/phy-samsung-usb2.c index 1d22d93b552d..ea818866985a 100644 --- a/drivers/phy/samsung/phy-samsung-usb2.c +++ b/drivers/phy/samsung/phy-samsung-usb2.c @@ -14,6 +14,7 @@ #include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> +#include <linux/of_device.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/spinlock.h> @@ -142,7 +143,6 @@ MODULE_DEVICE_TABLE(of, samsung_usb2_phy_of_match); static int samsung_usb2_phy_probe(struct platform_device *pdev) { - const struct of_device_id *match; const struct samsung_usb2_phy_config *cfg; struct device *dev = &pdev->dev; struct phy_provider *phy_provider; @@ -155,12 +155,9 @@ static int samsung_usb2_phy_probe(struct platform_device *pdev) return -EINVAL; } - match = of_match_node(samsung_usb2_phy_of_match, pdev->dev.of_node); - if (!match) { - dev_err(dev, "of_match_node() failed\n"); + cfg = of_device_get_match_data(dev); + if (!cfg) return -EINVAL; - } - cfg = match->data; drv = devm_kzalloc(dev, sizeof(struct samsung_usb2_phy_driver) + cfg->num_phys * sizeof(struct samsung_usb2_phy_instance), |