netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: hns: Remove a redundant check in hns_mdio_probe()
@ 2023-08-04  9:27 thunder.leizhen
  2023-08-05 11:29 ` Simon Horman
  0 siblings, 1 reply; 3+ messages in thread
From: thunder.leizhen @ 2023-08-04  9:27 UTC (permalink / raw)
  To: Yisen Zhuang, Salil Mehta, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev
  Cc: Zhen Lei

From: Zhen Lei <thunder.leizhen@huawei.com>

Traverse all devices when a new driver is installed, or, traverse all
drivers when a new device is added. In any case, the input argument
'pdev' of drv->probe() cannot be NULL.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns_mdio.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns_mdio.c b/drivers/net/ethernet/hisilicon/hns_mdio.c
index 9232caaf0bdc1bb..37ff12ff0062442 100644
--- a/drivers/net/ethernet/hisilicon/hns_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns_mdio.c
@@ -498,11 +498,6 @@ static int hns_mdio_probe(struct platform_device *pdev)
 	struct mii_bus *new_bus;
 	int ret;
 
-	if (!pdev) {
-		dev_err(NULL, "pdev is NULL!\r\n");
-		return -ENODEV;
-	}
-
 	mdio_dev = devm_kzalloc(&pdev->dev, sizeof(*mdio_dev), GFP_KERNEL);
 	if (!mdio_dev)
 		return -ENOMEM;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: hns: Remove a redundant check in hns_mdio_probe()
  2023-08-04  9:27 [PATCH] net: hns: Remove a redundant check in hns_mdio_probe() thunder.leizhen
@ 2023-08-05 11:29 ` Simon Horman
  2023-08-06 10:08   ` Leizhen (ThunderTown)
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2023-08-05 11:29 UTC (permalink / raw)
  To: thunder.leizhen
  Cc: Yisen Zhuang, Salil Mehta, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, Zhen Lei

On Fri, Aug 04, 2023 at 05:27:53PM +0800, thunder.leizhen@huaweicloud.com wrote:
> From: Zhen Lei <thunder.leizhen@huawei.com>
> 
> Traverse all devices when a new driver is installed, or, traverse all
> drivers when a new device is added. In any case, the input argument
> 'pdev' of drv->probe() cannot be NULL.
> 
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

Please specify the target tree, net-next or net, for patches for this
driver. In this case, as it isn't a bug fix, it would be net-next.

	Subject: [PATCH net-next] ...

That aside, this looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: hns: Remove a redundant check in hns_mdio_probe()
  2023-08-05 11:29 ` Simon Horman
@ 2023-08-06 10:08   ` Leizhen (ThunderTown)
  0 siblings, 0 replies; 3+ messages in thread
From: Leizhen (ThunderTown) @ 2023-08-06 10:08 UTC (permalink / raw)
  To: Simon Horman
  Cc: Yisen Zhuang, Salil Mehta, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, Zhen Lei



On 2023/8/5 19:29, Simon Horman wrote:
> On Fri, Aug 04, 2023 at 05:27:53PM +0800, thunder.leizhen@huaweicloud.com wrote:
>> From: Zhen Lei <thunder.leizhen@huawei.com>
>>
>> Traverse all devices when a new driver is installed, or, traverse all
>> drivers when a new device is added. In any case, the input argument
>> 'pdev' of drv->probe() cannot be NULL.
>>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> 
> Please specify the target tree, net-next or net, for patches for this
> driver. In this case, as it isn't a bug fix, it would be net-next.
> 
> 	Subject: [PATCH net-next] ...

Sorry, this is my first patch for the net module. Do it next time.

> 
> That aside, this looks good to me.

Thanks.

> 
> Reviewed-by: Simon Horman <horms@kernel.org>
> .
> 

-- 
Regards,
  Zhen Lei


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-06 10:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-04  9:27 [PATCH] net: hns: Remove a redundant check in hns_mdio_probe() thunder.leizhen
2023-08-05 11:29 ` Simon Horman
2023-08-06 10:08   ` Leizhen (ThunderTown)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).