Re: [PATCH v1 1/2] eeprom: at24: convert magic numbers to structs.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




2017-12-08 15:17 GMT+01:00 Sven Van Asbroeck <thesven73@xxxxxxxxx>:
> Bartosz wrote:
>>> +#define AT24_OF_DEVICE_ID(_mfg, _name) \
>>> +       { .compatible = #_mfg "," #_name, .data = &platdata_##_name }
>>
>> I don't like hiding the way the compatible is created here from the
>> user. It doesn't save any code neither. Please make the macro accept
>> the whole compatible string.
>>
>
> If the macro accepts the whole compatible string "mfg,chip-name" (e.g.
> "atmel,24c01")
> then how can I extract chip-name from that string? I need to attach
> chip-name to the
> platdata_ static structures. (e.g. "atmel,24c01" -> .data = platdata_24c01)

Just make it accept two parameters: the string and the data object
name. For example:

AT24_OF_DEVICE_ID("atmel,24c01", 24c01);

Thanks,
Bartosz
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux