> +#ifdef CONFIG_ACPI
> +static void acpi_i2c_mux_register_devices(struct i2c_adapter *adap,
> +                                       struct device *mux_dev)
> +{
> +     acpi_handle handle;
> +     acpi_status status;
> +
> +     handle = ACPI_HANDLE(mux_dev);
> +     if (!handle)
> +             return;
> +
> +     status = acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1,
> +                                  acpi_i2c_add_device, NULL,
> +                                  adap, NULL);
> +
> +     if (ACPI_FAILURE(status))
> +             dev_warn(mux_dev, "mux adapter slave enumeration fails\n");
> +}
> +#else /* !CONFIG_ACPI */
> +static inline void acpi_i2c_mux_register_devices(struct i2c_adapter *adap,
> +                                              struct device *mux_dev) { }
> +#endif /* CONFIG_ACPI */

IMO, this shares too much code with acpi_i2c_register_devices(). And it
pulls in ACPI into mux.c which is not really needed.

What about naming the above function
acpi_i2c_register_devices_from_dev() and let acpi_i2c_register_devices()
then call it as a helper function, all this in i2c-core.c?

Thanks for your patience BTW...

Attachment: signature.asc
Description: Digital signature

Reply via email to