LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de,
	Finn Thain <fthain@linux-m68k.org>,
	linux-m68k@lists.linux-m68k.org
Subject: [PATCH v2 1/4] nubus: Simplify check in remove callback
Date: Fri, 30 Jul 2021 21:10:32 +0200	[thread overview]
Message-ID: <20210730191035.1455248-2-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20210730191035.1455248-1-u.kleine-koenig@pengutronix.de>

The driver core only calls a remove callback when the device was
successfully bound (aka probed) before. So dev->driver is never NULL and
the respective check can just be dropped.

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

diff --git a/drivers/nubus/bus.c b/drivers/nubus/bus.c
index d9d04f27f89b..17fad660032c 100644
--- a/drivers/nubus/bus.c
+++ b/drivers/nubus/bus.c
@@ -33,7 +33,7 @@ static void nubus_device_remove(struct device *dev)
 {
 	struct nubus_driver *ndrv = to_nubus_driver(dev->driver);
 
-	if (dev->driver && ndrv->remove)
+	if (ndrv->remove)
 		ndrv->remove(to_nubus_board(dev));
 }
 
-- 
2.30.2


  reply	other threads:[~2021-07-30 19:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 19:10 [PATCH v2 0/4] Some cleanups after making bus_type::remove return void Uwe Kleine-König
2021-07-30 19:10 ` Uwe Kleine-König [this message]
2021-08-01  5:04   ` [PATCH v2 1/4] nubus: Simplify check in remove callback Finn Thain
2021-08-02  6:52     ` Uwe Kleine-König
2021-08-03  2:14       ` Finn Thain
2021-07-30 19:10 ` [PATCH v2 2/4] sh: superhyway: " Uwe Kleine-König
2021-07-30 19:10 ` [PATCH v2 3/4] zorro: Simplify " Uwe Kleine-König
2021-08-09 13:22   ` Geert Uytterhoeven
2021-07-30 19:10 ` [PATCH v2 4/4] zorro: Drop useless (and hardly used) .driver member in struct zorro_dev Uwe Kleine-König
2021-08-09 13:25   ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210730191035.1455248-2-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=fthain@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --subject='Re: [PATCH v2 1/4] nubus: Simplify check in remove callback' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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