From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Scott Wood <oss@buserror.net>, Michael Ellerman <mpe@ellerman.id.au>
Cc: kernel@pengturonix.de, Paul Mackerras <paulus@samba.org>,
linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 2/3] powerpc/platforms/83xx/suspend: Prevent unloading the driver
Date: Thu, 7 Jul 2022 08:14:40 +0200 [thread overview]
Message-ID: <20220707061441.193869-2-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20220707061441.193869-1-u.kleine-koenig@pengutronix.de>
Returning an error in .remove() doesn't prevent a driver from being
unloaded. On unbind this only results in an error message, but the
device is remove anyhow.
I guess the author's idea of just returning -EPERM in .remove() was to
prevent unbinding a device. To achieve that set the suppress_bind_attrs
driver property and drop the useless .remove callback.
This is a preparation for making platform remove callbacks return void.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
arch/powerpc/platforms/83xx/suspend.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
index 30b7700a2c98..309f42ab63d4 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -421,18 +421,13 @@ static int pmc_probe(struct platform_device *ofdev)
return ret;
}
-static int pmc_remove(struct platform_device *ofdev)
-{
- return -EPERM;
-};
-
static struct platform_driver pmc_driver = {
.driver = {
.name = "mpc83xx-pmc",
.of_match_table = pmc_match,
+ .suppress_bind_attrs = true,
},
.probe = pmc_probe,
- .remove = pmc_remove
};
builtin_platform_driver(pmc_driver);
--
2.36.1
next prev parent reply other threads:[~2022-07-07 6:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-07 6:14 [PATCH 1/3] powerpc/platforms/83xx/suspend: Reorder to get rid of a forward declaration Uwe Kleine-König
2022-07-07 6:14 ` Uwe Kleine-König [this message]
2022-07-07 8:44 ` [PATCH 2/3] powerpc/platforms/83xx/suspend: Prevent unloading the driver Christophe Leroy
2022-07-15 18:41 ` Scott Wood
2022-07-07 6:14 ` [PATCH 3/3] powerpc/platforms/83xx/suspend: Remove write-only global variable Uwe Kleine-König
2022-07-07 8:49 ` Christophe Leroy
2022-07-07 8:43 ` [PATCH 1/3] powerpc/platforms/83xx/suspend: Reorder to get rid of a forward declaration Christophe Leroy
2022-07-29 13:03 ` Michael Ellerman
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=20220707061441.193869-2-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=kernel@pengturonix.de \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=oss@buserror.net \
--cc=paulus@samba.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).