Re: [PATCH v2 2/6] platform/x86: dell-smo8800: Move instantiation of lis3lv02d i2c_client from i2c-i801 to dell-smo8800

Andy Shevchenko
2024-01-06T16:29:56Z

+ Cc people from tags of 72921427d46b ("string.h: Add str_has_prefix() helper
function"). See below why.

On Sat, Jan 06, 2024 at 05:09:29PM +0100, Hans de Goede wrote:
> It is not necessary to handle the Dell specific instantiation of
> i2c_client-s for SMO8xxx ACPI devices without an ACPI I2cResource
> inside the generic i801 I2C adapter driver.
>
> The kernel already instantiates platform_device-s for these ACPI devices
> and the drivers/platform/x86/dell/dell-smo8800.c driver binds to these
> platform drivers.
>
> Move the i2c_client instantiation from the generic i2c-i801 driver to
> the Dell specific dell-smo8800 driver.

...

> +/*
> + * NOTE: If new models with FEATURE_IDF are added please also update
> + * i801_idf_ids[] in drivers/platform/x86/dell-smo8800.c
> + */
> static const struct pci_device_id i801_ids[] = {

I believe this comment can be enforced with some defines / static_assert().
But I haven't given any thought about it, just an idea.

> };

...

> + * Copyright (C) 2023 Hans de Goede <hansg@kernel.org>

2024?

...

> + if (!strstarts(adap->name, "SMBus I801 adapter"))
> + return 0;

Bah, we have str_has_prefix() and this, much older one...
Steven? Others? I mean we can do something about this duplication, right?

--
With Best Regards,
Andy Shevchenko