All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
To: Kristen Carlson Accardi <kristenc@cs.pdx.edu>
Cc: pcihpd-discuss@lists.sourceforge.net, greg@kroah.com,
	len.brown@intel.com, pavel@ucw.cz, linux-kernel@vger.kernel.org,
	muneda.takahiro@jp.fujitsu.com, linux-acpi@vger.kernel.org
Subject: Re: [Pcihpd-discuss] [patch] acpiphp: handle dock stations
Date: Thu, 02 Feb 2006 14:09:21 +0900	[thread overview]
Message-ID: <43E19401.6060500@jp.fujitsu.com> (raw)
In-Reply-To: <20060201233005.GA4999@nerpa>

Kristen Carlson Accardi wrote:
> +int is_dependent_device(acpi_handle handle)
> +{
> +	struct dependent_device *dd;
> +
> +	if (!ds)
> +		return 0;
> +
> +	list_for_each_entry(dd, &ds->dependent_devices, device_list) {
> +		if (handle == dd->handle)
> +			return 1;
> +	}
> +	return 0;
> +}
(snip.)
> +struct dependent_device * get_dependent_device(acpi_handle handle)
> +{
> +	struct dependent_device *dd;
> +
> +	list_for_each_entry(dd, &ds->dependent_devices, device_list) {
> +		if (handle == dd->handle)
> +			return dd;
> +	}
> +	return NULL;
> +}

Those look very similar...



> +
> +	/* make sure we are dependent on the dock device */
> +	acpi_get_name(dck_handle, ACPI_FULL_PATHNAME, &buffer);
> +	status = acpi_evaluate_object(handle, "_EJD", NULL, &ejd_buffer);
> +	if (ACPI_FAILURE(status)) {
> +		err("Unable to execute _EJD!\n");
> +		goto find_ejd_out;
> +	}
> +
> +	/* because acpi_get_name will pad the names if they are less
> +	 * than 4 characters, we can't compare the strings returned
> +	 * from _EJD with those returned from acpi_get_name.  So,
> +	 * we have to get a handle to the object referenced by _EJD
> +	 * and then call get name on that.
> +	 */
> +	ejd_obj = ejd_buffer.pointer;
> +	status = acpi_get_handle(NULL, ejd_obj->string.pointer, &tmp);
> +	if (ACPI_FAILURE(status))
> +		goto find_ejd_out;
> +	acpi_get_name(tmp, ACPI_FULL_PATHNAME, &ejd_name_buffer);
> +
> +	dck_obj = buffer.pointer;
> +	if (!strncmp(ejd_objname, objname, strlen(ejd_objname))) {

I don't think you need to compare pathnames.
Why not just compare ACPI handles like below?

	if (dck_handle == tmp) {
		...

Thanks,
Kenji Kaneshige


  reply	other threads:[~2006-02-02  5:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-01 23:30 [patch] acpiphp: handle dock stations Kristen Carlson Accardi
2006-02-02  5:09 ` Kenji Kaneshige [this message]
2006-02-06 13:15 ` Pavel Machek
2006-02-06 13:21 ` Pavel Machek
2006-02-13  1:50 ` [Pcihpd-discuss] " MUNEDA Takahiro
2006-02-13 15:57   ` Kenji Kaneshige
2006-02-14  0:41     ` MUNEDA Takahiro

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=43E19401.6060500@jp.fujitsu.com \
    --to=kaneshige.kenji@jp.fujitsu.com \
    --cc=greg@kroah.com \
    --cc=kristenc@cs.pdx.edu \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=muneda.takahiro@jp.fujitsu.com \
    --cc=pavel@ucw.cz \
    --cc=pcihpd-discuss@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.