mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-29 10:08:59 +00:00
0989b7ad3a
Removed upstreamed: bcm4908/patches-5.10/180-i2c-brcmstb-fix-support-for-DSL-and-CM-variants.patch[1] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.102&id=f333c1916fd6b55900029bf8f918cc00009e2111 Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 Signed-off-by: John Audia <graysky@archlinux.us>
50 lines
1.7 KiB
Diff
50 lines
1.7 KiB
Diff
From d14f4cce9340a6586512a0eb6bc680dedeaaef14 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
|
Date: Wed, 16 Dec 2020 15:33:04 +0100
|
|
Subject: [PATCH] phy: phy-brcm-usb: improve getting OF matching data
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
1. Use of_device_get_match_data() helper to simplify the code
|
|
2. Check for NULL as a good practice
|
|
|
|
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
|
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
|
|
Link: https://lore.kernel.org/r/20201216143305.12179-1-zajec5@gmail.com
|
|
Signed-off-by: Vinod Koul <vkoul@kernel.org>
|
|
---
|
|
drivers/phy/broadcom/phy-brcm-usb.c | 7 ++++---
|
|
1 file changed, 4 insertions(+), 3 deletions(-)
|
|
|
|
--- a/drivers/phy/broadcom/phy-brcm-usb.c
|
|
+++ b/drivers/phy/broadcom/phy-brcm-usb.c
|
|
@@ -11,6 +11,7 @@
|
|
#include <linux/io.h>
|
|
#include <linux/module.h>
|
|
#include <linux/of.h>
|
|
+#include <linux/of_device.h>
|
|
#include <linux/phy/phy.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/interrupt.h>
|
|
@@ -457,7 +458,6 @@ static int brcm_usb_phy_probe(struct pla
|
|
struct device_node *dn = pdev->dev.of_node;
|
|
int err;
|
|
const char *mode;
|
|
- const struct of_device_id *match;
|
|
void (*dvr_init)(struct brcm_usb_init_params *params);
|
|
const struct match_chip_info *info;
|
|
struct regmap *rmap;
|
|
@@ -471,8 +471,9 @@ static int brcm_usb_phy_probe(struct pla
|
|
priv->ini.family_id = brcmstb_get_family_id();
|
|
priv->ini.product_id = brcmstb_get_product_id();
|
|
|
|
- match = of_match_node(brcm_usb_dt_ids, dev->of_node);
|
|
- info = match->data;
|
|
+ info = of_device_get_match_data(&pdev->dev);
|
|
+ if (!info)
|
|
+ return -ENOENT;
|
|
dvr_init = info->init_func;
|
|
(*dvr_init)(&priv->ini);
|
|
|