devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: Robert Marko <robert.marko@sartura.hr>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Rob Herring <robh+dt@kernel.org>,
	Lee Jones <lee.jones@linaro.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v7 2/6] gpio: Add Delta TN48M CPLD GPIO driver
Date: Sat, 06 Nov 2021 00:19:51 +0100	[thread overview]
Message-ID: <cd0b876b5a043de21179eea01ca0344c@walle.cc> (raw)
In-Reply-To: <CA+HBbNEEPHLbJSdWPdxWb5gASha_NavJrEBBRkbvzEW2aDSjmQ@mail.gmail.com>

Am 2021-11-05 12:34, schrieb Robert Marko:
> On Tue, Nov 2, 2021 at 8:28 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
>> 
>> On Tue, Nov 2, 2021 at 6:57 PM Robert Marko <robert.marko@sartura.hr> 
>> wrote:
>> >
>> > Delta TN48M switch has an onboard Lattice CPLD that is used as a GPIO
>> > expander.
>> >
>> > The CPLD provides 12 pins in total on the TN48M, but on more advanced
>> > switch models it provides up to 192 pins, so the driver is extendable
>> > to support more switches.
>> 
>> ...
>> 
>> > +static int tn48m_gpio_probe(struct platform_device *pdev)
>> > +{
>> 
>> > +       const struct tn48m_gpio_config *gpio_config = NULL;
>> > +       struct gpio_regmap_config config = {0};
>> 
>> I don't see a point in assigning these variables.
> 
> Hi,
> The NULL one isn't required, but the regmap one is, otherwise the
> devm_gpio_regmap_register call will
> return -EINVAL.
> 
> It will fail here:
> https://elixir.bootlin.com/linux/latest/source/drivers/gpio/gpio-regmap.c#L209
> 
> I see that Michael Walle who did the GPIO regmap uses it as well in
> the Kontron CPLD driver.
> Michael, can you shed some light on this?

I guess this was already clarified? Because you don't set
all the properties of the config you have to initialize it.
Otherwise anything could happen.

-michael

  reply	other threads:[~2021-11-05 23:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02 16:56 [PATCH v7 1/6] mfd: simple-mfd-i2c: Add Delta TN48M CPLD support Robert Marko
2021-11-02 16:56 ` [PATCH v7 2/6] gpio: Add Delta TN48M CPLD GPIO driver Robert Marko
2021-11-02 19:27   ` Andy Shevchenko
2021-11-05 11:34     ` Robert Marko
2021-11-05 23:19       ` Michael Walle [this message]
2021-11-09 11:17         ` Robert Marko
2021-11-02 16:56 ` [PATCH v7 3/6] dt-bindings: reset: Add Delta TN48M Robert Marko
2021-11-02 16:56 ` [PATCH v7 4/6] reset: Add Delta TN48M CPLD reset controller Robert Marko
2021-11-02 19:30   ` Andy Shevchenko
2021-11-05 10:24     ` Robert Marko
2021-11-02 16:56 ` [PATCH v7 5/6] dt-bindings: mfd: Add Delta TN48M CPLD drivers bindings Robert Marko
2021-11-02 16:56 ` [PATCH v7 6/6] MAINTAINERS: Add Delta Networks TN48M CPLD drivers Robert Marko

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=cd0b876b5a043de21179eea01ca0344c@walle.cc \
    --to=michael@walle.cc \
    --cc=andy.shevchenko@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robert.marko@sartura.hr \
    --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;
as well as URLs for NNTP newsgroup(s).