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

Re: [Xen-devel] [PATCH v2 18/41] arm: Introduce a generic way to use a device from acpi



On 24 May 2015 at 13:10, Julien Grall <julien.grall@xxxxxxxxxx> wrote:
> Hi Parth,
>
>
> On 24/05/2015 08:06, Parth Dixit wrote:
>>
>>      > +struct acpi_device_desc {
>>      > +    /* Device name */
>>      > +    const char *name;
>>      > +    /* Device class */
>>      > +    enum device_class class;
>>      > +    /* type of device supported by the driver */
>>      > +    const int class_type;
>>      > +    /* Device initialization */
>>      > +    int (*init)(const void *data);
>>      > +};
>>
>>     Given that the number of device will be minimal in Xen, I would prefer
>>     to merge this structure into device_desc by adding the ACPI fields.
>>
>>     It would avoid to duplicate everything for only 2 fields changes.
>>
>>      From the drivers point of view it would look like
>>
>>     DEVICE_START(....)
>>              .dt_init = ...
>>     #ifdef CONFIG_ACPI
>>              .acpi_init = ...
>>     #endif
>>     DEVICE_END
>>
>>     Or something like
>>
>>     DEVICE_START(...)
>>              DT_INIT(...)
>>              ACPI_INIT(...)
>>     DEVICE_END
>>
>>     And ACPI_INIT will be a no-op when CONFIG_ACPI is not enabled.
>>
>> I think we agreed not to use common structure as it had some dt specific
>> entries and there was scope of confusion.
>
>
> I don't remember a such agreement. So far, only compatible and init are DT
> specific. The rest (most of the fields) are device agnostic.
Adding attachment of the previous discussion
> If you prefix the DT callback by dt_ (or smth else), there would be
> confusion and a smaller code.
>
> Anyway, I will let Ian and Stefano gives their opinion on it.
>
> Regards,
>
> --
> Julien Grall

Attachment: Linaro Mail - [PATCH RFC 17_35] pl011_ Initialize serial from ACPI SPCR table.pdf
Description: Adobe PDF document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.