On Thu, May 18, 2017 at 7:39 PM, Jan Kiszka <jan.kiszka@xxxxxxxxxxx> wrote: > On 2017-05-18 18:33, Andy Shevchenko wrote: >> On Thu, May 18, 2017 at 5:59 PM, Jan Kiszka <jan.kiszka@xxxxxxxxxxx> wrote: >>> +static bool is_iot2040; >> >> No, please, use driver data of DMI and hide this in corresponding structure. >> Or even assign port->port.rs485_config in the callback function. >> >> Moreover, can't you use port->port.rs485_config != NULL instead? > > There are two cases to be handled on IOT2040: the setting of the > rs485_config and the different setup of the GPIOs, but the latter at a > specific point in the initialization only. So I don't see yet how > driver_data could come into play and help. struct exar_iot2040_setup { ...rs485_config(); ...setup_gpio(); }; struct exar_iot2040_setup iot2040_setup = { ... }; DMI: .driver_data = (void *)&iot2040_setup; Above is just unfinished proposal, since I have noticed your new mail. So, it seems we are on the same page. One thing, I still would consider to use device properties instead of platform data (with consideration of MFD framework usage). -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html