[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <605880ad-6c12-bf1d-45f8-ef70181e4eec@canonical.com>
Date: Fri, 5 Mar 2021 12:25:39 +0100
From: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
To: Brad Larson <brad@...sando.io>,
linux-arm-kernel@...ts.infradead.org
Cc: arnd@...db.de, linus.walleij@...aro.org, bgolaszewski@...libre.com,
broonie@...nel.org, fancer.lancer@...il.com,
adrian.hunter@...el.com, ulf.hansson@...aro.org, olof@...om.net,
linux-gpio@...r.kernel.org, linux-spi@...r.kernel.org,
linux-mmc@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/8] gpio: Add Elba SoC gpio driver for spi cs control
On 04/03/2021 04:41, Brad Larson wrote:
> This GPIO driver is for the Pensando Elba SoC which
> provides control of four chip selects on two SPI busses.
>
> Signed-off-by: Brad Larson <brad@...sando.io>
> ---
> drivers/gpio/Kconfig | 6 ++
> drivers/gpio/Makefile | 1 +
> drivers/gpio/gpio-elba-spics.c | 120 +++++++++++++++++++++++++++++++++
> 3 files changed, 127 insertions(+)
> create mode 100644 drivers/gpio/gpio-elba-spics.c
(...)
> +static int elba_spics_probe(struct platform_device *pdev)
> +{
> + struct elba_spics_priv *p;
> + struct resource *res;
> + int ret;
> +
> + p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
> + if (!p)
> + return -ENOMEM;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + p->base = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(p->base)) {
> + dev_err(&pdev->dev, "failed to remap I/O memory\n");
> + return PTR_ERR(p->base);
> + }
> + spin_lock_init(&p->lock);
> + platform_set_drvdata(pdev, p);
> +
> + p->chip.ngpio = 4; /* 2 cs pins for spi0, and 2 for spi1 */
> + p->chip.base = -1;
> + p->chip.direction_input = elba_spics_direction_input;
> + p->chip.direction_output = elba_spics_direction_output;
> + p->chip.get = elba_spics_get_value;
> + p->chip.set = elba_spics_set_value;
> + p->chip.label = dev_name(&pdev->dev);
> + p->chip.parent = &pdev->dev;
> + p->chip.owner = THIS_MODULE;
> +
> + ret = devm_gpiochip_add_data(&pdev->dev, &p->chip, p);
> + if (ret) {
> + dev_err(&pdev->dev, "unable to add gpio chip\n");
> + return ret;
> + }
> +
> + dev_info(&pdev->dev, "elba spics registered\n");
Don't print trivial probe results, unless you print here something
useful. If you need it for debugging, keep it dev_dbg.
Best regards,
Krzysztof
Powered by blists - more mailing lists