From: Mark Brown <broonie@kernel.org>
To: Okan Sahin <okan.sahin@analog.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Ibrahim Tilki <Ibrahim.Tilki@analog.com>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v1 2/2] regulator: max77857: Add ADI MAX77857/MAX77831 Regulator Support
Date: Tue, 13 Jun 2023 15:22:35 +0100 [thread overview]
Message-ID: <6e75f1b5-db99-43c8-aae9-132269b2eb89@sirena.org.uk> (raw)
In-Reply-To: <20230613080552.4492-3-okan.sahin@analog.com>
[-- Attachment #1: Type: text/plain, Size: 1344 bytes --]
On Tue, Jun 13, 2023 at 11:05:50AM +0300, Okan Sahin wrote:
> +struct regmap_config max77857_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> + .cache_type = REGCACHE_RBTREE,
Please use the more modern REGCACHE_MAPLE for new devices.
> +static irqreturn_t max77857_irq_handler(int irq, void *data)
> +{
> + struct regulator_dev *rdev = data;
> + enum max77857_id id = (enum max77857_id)rdev_get_drvdata(rdev);
> + struct device *dev = &rdev->dev;
> + unsigned long flags = 0;
> + unsigned int status;
> + int ret;
> +
> + switch (id) {
> + case ID_MAX77831:
> + case ID_MAX77857:
> + ret = regmap_read(rdev->regmap, MAX77857_REG_INT_SRC, &status);
> + break;
> + default:
> + return IRQ_HANDLED;
> + }
We just completely ignore the interrupt if it's not one of the supported
devices, that seems wrong - it looks likee those devices don't have the
support for interrupts at all and so should never get here? If the
interrupt does go off then this is likely to lead to problems. I think
it'd be better if the driver just didn't request the interrupt for
devices that it doesn't support interrupts for, if there's no interrupt
support in the hardware for those it could also complain if one is
specified though that's optional.
> + if (ret) {
> + dev_err(dev, "cannot read status\n");
> + return IRQ_HANDLED;
> + }
IRQ_NONE.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2023-06-13 14:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-13 8:05 [PATCH v1 0/2] Add " Okan Sahin
2023-06-13 8:05 ` [PATCH v1 1/2] dt-bindings: regulator: max77857: Add ADI MAX77831/MAX77831 Regulator Okan Sahin
2023-06-13 9:18 ` Rob Herring
2023-06-13 13:39 ` Rob Herring
2023-06-13 13:39 ` Rob Herring
2023-06-13 8:05 ` [PATCH v1 2/2] regulator: max77857: Add ADI MAX77857/MAX77831 Regulator Support Okan Sahin
2023-06-13 14:22 ` Mark Brown [this message]
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=6e75f1b5-db99-43c8-aae9-132269b2eb89@sirena.org.uk \
--to=broonie@kernel.org \
--cc=Ibrahim.Tilki@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=okan.sahin@analog.com \
--cc=robh+dt@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®