[PATCH 06/13] i3c: mipi-i3c-hci-pci: Factor out private registers ioremapping

Adrian Hunter adrian.hunter at intel.com
Thu Nov 13 05:02:41 PST 2025


On 12/11/2025 18:09, Frank Li wrote:
> On Wed, Nov 12, 2025 at 12:03:32PM +0200, Adrian Hunter wrote:
>> For neatness, factor out private registers ioremapping.
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter at intel.com>
>> ---
> 
> feel like not beanfit.

The benefit is that it is neater and more readable.

> 
> Frank
> 
>>  drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c | 12 ++++++++----
>>  1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c b/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
>> index 59c592446b5c..003ae61e9f6c 100644
>> --- a/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
>> +++ b/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
>> @@ -27,15 +27,19 @@ static DEFINE_IDA(mipi_i3c_hci_pci_ida);
>>  #define INTEL_RESETS_RESET_DONE		BIT(1)
>>  #define INTEL_RESETS_TIMEOUT_US		10000
>>
>> +static void __iomem *intel_priv(struct pci_dev *pci)
>> +{
>> +	resource_size_t base = pci_resource_start(pci, 0);
>> +
>> +	return devm_ioremap(&pci->dev, base + INTEL_PRIV_OFFSET, INTEL_PRIV_SIZE);
>> +}
>> +
>>  static int intel_init(struct pci_dev *pci)
>>  {
>> -	void __iomem *priv;
>> +	void __iomem *priv = intel_priv(pci);
>>  	u32 reg;
>>  	int ret;
>>
>> -	priv = devm_ioremap(&pci->dev,
>> -			    pci_resource_start(pci, 0) + INTEL_PRIV_OFFSET,
>> -			    INTEL_PRIV_SIZE);
>>  	if (!priv)
>>  		return -ENOMEM;
>>
>> --
>> 2.51.0
>>
>>
>> --
>> linux-i3c mailing list
>> linux-i3c at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-i3c




More information about the linux-i3c mailing list