linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Robert Marko <robert.marko@sartura.hr>
Cc: 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>,
	Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH v7 2/6] gpio: Add Delta TN48M CPLD GPIO driver
Date: Tue, 2 Nov 2021 21:27:22 +0200	[thread overview]
Message-ID: <CAHp75VdnQq76f5Xeo5LCq83sr4TbcXY_mtZ4x_rFzUkS01BYZg@mail.gmail.com> (raw)
In-Reply-To: <20211102165657.3428995-2-robert.marko@sartura.hr>

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.

> +       struct regmap *regmap;
> +       u32 base;
> +       int ret;
> +
> +       if (!pdev->dev.parent)
> +               return -ENODEV;
> +
> +       gpio_config = device_get_match_data(&pdev->dev);
> +       if (!gpio_config)
> +               return -ENODEV;
> +
> +       ret = device_property_read_u32(&pdev->dev, "reg", &base);
> +       if (ret)
> +               return ret;
> +
> +       regmap = dev_get_regmap(pdev->dev.parent, NULL);
> +       if (!regmap)
> +               return -ENODEV;

> +}

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2021-11-02 19:28 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 [this message]
2021-11-05 11:34     ` Robert Marko
2021-11-05 23:19       ` Michael Walle
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=CAHp75VdnQq76f5Xeo5LCq83sr4TbcXY_mtZ4x_rFzUkS01BYZg@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=andrew@lunn.ch \
    --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).