linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Tomer Maimon <tmaimon77@gmail.com>,
	avifishman70@gmail.com, tali.perry1@gmail.com, joel@jms.id.au,
	venture@google.com, yuenn@google.com, benjaminfair@google.com,
	linus.walleij@linaro.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, j.neuschaefer@gmx.net,
	zhengbin13@huawei.com
Cc: openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v1 2/2] pinctrl: nuvoton: add NPCM8XX pinctrl and GPIO driver
Date: Tue, 12 Jul 2022 11:50:45 +0200	[thread overview]
Message-ID: <95d12b72-be9d-5503-c4ea-801303bb7776@linaro.org> (raw)
In-Reply-To: <20220710102110.39748-3-tmaimon77@gmail.com>

On 10/07/2022 12:21, Tomer Maimon wrote:
> Add pinctrl and GPIO controller driver support to Arbel BMC NPCM8XX SoC.
> 
> Arbel BMC NPCM8XX pinctrl driver based on Poleg NPCM7XX, except the
> pin mux mapping difference the NPCM8XX GPIO supports adjust debounce
> period time.
> 
> Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>

(...)

> +
> +static int npcm8xx_pinctrl_probe(struct platform_device *pdev)
> +{
> +	struct npcm8xx_pinctrl *pctrl;
> +	int ret;
> +
> +	pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
> +	if (!pctrl)
> +		return -ENOMEM;
> +
> +	pctrl->dev = &pdev->dev;
> +	dev_set_drvdata(&pdev->dev, pctrl);
> +
> +	pctrl->gcr_regmap =
> +		syscon_regmap_lookup_by_compatible("nuvoton,npcm845-gcr");

No. Use property. By this patchset, I would expect that you learnt from
previous mistakes around this. Why repeating the same trouble second time?

> +	if (IS_ERR(pctrl->gcr_regmap)) {
> +		dev_err(pctrl->dev, "didn't find nuvoton,npcm845-gcr\n");
> +		return PTR_ERR(pctrl->gcr_regmap);
> +	}
> +
> +	ret = npcm8xx_gpio_of(pctrl);
> +	if (ret < 0) {
> +		dev_err(pctrl->dev, "Failed to gpio dt-binding %u\n", ret);
> +		return ret;
> +	}
> +
> +	pctrl->pctldev = devm_pinctrl_register(&pdev->dev,
> +					       &npcm8xx_pinctrl_desc, pctrl);
> +	if (IS_ERR(pctrl->pctldev)) {
> +		dev_err(&pdev->dev, "Failed to register pinctrl device\n");
> +		return PTR_ERR(pctrl->pctldev);
> +	}
> +
> +	ret = npcm8xx_gpio_register(pctrl);
> +	if (ret < 0) {
> +		dev_err(pctrl->dev, "Failed to register gpio %u\n", ret);
> +		return ret;
> +	}
> +
> +	pr_info("npcm8xx Pinctrl driver probed\n");


No pr_ in devices. No success debug messages.

> +	return 0;
> +}
> +
> +static const struct of_device_id npcm8xx_pinctrl_match[] = {
> +	{ .compatible = "nuvoton,npcm845-pinctrl" },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, npcm8xx_pinctrl_match);
> +
> +static struct platform_driver npcm8xx_pinctrl_driver = {
> +	.probe = npcm8xx_pinctrl_probe,
> +	.driver = {
> +		.name = "npcm8xx-pinctrl",
> +		.of_match_table = npcm8xx_pinctrl_match,
> +		.suppress_bind_attrs = true,
> +	},
> +};
> +
> +static int __init npcm8xx_pinctrl_register(void)
> +{
> +	return platform_driver_register(&npcm8xx_pinctrl_driver);
> +}
> +arch_initcall(npcm8xx_pinctrl_register);
> +
> +MODULE_LICENSE("GPL v2");
> +MODULE_AUTHOR("tomer.maimon@nuvoton.com");
> +MODULE_DESCRIPTION("Nuvoton NPCM8XX Pinctrl and GPIO driver");


Best regards,
Krzysztof

  parent reply	other threads:[~2022-07-12  9:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-10 10:21 [PATCH v1 0/2] pinctrl: nuvoton: add pinmux and GPIO driver for NPCM8XX Tomer Maimon
2022-07-10 10:21 ` [PATCH v1 1/2] dt-binding: pinctrl: Add NPCM8XX pinctrl and GPIO documentation Tomer Maimon
2022-07-12  9:48   ` Krzysztof Kozlowski
2022-07-12 13:29     ` Tomer Maimon
2022-07-12 13:45       ` Krzysztof Kozlowski
2022-07-12 18:44         ` Tomer Maimon
2022-07-12 20:44           ` Krzysztof Kozlowski
2022-07-13 15:06             ` Tomer Maimon
2022-07-10 10:21 ` [PATCH v1 2/2] pinctrl: nuvoton: add NPCM8XX pinctrl and GPIO driver Tomer Maimon
2022-07-10 19:35   ` Andy Shevchenko
2022-07-12 11:33     ` Tomer Maimon
2022-07-12 12:47       ` Andy Shevchenko
2022-07-12 19:00         ` Tomer Maimon
2022-07-12  9:50   ` Krzysztof Kozlowski [this message]
2022-07-12 11:34     ` Tomer Maimon
2022-07-13 13:35     ` Tomer Maimon
2022-07-13 14:28       ` Krzysztof Kozlowski
2022-07-13 14:51         ` Tomer Maimon
2022-07-13 14:57           ` Krzysztof Kozlowski

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=95d12b72-be9d-5503-c4ea-801303bb7776@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=avifishman70@gmail.com \
    --cc=benjaminfair@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=j.neuschaefer@gmx.net \
    --cc=joel@jms.id.au \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=robh+dt@kernel.org \
    --cc=tali.perry1@gmail.com \
    --cc=tmaimon77@gmail.com \
    --cc=venture@google.com \
    --cc=yuenn@google.com \
    --cc=zhengbin13@huawei.com \
    /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).