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: <aBSMnNQiCbTTH_4a@smile.fi.intel.com>
Date: Fri, 2 May 2025 12:13:00 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Lee Jones <lee@...nel.org>
Cc: mathieu.dubois-briand@...tlin.com, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Kamel Bouhara <kamel.bouhara@...tlin.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	Bartosz Golaszewski <brgl@...ev.pl>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Uwe Kleine-König <ukleinek@...nel.org>,
	Michael Walle <mwalle@...nel.org>, Mark Brown <broonie@...nel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"Rafael J. Wysocki" <rafael@...nel.org>,
	Danilo Krummrich <dakr@...nel.org>, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
	linux-input@...r.kernel.org, linux-pwm@...r.kernel.org,
	Grégory Clement <gregory.clement@...tlin.com>,
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v7 02/11] mfd: Add max7360 support

On Thu, May 01, 2025 at 01:59:43PM +0100, Lee Jones wrote:
> On Mon, 28 Apr 2025, mathieu.dubois-briand@...tlin.com wrote:
> > 
> > Add core driver to support MAX7360 i2c chip, multi function device
> > with keypad, GPIO, PWM, GPO and rotary encoder submodules.

...

> > +static int max7360_probe(struct i2c_client *client)
> > +{
> > +	struct device *dev = &client->dev;
> > +	struct regmap *regmap;
> > +	int ret;
> > +
> > +	regmap = devm_regmap_init_i2c(client, &max7360_regmap_config);
> > +	if (IS_ERR(regmap))
> > +		return dev_err_probe(dev, PTR_ERR(regmap), "Failed to initialise regmap\n");
> 
> dev_err_ptr_probe()

Hmm... This one to return an error pointer casted to the needed type. I think
the given code is correct as is.

> > +	ret = max7360_reset(regmap);
> > +	if (ret)
> > +		return dev_err_probe(dev, ret, "Failed to reset device\n");
> > +
> > +	/* Get the device out of shutdown mode. */
> > +	ret = regmap_write_bits(regmap, MAX7360_REG_GPIOCFG,
> > +				MAX7360_GPIO_CFG_GPIO_EN,
> > +				MAX7360_GPIO_CFG_GPIO_EN);
> > +	if (ret)
> > +		return dev_err_probe(dev, ret, "Failed to enable GPIO and PWM module\n");
> > +
> > +	ret = max7360_mask_irqs(regmap);
> > +	if (ret)
> > +		return dev_err_probe(dev, ret, "Could not mask interrupts\n");
> > +
> > +	ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE,
> > +				   max7360_cells, ARRAY_SIZE(max7360_cells),
> > +				   NULL, 0, NULL);
> > +	if (ret)
> > +		return dev_err_probe(dev, ret, "Failed to register child devices\n");
> > +
> > +	return 0;
> > +}


-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ