[PATCH] phy: Move MODULE_DEVICE_TABLE next to the table itself

Krzysztof Kozlowski posted 1 patch 1 month, 1 week ago
drivers/phy/broadcom/phy-bcm-ns-usb3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] phy: Move MODULE_DEVICE_TABLE next to the table itself
Posted by Krzysztof Kozlowski 1 month, 1 week ago
By convention MODULE_DEVICE_TABLE() immediately follows the ID table it
exports, because this is easier to read and verify.  It also makes more
sense since #ifdef for ACPI or OF could hide both of them.

Most of the privers already have this correctly placed, so adjust
the missing ones.  No functional impact.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
 drivers/phy/broadcom/phy-bcm-ns-usb3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/broadcom/phy-bcm-ns-usb3.c b/drivers/phy/broadcom/phy-bcm-ns-usb3.c
index 6e56498d0644..9240600aeef6 100644
--- a/drivers/phy/broadcom/phy-bcm-ns-usb3.c
+++ b/drivers/phy/broadcom/phy-bcm-ns-usb3.c
@@ -65,6 +65,7 @@ static const struct of_device_id bcm_ns_usb3_id_table[] = {
 	},
 	{},
 };
+MODULE_DEVICE_TABLE(of, bcm_ns_usb3_id_table);
 
 static int bcm_ns_usb3_mdio_phy_write(struct bcm_ns_usb3 *usb3, u16 reg,
 				      u16 value);
@@ -242,4 +243,3 @@ mdio_module_driver(bcm_ns_usb3_mdio_driver);
 
 MODULE_DESCRIPTION("Broadcom Northstar USB 3.0 PHY Driver");
 MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, bcm_ns_usb3_id_table);
-- 
2.51.0
Re: [PATCH] phy: Move MODULE_DEVICE_TABLE next to the table itself
Posted by Vinod Koul 2 days, 5 hours ago
On Tue, 05 May 2026 12:29:14 +0200, Krzysztof Kozlowski wrote:
> By convention MODULE_DEVICE_TABLE() immediately follows the ID table it
> exports, because this is easier to read and verify.  It also makes more
> sense since #ifdef for ACPI or OF could hide both of them.
> 
> Most of the privers already have this correctly placed, so adjust
> the missing ones.  No functional impact.
> 
> [...]

Applied, thanks!

[1/1] phy: Move MODULE_DEVICE_TABLE next to the table itself
      commit: 1e8065dfac34d1217f961e079959b71c69123417

Best regards,
-- 
~Vinod
Re: [PATCH] phy: Move MODULE_DEVICE_TABLE next to the table itself
Posted by Neil Armstrong 1 month, 1 week ago
On 5/5/26 12:29, Krzysztof Kozlowski wrote:
> By convention MODULE_DEVICE_TABLE() immediately follows the ID table it
> exports, because this is easier to read and verify.  It also makes more
> sense since #ifdef for ACPI or OF could hide both of them.
> 
> Most of the privers already have this correctly placed, so adjust
> the missing ones.  No functional impact.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
>   drivers/phy/broadcom/phy-bcm-ns-usb3.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/broadcom/phy-bcm-ns-usb3.c b/drivers/phy/broadcom/phy-bcm-ns-usb3.c
> index 6e56498d0644..9240600aeef6 100644
> --- a/drivers/phy/broadcom/phy-bcm-ns-usb3.c
> +++ b/drivers/phy/broadcom/phy-bcm-ns-usb3.c
> @@ -65,6 +65,7 @@ static const struct of_device_id bcm_ns_usb3_id_table[] = {
>   	},
>   	{},
>   };
> +MODULE_DEVICE_TABLE(of, bcm_ns_usb3_id_table);
>   
>   static int bcm_ns_usb3_mdio_phy_write(struct bcm_ns_usb3 *usb3, u16 reg,
>   				      u16 value);
> @@ -242,4 +243,3 @@ mdio_module_driver(bcm_ns_usb3_mdio_driver);
>   
>   MODULE_DESCRIPTION("Broadcom Northstar USB 3.0 PHY Driver");
>   MODULE_LICENSE("GPL v2");
> -MODULE_DEVICE_TABLE(of, bcm_ns_usb3_id_table);

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil