devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Drew Fustini <dfustini@tenstorrent.com>
To: Kees Bakker <kees@ijzerbout.nl>
Cc: Drew Fustini <drew@pdp7.com>, Guo Ren <guoren@kernel.org>,
	Fu Wei <wefu@redhat.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Emil Renner Berthing <emil.renner.berthing@canonical.com>,
	Thomas Bonnefille <thomas.bonnefille@bootlin.com>,
	linux-riscv@lists.infradead.org, linux-gpio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/8] pinctrl: Add driver for the T-Head TH1520 SoC
Date: Wed, 2 Oct 2024 19:43:13 -0700	[thread overview]
Message-ID: <Zv4EwWPoSMir1C2J@x1> (raw)
In-Reply-To: <87770518-5f63-4adf-b6ea-c7f92b58ce22@ijzerbout.nl>

On Wed, Oct 02, 2024 at 09:36:59PM +0200, Kees Bakker wrote:
> Op 30-09-2024 om 21:50 schreef Drew Fustini:
> > From: Emil Renner Berthing <emil.renner.berthing@canonical.com>
> > 
> > Add pinctrl driver for the T-Head TH1520 RISC-V SoC.
> > 
> > Tested-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
> > Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
> > [dfustini: use thead,pad-group to identify the pin controller instance]
> > Signed-off-by: Drew Fustini <dfustini@tenstorrent.com>
> > ---
> >   MAINTAINERS                      |   1 +
> >   drivers/pinctrl/Kconfig          |  13 +
> >   drivers/pinctrl/Makefile         |   1 +
> >   drivers/pinctrl/pinctrl-th1520.c | 907 +++++++++++++++++++++++++++++++++++++++
> >   4 files changed, 922 insertions(+)
> > 
> > [...]
> > +static int th1520_pinmux_set_mux(struct pinctrl_dev *pctldev,
> > +				 unsigned int fsel, unsigned int gsel)
> > +{
> > +	struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
> > +	const struct function_desc *func = pinmux_generic_get_function(pctldev, fsel);
> func can be NULL after calling pinmux_generic_get_function
> Please add something to avoid NULL pointer dereferencing in the next
> statement.
> All other callers of pinmux_generic_get_function have something like this:
>     if (!func)
>         return -EINVAL;

Thanks for catching this. I see that another person has posted a patch
as a result so I'll respond over in that thread [1].

Drew

[1] https://lore.kernel.org/lkml/20241003023307.2138695-1-clf700383@gmail.com/

  reply	other threads:[~2024-10-03  2:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-30 19:50 [PATCH v3 0/8] pinctrl: Add T-Head TH1520 SoC pin controllers Drew Fustini
2024-09-30 19:50 ` [PATCH v3 1/8] dt-bindings: pinctrl: Add thead,th1520-pinctrl bindings Drew Fustini
2024-09-30 19:50 ` [PATCH v3 2/8] pinctrl: Add driver for the T-Head TH1520 SoC Drew Fustini
2024-10-02 19:36   ` Kees Bakker
2024-10-03  2:43     ` Drew Fustini [this message]
2024-09-30 19:50 ` [PATCH v3 3/8] riscv: dts: thead: Add TH1520 pin control nodes Drew Fustini
2024-09-30 19:50 ` [PATCH v3 4/8] riscv: dts: thead: Add TH1520 GPIO ranges Drew Fustini
2024-09-30 19:50 ` [PATCH v3 5/8] riscv: dts: thead: Adjust TH1520 GPIO labels Drew Fustini
2024-09-30 19:50 ` [PATCH v3 6/8] riscv: dts: thead: Add Lichee Pi 4M GPIO line names Drew Fustini
2024-10-12 13:46   ` Emil Renner Berthing
2024-09-30 19:50 ` [PATCH v3 7/8] riscv: dts: thead: Add TH1520 pinctrl settings for UART0 Drew Fustini
2024-10-12 13:48   ` Emil Renner Berthing
2024-09-30 19:50 ` [PATCH v3 8/8] riscv: dtb: thead: Add BeagleV Ahead LEDs Drew Fustini
2024-10-12 14:41   ` Emil Renner Berthing
2024-10-01 12:13 ` [PATCH v3 0/8] pinctrl: Add T-Head TH1520 SoC pin controllers Linus Walleij
2024-10-02 18:34   ` Drew Fustini
2024-10-02 20:46     ` Linus Walleij
2024-10-03  0:02       ` Drew Fustini
2024-10-11 17:22 ` Drew Fustini

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=Zv4EwWPoSMir1C2J@x1 \
    --to=dfustini@tenstorrent.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=drew@pdp7.com \
    --cc=emil.renner.berthing@canonical.com \
    --cc=guoren@kernel.org \
    --cc=kees@ijzerbout.nl \
    --cc=krzk+dt@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    --cc=thomas.bonnefille@bootlin.com \
    --cc=wefu@redhat.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).