[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130117045035.GN2239@intel.com>
Date: Thu, 17 Jan 2013 06:50:35 +0200
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: "Rafael J. Wysocki" <rjw@...k.pl>
Cc: linux-acpi@...r.kernel.org, Len Brown <lenb@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-kernel@...r.kernel.org
Subject: Re: [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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists