Re: [PATCH v6 3/8] i2c: piix4: Export i2c_piix4 driver functions as library

Andy Shevchenko
2024-09-20T16:24:33Z

On Thu, Sep 19, 2024 at 11:29:08PM +0530, Shyam Sundar S K wrote:
> Export the following i2c_piix4 driver functions as a library so that the
> AMD ASF driver can utilize these core functionalities from the i2c_piix4
> driver:
>
> - piix4_sb800_region_request(): Request access to a specific SMBus region
> on the SB800 chipset.
>
> - piix4_sb800_region_release(): Release the previously requested SMBus
> region on the SB800 chipset.
>
> - piix4_transaction(): Handle SMBus transactions between the SMBus
> controller and connected devices.
>
> - piix4_sb800_port_sel(): Select the appropriate SMBus port on the SB800
> chipset.
>
> By making these functions available as a library, enable the AMD ASF
> driver to leverage the established mechanisms in the i2c_piix4 driver,
> promoting code reuse and consistency across different drivers.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

...

> -static int piix4_sb800_region_request(struct device *dev,
> - struct sb800_mmio_cfg *mmio_cfg)
> +int piix4_sb800_region_request(struct device *dev,
> + struct sb800_mmio_cfg *mmio_cfg)

Now can be one line.

...

> -static void piix4_sb800_region_release(struct device *dev,
> - struct sb800_mmio_cfg *mmio_cfg)
> +void piix4_sb800_region_release(struct device *dev,
> + struct sb800_mmio_cfg *mmio_cfg)

Ditto.

--
With Best Regards,
Andy Shevchenko