[PATCH v2 2/3] serial: mxs-auart: Allow device tree probing

Fabio Estevam festevam at gmail.com
Fri Jun 15 08:13:57 EDT 2012


On Fri, Jun 15, 2012 at 8:49 AM, Marek Vasut <marex at denx.de> wrote:

>> +/*
>> + * This function returns 1 if pdev isn't a device instatiated by dt, 0 if
>> it + * could successfully get all information from dt or a negative errno.
>> + */
>> +static int serial_mxs_probe_dt(struct mxs_auart_port *s,
>> +             struct platform_device *pdev)
>> +{
>> +     struct device_node *np = pdev->dev.of_node;
>> +     int ret;
>> +
>> +     if (!np)
>> +             /* no device tree device */
>> +             return 1;
>> +
>> +     ret = of_alias_get_id(np, "serial");
>> +     if (ret < 0) {
>> +             dev_err(&pdev->dev, "failed to get alias id: %d\n", ret);
>> +             return ret;
>> +     }
>> +     s->port.line = ret;
>> +
>> +     return 0;
>> +}
>> +#else
>> +static inline int serial_mxs_probe_dt(struct mxs_auart_port *s,
>> +             struct platform_device *pdev)
>> +{
>> +     return 1;
>> +}
>> +#endif
>
> So drop this whole ifdef stuff ...

Yes, you are right. We can safely remove it. Just tested and it worked fine.

I will drop the ifdef in the next revision.

Thanks,

Fabio Estevam



More information about the linux-arm-kernel mailing list