From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Patrick Rudolph <patrick.rudolph@9elements.com>,
Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH v2 08/14] pinctrl: cy8c95x0: Remove redundant check in cy8c95x0_regmap_update_bits_base()
Date: Mon, 3 Feb 2025 15:10:34 +0200 [thread overview]
Message-ID: <20250203131506.3318201-9-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20250203131506.3318201-1-andriy.shevchenko@linux.intel.com>
The function is never called with the PORTSEL register in the argument.
Drop unneeded check, but rescue a comment. While at it, drop inline
and allow any compiler to choose better stragy (note, that inline in
C code is only a recomendation to most of the modern compilers anyway).
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pinctrl/pinctrl-cy8c95x0.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-cy8c95x0.c b/drivers/pinctrl/pinctrl-cy8c95x0.c
index 02b692118cb2..cd191cb1101e 100644
--- a/drivers/pinctrl/pinctrl-cy8c95x0.c
+++ b/drivers/pinctrl/pinctrl-cy8c95x0.c
@@ -477,20 +477,14 @@ static const struct regmap_config cy8c9520_i2c_regmap = {
#endif
};
-static inline int cy8c95x0_regmap_update_bits_base(struct cy8c95x0_pinctrl *chip,
- unsigned int reg,
- unsigned int port,
- unsigned int mask,
- unsigned int val,
- bool *change, bool async,
- bool force)
+/* Caller should never modify PORTSEL directly */
+static int cy8c95x0_regmap_update_bits_base(struct cy8c95x0_pinctrl *chip,
+ unsigned int reg, unsigned int port,
+ unsigned int mask, unsigned int val,
+ bool *change, bool async, bool force)
{
int ret, off, i;
- /* Caller should never modify PORTSEL directly */
- if (reg == CY8C95X0_PORTSEL)
- return -EINVAL;
-
/* Registers behind the PORTSEL mux have their own range in regmap */
if (cy8c95x0_muxed_register(reg)) {
off = CY8C95X0_MUX_REGMAP_TO_OFFSET(reg, port);
--
2.43.0.rc1.1336.g36b5255a03ac
next prev parent reply other threads:[~2025-02-03 13:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-03 13:10 [PATCH v2 00/14] pinctrl: cy8c95x0: Bugfixes and cleanups Andy Shevchenko
2025-02-03 13:10 ` [PATCH v2 01/14] pinctrl: cy8c95x0: Fix off-by-one in the regmap range settings Andy Shevchenko
2025-02-03 13:10 ` [PATCH v2 02/14] pinctrl: cy8c95x0: Avoid accessing reserved registers Andy Shevchenko
2025-02-03 13:10 ` [PATCH v2 03/14] pinctrl: cy8c95x0: Enable regmap locking for debug Andy Shevchenko
2025-02-03 13:10 ` [PATCH v2 04/14] pinctrl: cy8c95x0: Rename PWMSEL to SELPWM Andy Shevchenko
2025-02-03 13:10 ` [PATCH v2 05/14] pinctrl: cy8c95x0: Use better bitmap APIs where appropriate Andy Shevchenko
2025-02-03 13:35 ` Andy Shevchenko
2025-02-03 13:10 ` [PATCH v2 06/14] pinctrl: cy8c95x0; Switch to use for_each_set_clump8() Andy Shevchenko
2025-02-03 13:10 ` [PATCH v2 07/14] pinctrl: cy8c95x0: Transform to cy8c95x0_regmap_read_bits() Andy Shevchenko
2025-02-03 13:10 ` Andy Shevchenko [this message]
2025-02-03 13:10 ` [PATCH v2 09/14] pinctrl: cy8c95x0: Replace 'return ret' by 'return 0' in some cases Andy Shevchenko
2025-02-03 13:10 ` [PATCH v2 10/14] pinctrl: cy8c95x0: Initialise boolean variable with boolean values Andy Shevchenko
2025-02-03 13:10 ` [PATCH v2 11/14] pinctrl: cy8c95x0: Get rid of cy8c95x0_pinmux_direction() forward declaration Andy Shevchenko
2025-02-03 13:10 ` [PATCH v2 12/14] pinctrl: cy8c95x0: Drop unneeded casting Andy Shevchenko
2025-02-03 13:10 ` [PATCH v2 13/14] pinctrl: cy8c95x0: Separate EEPROM related register definitios Andy Shevchenko
2025-02-03 13:10 ` [PATCH v2 14/14] pinctrl: cy8c95x0: Fix comment style Andy Shevchenko
2025-02-03 13:35 ` [PATCH v2 00/14] pinctrl: cy8c95x0: Bugfixes and cleanups Linus Walleij
2025-02-03 14:33 ` Andy Shevchenko
2025-02-04 17:48 ` Andy Shevchenko
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=20250203131506.3318201-9-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patrick.rudolph@9elements.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 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).