mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andy@kernel.org>, Lee Jones <lee@kernel.org>
Subject: [PATCH v1 1/4] mfd: intel_soc_pmic_bxtwc: Switch to use ATTRIBUTE_GROUPS()
Date: Wed, 16 Oct 2024 13:49:51 +0300	[thread overview]
Message-ID: <20241016105201.757024-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20241016105201.757024-1-andriy.shevchenko@linux.intel.com>

Embrace ATTRIBUTE_GROUPS() to avoid boiler plate code.
While at it, move DEVICE_ATTR_ADMIN_RW() closer to the callbacks.

This should not introduce any functional changes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index b7204072e93e..c130734f308e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -364,6 +364,7 @@ static ssize_t addr_store(struct device *dev,
 
 	return count;
 }
+static DEVICE_ATTR_ADMIN_RW(addr);
 
 static ssize_t val_show(struct device *dev,
 			struct device_attribute *attr, char *buf)
@@ -400,23 +401,14 @@ static ssize_t val_store(struct device *dev,
 	}
 	return count;
 }
-
-static DEVICE_ATTR_ADMIN_RW(addr);
 static DEVICE_ATTR_ADMIN_RW(val);
+
 static struct attribute *bxtwc_attrs[] = {
 	&dev_attr_addr.attr,
 	&dev_attr_val.attr,
 	NULL
 };
-
-static const struct attribute_group bxtwc_group = {
-	.attrs = bxtwc_attrs,
-};
-
-static const struct attribute_group *bxtwc_groups[] = {
-	&bxtwc_group,
-	NULL
-};
+ATTRIBUTE_GROUPS(bxtwc);
 
 static const struct regmap_config bxtwc_regmap_config = {
 	.reg_bits = 16,
-- 
2.43.0.rc1.1336.g36b5255a03ac


  reply	other threads:[~2024-10-16 10:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16 10:49 [PATCH v1 0/4] mfd: intel_soc_pmic_bxtwc: A few cleanups Andy Shevchenko
2024-10-16 10:49 ` Andy Shevchenko [this message]
2024-10-16 10:49 ` [PATCH v1 2/4] mfd: intel_soc_pmic_bxtwc: Don't use "proxy" headers Andy Shevchenko
2024-10-16 10:49 ` [PATCH v1 3/4] mfd: intel_soc_pmic_bxtwc: Use temporary variable for struct device Andy Shevchenko
2024-10-16 10:49 ` [PATCH v1 4/4] mfd: intel_soc_pmic_bxtwc: Deduplicate error messages Andy Shevchenko
2024-10-31 14:59 ` [PATCH v1 0/4] mfd: intel_soc_pmic_bxtwc: A few cleanups Lee Jones

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=20241016105201.757024-2-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®