lkml.org 
[lkml]   [2013]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] ACPI: add support for CSRT table
On Thu, Jan 17, 2013 at 12:27:32AM +0100, Rafael J. Wysocki wrote:
> > +static int __init acpi_csrt_init(void)
> > +{
> > + struct acpi_csrt_group *grp, *end;
> > + struct acpi_table_csrt *csrt;
> > + acpi_status status;
> > + int ret;
> > +
> > + status = acpi_get_table(ACPI_SIG_CSRT, 0,
> > + (struct acpi_table_header **)&csrt);
> > + if (ACPI_FAILURE(status)) {
> > + if (status == AE_NOT_FOUND)
> > + return -ENOENT;
> > + return -EINVAL;
> > + }
> > +
> > + pr_debug("parsing CSRT table for devices\n");
> > +
> > + grp = (struct acpi_csrt_group *)(csrt + 1);
> > + end = (struct acpi_csrt_group *)((void *)csrt + csrt->header.length);
> > +
> > + while (grp < end) {
> > + ret = acpi_csrt_parse_resource_group(grp);
> > + if (ret)
> > + return ret;
> > +
> > + grp = (struct acpi_csrt_group *)((void *)grp + grp->length);
> > + }
> > +
> > + return 0;
> > +}
> > +subsys_initcall(acpi_csrt_init);
>
> -> Do we really need a separate initcall for that? And what if ACPI is
> disabled?

Ah, good point - ACPI can be disabled at runtime as well.

> Perhaps it would be better to call acpi_csrt_init() directly from
> acpi_init() (or from acpi_scan_init() whichever is more suitable)?

Indeed. I'll fix this up and send you a new version soon.

Thanks.


\
 
 \ /
  Last update: 2013-01-17 06:41    [W:0.158 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site