* [PATCH 1/2] crypto: omap-aes - use dev_groups to register attribute groups
@ 2025-03-29 18:01 Ovidiu Panait
2025-03-29 18:01 ` [PATCH 2/2] crypto: omap-sham " Ovidiu Panait
2025-04-07 5:24 ` [PATCH 1/2] crypto: omap-aes " Herbert Xu
0 siblings, 2 replies; 3+ messages in thread
From: Ovidiu Panait @ 2025-03-29 18:01 UTC (permalink / raw)
To: linux-crypto; +Cc: linux-kernel, herbert, davem, Ovidiu Panait
Instead of manually adding attribute groups, set dev_groups pointer to
have the driver core do it.
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com>
---
drivers/crypto/omap-aes.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index 551dd32a8db0..1ecf5f6ac04e 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -1086,10 +1086,7 @@ static struct attribute *omap_aes_attrs[] = {
&dev_attr_fallback.attr,
NULL,
};
-
-static const struct attribute_group omap_aes_attr_group = {
- .attrs = omap_aes_attrs,
-};
+ATTRIBUTE_GROUPS(omap_aes);
static int omap_aes_probe(struct platform_device *pdev)
{
@@ -1215,12 +1212,6 @@ static int omap_aes_probe(struct platform_device *pdev)
}
}
- err = sysfs_create_group(&dev->kobj, &omap_aes_attr_group);
- if (err) {
- dev_err(dev, "could not create sysfs device attrs\n");
- goto err_aead_algs;
- }
-
return 0;
err_aead_algs:
for (i = dd->pdata->aead_algs_info->registered - 1; i >= 0; i--) {
@@ -1277,8 +1268,6 @@ static void omap_aes_remove(struct platform_device *pdev)
tasklet_kill(&dd->done_task);
omap_aes_dma_cleanup(dd);
pm_runtime_disable(dd->dev);
-
- sysfs_remove_group(&dd->dev->kobj, &omap_aes_attr_group);
}
#ifdef CONFIG_PM_SLEEP
@@ -1304,6 +1293,7 @@ static struct platform_driver omap_aes_driver = {
.name = "omap-aes",
.pm = &omap_aes_pm_ops,
.of_match_table = omap_aes_of_match,
+ .dev_groups = omap_aes_groups,
},
};
--
2.48.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] crypto: omap-sham - use dev_groups to register attribute groups
2025-03-29 18:01 [PATCH 1/2] crypto: omap-aes - use dev_groups to register attribute groups Ovidiu Panait
@ 2025-03-29 18:01 ` Ovidiu Panait
2025-04-07 5:24 ` [PATCH 1/2] crypto: omap-aes " Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Ovidiu Panait @ 2025-03-29 18:01 UTC (permalink / raw)
To: linux-crypto; +Cc: linux-kernel, herbert, davem, Ovidiu Panait
Instead of manually adding attribute groups, set dev_groups pointer to
have the driver core do it.
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com>
---
drivers/crypto/omap-sham.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index 7021481bf027..56f192cb976d 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -2039,10 +2039,7 @@ static struct attribute *omap_sham_attrs[] = {
&dev_attr_fallback.attr,
NULL,
};
-
-static const struct attribute_group omap_sham_attr_group = {
- .attrs = omap_sham_attrs,
-};
+ATTRIBUTE_GROUPS(omap_sham);
static int omap_sham_probe(struct platform_device *pdev)
{
@@ -2158,12 +2155,6 @@ static int omap_sham_probe(struct platform_device *pdev)
}
}
- err = sysfs_create_group(&dev->kobj, &omap_sham_attr_group);
- if (err) {
- dev_err(dev, "could not create sysfs device attrs\n");
- goto err_algs;
- }
-
return 0;
err_algs:
@@ -2210,8 +2201,6 @@ static void omap_sham_remove(struct platform_device *pdev)
if (!dd->polling_mode)
dma_release_channel(dd->dma_lch);
-
- sysfs_remove_group(&dd->dev->kobj, &omap_sham_attr_group);
}
static struct platform_driver omap_sham_driver = {
@@ -2220,6 +2209,7 @@ static struct platform_driver omap_sham_driver = {
.driver = {
.name = "omap-sham",
.of_match_table = omap_sham_of_match,
+ .dev_groups = omap_sham_groups,
},
};
--
2.48.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] crypto: omap-aes - use dev_groups to register attribute groups
2025-03-29 18:01 [PATCH 1/2] crypto: omap-aes - use dev_groups to register attribute groups Ovidiu Panait
2025-03-29 18:01 ` [PATCH 2/2] crypto: omap-sham " Ovidiu Panait
@ 2025-04-07 5:24 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2025-04-07 5:24 UTC (permalink / raw)
To: Ovidiu Panait; +Cc: linux-crypto, linux-kernel, davem
On Sat, Mar 29, 2025 at 08:01:21PM +0200, Ovidiu Panait wrote:
> Instead of manually adding attribute groups, set dev_groups pointer to
> have the driver core do it.
>
> Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com>
> ---
> drivers/crypto/omap-aes.c | 14 ++------------
> 1 file changed, 2 insertions(+), 12 deletions(-)
All applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-07 5:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-29 18:01 [PATCH 1/2] crypto: omap-aes - use dev_groups to register attribute groups Ovidiu Panait
2025-03-29 18:01 ` [PATCH 2/2] crypto: omap-sham " Ovidiu Panait
2025-04-07 5:24 ` [PATCH 1/2] crypto: omap-aes " Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®