1 From d14f4cce9340a6586512a0eb6bc680dedeaaef14 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Wed, 16 Dec 2020 15:33:04 +0100
4 Subject: [PATCH] phy: phy-brcm-usb: improve getting OF matching data
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 1. Use of_device_get_match_data() helper to simplify the code
10 2. Check for NULL as a good practice
12 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
13 Acked-by: Florian Fainelli <f.fainelli@gmail.com>
14 Link: https://lore.kernel.org/r/20201216143305.12179-1-zajec5@gmail.com
15 Signed-off-by: Vinod Koul <vkoul@kernel.org>
17 drivers/phy/broadcom/phy-brcm-usb.c | 7 ++++---
18 1 file changed, 4 insertions(+), 3 deletions(-)
20 --- a/drivers/phy/broadcom/phy-brcm-usb.c
21 +++ b/drivers/phy/broadcom/phy-brcm-usb.c
24 #include <linux/module.h>
26 +#include <linux/of_device.h>
27 #include <linux/phy/phy.h>
28 #include <linux/platform_device.h>
29 #include <linux/interrupt.h>
30 @@ -427,7 +428,6 @@ static int brcm_usb_phy_probe(struct pla
31 struct device_node *dn = pdev->dev.of_node;
34 - const struct of_device_id *match;
35 void (*dvr_init)(struct brcm_usb_init_params *params);
36 const struct match_chip_info *info;
38 @@ -441,8 +441,9 @@ static int brcm_usb_phy_probe(struct pla
39 priv->ini.family_id = brcmstb_get_family_id();
40 priv->ini.product_id = brcmstb_get_product_id();
42 - match = of_match_node(brcm_usb_dt_ids, dev->of_node);
44 + info = of_device_get_match_data(&pdev->dev);
47 dvr_init = info->init_func;
48 (*dvr_init)(&priv->ini);