linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-acpi@vger.kernel.org, Len Brown <lenb@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] ACPI: add support for CSRT table
Date: Thu, 17 Jan 2013 06:50:35 +0200	[thread overview]
Message-ID: <20130117045035.GN2239@intel.com> (raw)
In-Reply-To: <1414072.uJWlZ7TPsD@vostro.rjw.lan>

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.

      reply	other threads:[~2013-01-17  4:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14  9:51 [PATCH] ACPI: add support for CSRT table Mika Westerberg
2013-01-15 23:35 ` Rafael J. Wysocki
2013-01-16  4:42   ` Mika Westerberg
2013-01-16 15:05     ` Rafael J. Wysocki
2013-01-16 15:10       ` Mika Westerberg
2013-01-16 16:13 ` [PATCH v2] " Mika Westerberg
2013-01-16 23:27   ` Rafael J. Wysocki
2013-01-17  4:50     ` Mika Westerberg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130117045035.GN2239@intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).