linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mips: sgi-ip22: Drop redundant check from .remove()
@ 2022-06-18 20:40 Uwe Kleine-König
  2022-07-05 10:23 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2022-06-18 20:40 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Greg Kroah-Hartman, Finn Thain; +Cc: linux-mips, kernel

The remove callback is only called by the driver core if there is a
driver to unbind, so there is no need to check dev->driver to be
non-NULL.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/mips/sgi-ip22/ip22-gio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/sgi-ip22/ip22-gio.c b/arch/mips/sgi-ip22/ip22-gio.c
index 38d12f417e48..8686e8c1c4e5 100644
--- a/arch/mips/sgi-ip22/ip22-gio.c
+++ b/arch/mips/sgi-ip22/ip22-gio.c
@@ -148,7 +148,7 @@ static void gio_device_remove(struct device *dev)
 	struct gio_device *gio_dev = to_gio_device(dev);
 	struct gio_driver *drv = to_gio_driver(dev->driver);
 
-	if (dev->driver && drv->remove)
+	if (drv->remove)
 		drv->remove(gio_dev);
 }
 

base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56
-- 
2.36.1


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

* Re: [PATCH] mips: sgi-ip22: Drop redundant check from .remove()
  2022-06-18 20:40 [PATCH] mips: sgi-ip22: Drop redundant check from .remove() Uwe Kleine-König
@ 2022-07-05 10:23 ` Thomas Bogendoerfer
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2022-07-05 10:23 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Greg Kroah-Hartman, Finn Thain, linux-mips, kernel

On Sat, Jun 18, 2022 at 10:40:37PM +0200, Uwe Kleine-König wrote:
> The remove callback is only called by the driver core if there is a
> driver to unbind, so there is no need to check dev->driver to be
> non-NULL.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  arch/mips/sgi-ip22/ip22-gio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/sgi-ip22/ip22-gio.c b/arch/mips/sgi-ip22/ip22-gio.c
> index 38d12f417e48..8686e8c1c4e5 100644
> --- a/arch/mips/sgi-ip22/ip22-gio.c
> +++ b/arch/mips/sgi-ip22/ip22-gio.c
> @@ -148,7 +148,7 @@ static void gio_device_remove(struct device *dev)
>  	struct gio_device *gio_dev = to_gio_device(dev);
>  	struct gio_driver *drv = to_gio_driver(dev->driver);
>  
> -	if (dev->driver && drv->remove)
> +	if (drv->remove)
>  		drv->remove(gio_dev);
>  }
>  
> 
> base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56
> -- 
> 2.36.1

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2022-07-05 10:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-18 20:40 [PATCH] mips: sgi-ip22: Drop redundant check from .remove() Uwe Kleine-König
2022-07-05 10:23 ` Thomas Bogendoerfer

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).