[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0993ec4e-c0cd-4e63-a0b3-3b9db0082279@infradead.org>
Date: Tue, 3 Jun 2025 15:50:28 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Pratap Nirujogi <pratap.nirujogi@....com>, andi.shyti@...nel.org,
hdegoede@...hat.com, ilpo.jarvinen@...ux.intel.com,
mario.limonciello@....com, sfr@...b.auug.org.au, linux-next@...r.kernel.org
Cc: linux-i2c@...r.kernel.org, platform-driver-x86@...r.kernel.org,
linux-kernel@...r.kernel.org, benjamin.chan@....com, bin.du@....com,
gjorgji.rosikopulos@....com, king.li@....com, dantony@....com
Subject: Re: [PATCH v2 1/3] i2c: designware: Initialize adapter name only when
not set
On 6/3/25 2:40 PM, Pratap Nirujogi wrote:
> Check if the adapter name is already set in the driver prior
> to initializing with generic name in i2c_dw_probe_master().
That explains what but not why. Commits should also explain
why they are doing something.
>
> Signed-off-by: Pratap Nirujogi <pratap.nirujogi@....com>
Tested-by: Randy Dunlap <rdunlap@...radead.org>
Thanks.
> ---
> drivers/i2c/busses/i2c-designware-master.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c
> index c5394229b77f..9d7d9e47564a 100644
> --- a/drivers/i2c/busses/i2c-designware-master.c
> +++ b/drivers/i2c/busses/i2c-designware-master.c
> @@ -1042,8 +1042,9 @@ int i2c_dw_probe_master(struct dw_i2c_dev *dev)
> if (ret)
> return ret;
>
> - snprintf(adap->name, sizeof(adap->name),
> - "Synopsys DesignWare I2C adapter");
> + if (!adap->name[0])
> + scnprintf(adap->name, sizeof(adap->name),
> + "Synopsys DesignWare I2C adapter");
> adap->retries = 3;
> adap->algo = &i2c_dw_algo;
> adap->quirks = &i2c_dw_quirks;
--
~Randy
Powered by blists - more mailing lists