diff mbox series

[net-next,2/2] net: dsa: xrs700x: use of_match_ptr() on xrs700x_mdio_dt_ids

Message ID 20210209211256.111764-2-george.mccollister@gmail.com (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series [net-next,1/2] net: dsa: xrs700x: fix unused warning for of_device_id | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 1 maintainers not CCed: davem@davemloft.net
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

George McCollister Feb. 9, 2021, 9:12 p.m. UTC
Use of_match_ptr() on xrs700x_mdio_dt_ids so that NULL is substituted
when CONFIG_OF isn't defined. This will prevent unnecessary use of
xrs700x_mdio_dt_ids when CONFIG_OF isn't defined.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
---
 drivers/net/dsa/xrs700x/xrs700x_mdio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Florian Fainelli Feb. 9, 2021, 9:28 p.m. UTC | #1
On 2/9/21 1:12 PM, George McCollister wrote:
> Use of_match_ptr() on xrs700x_mdio_dt_ids so that NULL is substituted
> when CONFIG_OF isn't defined. This will prevent unnecessary use of
> xrs700x_mdio_dt_ids when CONFIG_OF isn't defined.
> 
> Signed-off-by: George McCollister <george.mccollister@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
diff mbox series

Patch

diff --git a/drivers/net/dsa/xrs700x/xrs700x_mdio.c b/drivers/net/dsa/xrs700x/xrs700x_mdio.c
index 3b3b78f20263..44f58bee04a4 100644
--- a/drivers/net/dsa/xrs700x/xrs700x_mdio.c
+++ b/drivers/net/dsa/xrs700x/xrs700x_mdio.c
@@ -10,6 +10,7 @@ 
 #include <linux/module.h>
 #include <linux/phy.h>
 #include <linux/if_vlan.h>
+#include <linux/of.h>
 #include "xrs700x.h"
 #include "xrs700x_reg.h"
 
@@ -150,7 +151,7 @@  MODULE_DEVICE_TABLE(of, xrs700x_mdio_dt_ids);
 static struct mdio_driver xrs700x_mdio_driver = {
 	.mdiodrv.driver = {
 		.name	= "xrs700x-mdio",
-		.of_match_table = xrs700x_mdio_dt_ids,
+		.of_match_table = of_match_ptr(xrs700x_mdio_dt_ids),
 	},
 	.probe	= xrs700x_mdio_probe,
 	.remove	= xrs700x_mdio_remove,