linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joel Stanley <joel@jms.id.au>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: Philipp Zabel <philipp.zabel@gmail.com>,
	Brendan Higgins <brendanhiggins@google.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Andrew Jeffery <andrew@aj.id.au>,
	linux-i2c@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] i2c: aspeed: Deassert reset in probe
Date: Mon, 30 Oct 2017 13:48:01 +1030	[thread overview]
Message-ID: <CACPK8XfYeviC5hrqM2Q33sExduBkKQiK_LVg=pg1q2Nbh_fecw@mail.gmail.com> (raw)
In-Reply-To: <20171026205348.zh2gicql4pyyeoaa@ninjato>

On Fri, Oct 27, 2017 at 7:23 AM, Wolfram Sang <wsa@the-dreams.de> wrote:
>> > +       bus->rst = devm_reset_control_get_optional_shared(&pdev->dev, NULL);
>>
>> This could return error values in case of broken device trees, so you
>> may want to check IS_ERR(bus->rst) and handle the error here.

>From my understanding the optional variant of the API will set
silently fail. That was my intention - an outdated device tree would
result in the same behaviour as the old driver.

>>
>> > +       reset_control_deassert(bus->rst);
>>
>> Otherwise this will dump a warning.
>>
>> > +
>> >         ret = of_property_read_u32(pdev->dev.of_node,
>> >                                    "bus-frequency", &bus->bus_frequency);
>> >         if (ret < 0) {
>> > @@ -919,6 +925,8 @@ static int aspeed_i2c_remove_bus(struct platform_device *pdev)
>> >
>> >         i2c_del_adapter(&bus->adap);
>> >
>> > +       reset_control_assert(bus->rst);
>>
>> As will this.
>>
>> Reviewed-by: Philipp Zabel <philipp.zabel@gmail.com>
>
> Joel, do you want to fix it? I'd think it makes sense...

Sorry, I've been on vacation. I thought the _optional variant of the
API would do the right thing for my use case (silently fail on old
device trees), but I'll add a check.

v3 incoming.

Cheers,

Joel

      reply	other threads:[~2017-10-30  3:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18 14:29 [PATCH v2] i2c: aspeed: Deassert reset in probe Joel Stanley
2017-10-18 17:40 ` Brendan Higgins
2017-10-18 21:10 ` Philipp Zabel
2017-10-26 20:53   ` Wolfram Sang
2017-10-30  3:18     ` Joel Stanley [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='CACPK8XfYeviC5hrqM2Q33sExduBkKQiK_LVg=pg1q2Nbh_fecw@mail.gmail.com' \
    --to=joel@jms.id.au \
    --cc=andrew@aj.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=brendanhiggins@google.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philipp.zabel@gmail.com \
    --cc=wsa@the-dreams.de \
    /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).