Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v3 01/12] iio:dac:ad5755: Switch to generic firmware properties and drop pdata
Date: Mon, 6 Dec 2021 13:22:03 +0000	[thread overview]
Message-ID: <20211206132203.00006686@Huawei.com> (raw)
In-Reply-To: <CAHp75VenfEMhYjjst4VwZDorwr0Be6CBOH6zhciQSD1AmUbSTA@mail.gmail.com>

On Sun, 5 Dec 2021 22:09:36 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Sun, Dec 5, 2021 at 6:56 PM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > Lars pointed out that platform data can also be supported via the
> > generic properties interface, so there is no point in continuing to
> > support it separately.  Hence squish the linux/platform_data/ad5755.h
> > header into the c file and drop accessing the platform data directly.
> >
> > Done by inspection only.  Mostly completely mechanical with the
> > exception of a few places where default value handling is
> > cleaner done by first setting the value, then calling the
> > firmware reading function but and not checking the return value,
> > as opposed to reading firmware then setting the default if an error
> > occurs.
> >
> > Part of general attempt to move all of IIO over to generic
> > device properties, both to enable other firmware types and
> > to remove drivers that can be the source of of_ specific
> > behaviour in new drivers.  
> 
> I was looking again into these enums thinking that it might be a good
> place for them in include/dr-bindings/ but after reading the schema I
> realized that they are rather encoded, while the schema is using
> decoded values. So, scratch this. But I have noticed one more thing
> (see below).
> 
> ...
> 
> >         devm_kfree(dev, pdata);
> >         return NULL;  
> 
> Sorry, haven't noticed this one, do we really need this devm_kfree() call?
> Shouldn't there be better error reporting then? (Note, it's just
> thoughts for further improvements).
>
I wondered about this.  The driver will currently successfully
probe with broken firmware and fall back to the defaults.

If we change that (and hence have this return an ERR_PTR() and fail
the probe) then we risk a regression if someone actually has a platform
with a firmware broken in this fashion.

The path that triggers this is when there are too many child nodes.

I'm tempted to say that supporting something that broken is beyond what
we should bother with and just drop this muddling on (as a follow up patch).
If anyone reports a regression as a result we can put it back again...

Jonathan

  reply	other threads:[~2021-12-06 13:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-05 17:01 [PATCH v3 00/12] IIO: More of to generic fw conversions Jonathan Cameron
2021-12-05 17:01 ` [PATCH v3 01/12] iio:dac:ad5755: Switch to generic firmware properties and drop pdata Jonathan Cameron
2021-12-05 20:09   ` Andy Shevchenko
2021-12-06 13:22     ` Jonathan Cameron [this message]
2021-12-05 17:01 ` [PATCH v3 02/12] iio:dac:ad5758: Drop unused of specific headers Jonathan Cameron
2021-12-05 17:01 ` [PATCH v3 03/12] iio:dac:dpot-dac: Swap of.h for mod_devicetable.h Jonathan Cameron
2021-12-05 17:01 ` [PATCH v3 04/12] iio:dac:lpc18xx_dac: Swap from of* to mod_devicetable.h Jonathan Cameron
2021-12-05 17:01 ` [PATCH v3 05/12] iio:pot:mcp41010: Switch to generic firmware properties Jonathan Cameron
2021-12-05 17:01 ` [PATCH v3 06/12] iio:light:cm3605: " Jonathan Cameron
2021-12-05 17:01 ` [PATCH v3 07/12] iio:adc:max9611: " Jonathan Cameron
2021-12-05 17:01 ` [PATCH v3 08/12] iio:adc:mcp3911: " Jonathan Cameron
2021-12-07 19:31   ` Marcus Folkesson
2021-12-05 17:01 ` [PATCH v3 09/12] iio:adc:ti-adc12138: Switch to generic firmware properties and drop of_match_ptr Jonathan Cameron
2021-12-05 17:01 ` [PATCH v3 10/12] iio:adc:envelope-detector: Switch from of headers to mod_devicetable.h Jonathan Cameron
2021-12-05 17:01 ` [PATCH v3 11/12] iio:adc:ti-ads124s08: Drop dependency on OF Jonathan Cameron
2021-12-05 17:01 ` [PATCH v3 12/12] iio:adc/dac:Kconfig: Update to drop OF dependencies Jonathan Cameron
2021-12-12 16:19 ` [PATCH v3 00/12] IIO: More of to generic fw conversions Jonathan Cameron

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=20211206132203.00006686@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@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