All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Robin Murphy <robin.murphy@arm.com>
Cc: shawn.lin@rock-chips.com, lorenzo.pieralisi@arm.com,
	andrew.murray@arm.com, bhelgaas@google.com, heiko@sntech.de,
	lgirdwood@gmail.com, linux-pci@vger.kernel.org,
	linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] PCI: rockchip: Simplify optional regulator handling
Date: Mon, 18 Nov 2019 11:59:30 +0000	[thread overview]
Message-ID: <20191118115930.GC9761@sirena.org.uk> (raw)
In-Reply-To: <347bc3ef8399577e4cef3fdbf3af34d20b4ad27e.1573908530.git.robin.murphy@arm.com>

[-- Attachment #1: Type: text/plain, Size: 679 bytes --]

On Sat, Nov 16, 2019 at 12:54:20PM +0000, Robin Murphy wrote:
> Null checks are both cheaper and more readable than having !IS_ERR()
> splattered everywhere.

> -	if (IS_ERR(rockchip->vpcie3v3))
> +	if (!rockchip->vpcie3v3)
>  		return;
>  
>  	/*
> @@ -611,6 +611,7 @@ static int rockchip_pcie_parse_host_dt(struct rockchip_pcie *rockchip)
>  		if (PTR_ERR(rockchip->vpcie12v) != -ENODEV)
>  			return PTR_ERR(rockchip->vpcie12v);
>  		dev_info(dev, "no vpcie12v regulator found\n");
> +		rockchip->vpcie12v = NULL;

According to the API NULL is a valid regulator.  We don't currently
actually do this but it's storing up surprises if you treat it as
invalid.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org>
To: Robin Murphy <robin.murphy@arm.com>
Cc: lorenzo.pieralisi@arm.com, heiko@sntech.de,
	linux-pci@vger.kernel.org, shawn.lin@rock-chips.com,
	lgirdwood@gmail.com, linux-rockchip@lists.infradead.org,
	bhelgaas@google.com, andrew.murray@arm.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] PCI: rockchip: Simplify optional regulator handling
Date: Mon, 18 Nov 2019 11:59:30 +0000	[thread overview]
Message-ID: <20191118115930.GC9761@sirena.org.uk> (raw)
In-Reply-To: <347bc3ef8399577e4cef3fdbf3af34d20b4ad27e.1573908530.git.robin.murphy@arm.com>


[-- Attachment #1.1: Type: text/plain, Size: 679 bytes --]

On Sat, Nov 16, 2019 at 12:54:20PM +0000, Robin Murphy wrote:
> Null checks are both cheaper and more readable than having !IS_ERR()
> splattered everywhere.

> -	if (IS_ERR(rockchip->vpcie3v3))
> +	if (!rockchip->vpcie3v3)
>  		return;
>  
>  	/*
> @@ -611,6 +611,7 @@ static int rockchip_pcie_parse_host_dt(struct rockchip_pcie *rockchip)
>  		if (PTR_ERR(rockchip->vpcie12v) != -ENODEV)
>  			return PTR_ERR(rockchip->vpcie12v);
>  		dev_info(dev, "no vpcie12v regulator found\n");
> +		rockchip->vpcie12v = NULL;

According to the API NULL is a valid regulator.  We don't currently
actually do this but it's storing up surprises if you treat it as
invalid.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-11-18 11:59 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-16 12:54 [PATCH 1/2] PCI: rockchip: Make some regulators non-optional Robin Murphy
2019-11-16 12:54 ` Robin Murphy
2019-11-16 12:54 ` Robin Murphy
2019-11-16 12:54 ` [PATCH 2/2] PCI: rockchip: Simplify optional regulator handling Robin Murphy
2019-11-16 12:54   ` Robin Murphy
2019-11-16 12:54   ` Robin Murphy
2019-11-18 11:59   ` Mark Brown [this message]
2019-11-18 11:59     ` Mark Brown
2019-11-18 12:20     ` Robin Murphy
2019-11-18 12:20       ` Robin Murphy
2019-11-18 12:20       ` Robin Murphy
2019-11-18 12:39       ` Andrew Murray
2019-11-18 12:39         ` Andrew Murray
2019-11-18 12:39         ` Andrew Murray
2019-11-18 13:10         ` Robin Murphy
2019-11-18 13:10           ` Robin Murphy
2019-11-18 13:10           ` Robin Murphy
2019-11-18 13:17           ` Andrew Murray
2019-11-18 13:17             ` Andrew Murray
2019-11-18 13:17             ` Andrew Murray
2019-11-18 14:24     ` Bjorn Helgaas
2019-11-18 14:24       ` Bjorn Helgaas
2019-11-18 14:24       ` Bjorn Helgaas
2019-11-18 18:15       ` Lorenzo Pieralisi
2019-11-18 18:15         ` Lorenzo Pieralisi
2019-11-18 18:15         ` Lorenzo Pieralisi
2019-11-18 18:38         ` Mark Brown
2019-11-18 18:38           ` Mark Brown
2019-11-18 11:57 ` [PATCH 1/2] PCI: rockchip: Make some regulators non-optional Mark Brown
2019-11-18 11:57   ` Mark Brown
2019-11-18 12:28 ` Andrew Murray
2019-11-18 12:28   ` Andrew Murray
2019-11-18 12:28   ` Andrew Murray
2019-11-20 17:05 ` Lorenzo Pieralisi
2019-11-20 17:05   ` Lorenzo Pieralisi
2019-11-20 17:05   ` Lorenzo Pieralisi
2020-11-07 11:36   ` Qu Wenruo
2020-11-07 11:36     ` Qu Wenruo
2020-11-07 11:36     ` Qu Wenruo
2020-11-07 11:57     ` Qu Wenruo
2020-11-07 11:57       ` Qu Wenruo
2020-11-07 11:57       ` Qu Wenruo
2020-11-07 12:47     ` Robin Murphy
2020-11-07 12:47       ` Robin Murphy
2020-11-07 12:47       ` Robin Murphy
2020-11-07 12:54       ` Qu Wenruo
2020-11-07 12:54         ` Qu Wenruo
2020-11-07 12:54         ` Qu Wenruo
2020-11-07 13:30         ` Qu Wenruo
2020-11-07 13:30           ` Qu Wenruo
2020-11-07 13:30           ` Qu Wenruo
2020-11-09 12:00           ` Robin Murphy
2020-11-09 12:00             ` Robin Murphy
2020-11-09 12:00             ` Robin Murphy
2020-11-09 12:38             ` Qu Wenruo
2020-11-09 12:38               ` Qu Wenruo
2020-11-09 12:38               ` Qu Wenruo

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=20191118115930.GC9761@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=andrew.murray@arm.com \
    --cc=bhelgaas@google.com \
    --cc=heiko@sntech.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=robin.murphy@arm.com \
    --cc=shawn.lin@rock-chips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.