1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- From 915f1d230e5292bc2156a9997bcb19d9e632f10b Mon Sep 17 00:00:00 2001
- From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
- Date: Wed, 16 Dec 2020 15:33:05 +0100
- Subject: [PATCH] phy: phy-brcm-usb: specify init function format at struct
- level
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- This is slightly cleaner solution that assures noone assings a wrong
- function to the pointer.
- Signed-off-by: Rafał Miłecki <[email protected]>
- Acked-by: Florian Fainelli <[email protected]>
- Link: https://lore.kernel.org/r/[email protected]
- Signed-off-by: Vinod Koul <[email protected]>
- ---
- drivers/phy/broadcom/phy-brcm-usb.c | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
- --- a/drivers/phy/broadcom/phy-brcm-usb.c
- +++ b/drivers/phy/broadcom/phy-brcm-usb.c
- @@ -36,7 +36,7 @@ struct value_to_name_map {
- };
-
- struct match_chip_info {
- - void *init_func;
- + void (*init_func)(struct brcm_usb_init_params *params);
- u8 required_regs[BRCM_REGS_MAX + 1];
- u8 optional_reg;
- };
- @@ -458,7 +458,6 @@ static int brcm_usb_phy_probe(struct pla
- struct device_node *dn = pdev->dev.of_node;
- int err;
- const char *mode;
- - void (*dvr_init)(struct brcm_usb_init_params *params);
- const struct match_chip_info *info;
- struct regmap *rmap;
- int x;
- @@ -474,8 +473,8 @@ static int brcm_usb_phy_probe(struct pla
- info = of_device_get_match_data(&pdev->dev);
- if (!info)
- return -ENOENT;
- - dvr_init = info->init_func;
- - (*dvr_init)(&priv->ini);
- +
- + info->init_func(&priv->ini);
-
- dev_dbg(dev, "Best mapping table is for %s\n",
- priv->ini.family_name);
|