lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240930093635.6pyp4qole3qynllq@pengutronix.de>
Date: Mon, 30 Sep 2024 11:36:35 +0200
From: Marco Felsch <m.felsch@...gutronix.de>
To: Miquel Raynal <miquel.raynal@...tlin.com>
Cc: "Peng Fan (OSS)" <peng.fan@....nxp.com>,
	Tudor Ambarus <tudor.ambarus@...aro.org>,
	Pratyush Yadav <pratyush@...nel.org>,
	Michael Walle <mwalle@...nel.org>,
	Richard Weinberger <richard@....at>,
	Vignesh Raghavendra <vigneshr@...com>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Pengutronix Kernel Team <kernel@...gutronix.de>,
	Fabio Estevam <festevam@...il.com>, linux-mtd@...ts.infradead.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
	Peng Fan <peng.fan@....com>
Subject: Re: [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator

Hi Miquel,

On 24-09-30, Miquel Raynal wrote:
> Hi,
> 
> peng.fan@....nxp.com wrote on Mon, 30 Sep 2024 17:22:25 +0800:
> 
> > From: Peng Fan <peng.fan@....com>
> > 
> > SPI NOR flashes needs power supply to work properly. The power supply
> > maybe software controllable per board design. So add the support
> > for an vcc-supply regulator.
> > 
> > Signed-off-by: Peng Fan <peng.fan@....com>
> > ---
> >  drivers/mtd/spi-nor/core.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> > index 9d6e85bf227b..5249c8b13916 100644
> > --- a/drivers/mtd/spi-nor/core.c
> > +++ b/drivers/mtd/spi-nor/core.c
> > @@ -17,6 +17,7 @@
> >  #include <linux/mtd/spi-nor.h>
> >  #include <linux/mutex.h>
> >  #include <linux/of_platform.h>
> > +#include <linux/regulator/consumer.h>
> >  #include <linux/sched/task_stack.h>
> >  #include <linux/sizes.h>
> >  #include <linux/slab.h>
> > @@ -3462,6 +3463,10 @@ int spi_nor_scan(struct spi_nor *nor, const char *name,
> >  	if (!nor->bouncebuf)
> >  		return -ENOMEM;
> >  
> > +	ret = devm_regulator_get_enable(dev, "vcc");
> 
> 					_optional ?

The regulator optional API is different compared to other optional APIs.
If we would use optional here, we would need to check the returned error
code. On the other hand if the non optional API is used and the
regualtor is missing, a dummy regualtor is returned (as pointed out by
Marc).

Please see the _optional API doc to see more information about the
_optional usage.

Regards,
  Marco

> > +	if (ret)
> > +		return ret;
> > +
> >  	ret = spi_nor_hw_reset(nor);
> >  	if (ret)
> >  		return ret;
> > 
> 
> 
> Thanks,
> Miquèl
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ