086-v5.12-0002-phy-phy-brcm-usb-specify-init-function-format-at-str.patch 1.6 KB

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