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] [day] [month] [year] [list]
Message-ID: <puotk7kms35fh3mgmsg24uxwadmcqjfr5iuijr2zknezcg7dtg@zlbrphpd6jn5>
Date: Tue, 7 Jan 2025 22:50:51 +0100
From: Andi Shyti <andi.shyti@...nel.org>
To: Zoie Lin <zoie.lin@...iatek.com>
Cc: Qii Wang <qii.wang@...iatek.com>, 
	Matthias Brugger <matthias.bgg@...il.com>, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, Project_Global_Chrome_Upstream_Group@...iatek.com, 
	linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org, teddy.chen@...iatek.com
Subject: Re: [PATCH v3 1/1] i2c: mediatek: add runtime PM operations and bus
 regulator control

Hi Zoie,

On Fri, Jan 03, 2025 at 10:32:34PM +0800, Zoie Lin wrote:
> This commit introduces support for runtime PM operations in
> the I2C driver, enabling runtime suspend and resume functionality.

Please, don't start the commit log with "This patch...", please
use the informative form.

> Although in the most platforms, the bus power of i2c are always

/the//
/are/is/

> on, some platforms disable the i2c bus power in order to meet
> low power request.
> 
> This implementation includes bus regulator control to facilitate
> proper handling of the bus power based on platform requirements.
> 
> Signed-off-by: Zoie Lin <zoie.lin@...iatek.com>

...

> +static int mtk_i2c_runtime_resume(struct device *dev)
> +{
> +	int ret = 0;

initialization is not needed.

> +	struct mtk_i2c *i2c = dev_get_drvdata(dev);
> +
> +	if (i2c->adap.bus_regulator) {
> +		ret = regulator_enable(i2c->adap.bus_regulator);
> +		if (ret) {
> +			dev_err(dev, "enable regulator failed!\n");
> +			return ret;
> +		}
> +	}
> +
> +	ret = clk_bulk_enable(I2C_MT65XX_CLK_MAX, i2c->clocks);
> +	if (ret) {
> +		if (i2c->adap.bus_regulator)
> +			regulator_disable(i2c->adap.bus_regulator);
> +		return ret;

no need to return here...

> +	}

... you can remove the brackets...

> +	return 0;

... return ret;

Andi

> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ