All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>,
	Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH] checkpatch: Add old hwmon APIs to deprecated list
Date: Sun,  2 Jul 2023 14:14:50 -0700	[thread overview]
Message-ID: <20230702211450.3789779-1-linux@roeck-us.net> (raw)

hwmon_device_register() and [devm_]hwmon_device_register_with_groups()
have been deprecated. All hardware monitoring drivers should use
[devm_]hwmon_device_register_with_info() instead.

The problem with the old API functions is that they require sysfs attribute
handling in driver code. The new API handles sysfs attributes in the
hwmon core. Using the new API typically reduces driver code size by 20-40%.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 scripts/checkpatch.pl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7bfa4d39d17f..6d97f1a6028e 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -842,6 +842,9 @@ our %deprecated_apis = (
 	"kunmap"				=> "kunmap_local",
 	"kmap_atomic"				=> "kmap_local_page",
 	"kunmap_atomic"				=> "kunmap_local",
+	"hwmon_device_register"			=> "hwmon_device_register_with_info",
+	"hwmon_device_register_with_groups"	=> "hwmon_device_register_with_info",
+	"devm_hwmon_device_register_with_groups"=> "devm_hwmon_device_register_with_info",
 );
 
 #Create a search pattern for all these strings to speed up a loop below
-- 
2.39.2


             reply	other threads:[~2023-07-02 21:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-02 21:14 Guenter Roeck [this message]
2023-07-02 22:42 ` [PATCH] checkpatch: Add old hwmon APIs to deprecated list Joe Perches
2023-07-02 23:38   ` Guenter Roeck

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=20230702211450.3789779-1-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=joe@perches.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.