All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2]ipmi:bt-bmc:Avoid unnecessary judgement
@ 2020-04-06  4:34 Tang Bin
  2020-04-07 13:40 ` Corey Minyard
  0 siblings, 1 reply; 2+ messages in thread
From: Tang Bin @ 2020-04-06  4:34 UTC (permalink / raw)
  To: minyard, arnd, gregkh; +Cc: openipmi-developer, linux-kernel, Tang Bin

In this driver,only the platform_device and platform_driver
matches,can trigger bt_bmc_probe(),and the trigger mode is
just Device Tree.Thus remove redundant judgments.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
Changes from v1:
 - improve the commit message.

 drivers/char/ipmi/bt-bmc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
index d36aeacb2..890ad55aa 100644
--- a/drivers/char/ipmi/bt-bmc.c
+++ b/drivers/char/ipmi/bt-bmc.c
@@ -430,9 +430,6 @@ static int bt_bmc_probe(struct platform_device *pdev)
 	struct device *dev;
 	int rc;
 
-	if (!pdev || !pdev->dev.of_node)
-		return -ENODEV;
-
 	dev = &pdev->dev;
 	dev_info(dev, "Found bt bmc device\n");
 
-- 
2.20.1.windows.1




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

* Re: [PATCH v2]ipmi:bt-bmc:Avoid unnecessary judgement
  2020-04-06  4:34 [PATCH v2]ipmi:bt-bmc:Avoid unnecessary judgement Tang Bin
@ 2020-04-07 13:40 ` Corey Minyard
  0 siblings, 0 replies; 2+ messages in thread
From: Corey Minyard @ 2020-04-07 13:40 UTC (permalink / raw)
  To: Tang Bin; +Cc: arnd, gregkh, openipmi-developer, linux-kernel

On Mon, Apr 06, 2020 at 12:34:15PM +0800, Tang Bin wrote:
> In this driver,only the platform_device and platform_driver
> matches,can trigger bt_bmc_probe(),and the trigger mode is
> just Device Tree.Thus remove redundant judgments.

How about the following commit message:

bt_bmc_probe() is only called with an openfirmware platform device.
Therefore there is no need to check that the passed in device is NULL or
that it has an openfirmware node.

Also, how did you find this?

Thanks,

-corey

> 
> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> ---
> Changes from v1:
>  - improve the commit message.
> 
>  drivers/char/ipmi/bt-bmc.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
> index d36aeacb2..890ad55aa 100644
> --- a/drivers/char/ipmi/bt-bmc.c
> +++ b/drivers/char/ipmi/bt-bmc.c
> @@ -430,9 +430,6 @@ static int bt_bmc_probe(struct platform_device *pdev)
>  	struct device *dev;
>  	int rc;
>  
> -	if (!pdev || !pdev->dev.of_node)
> -		return -ENODEV;
> -
>  	dev = &pdev->dev;
>  	dev_info(dev, "Found bt bmc device\n");
>  
> -- 
> 2.20.1.windows.1
> 
> 
> 

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

end of thread, other threads:[~2020-04-07 13:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06  4:34 [PATCH v2]ipmi:bt-bmc:Avoid unnecessary judgement Tang Bin
2020-04-07 13:40 ` Corey Minyard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.