Re: [PATCH v2 1/8] ACPI: property: Parse data node string references in properties

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

 



On Mon, Jan 23, 2023 at 03:46:10PM +0200, Sakari Ailus wrote:
> Add support for parsing property references using strings, besides
> reference objects that were previously supported. This allows also
> referencing data nodes which was not possible with reference objects.
> 
> Also add pr_fmt() macro to prefix printouts.
> 
> While at it, update copyright.

...

> - * Copyright (C) 2014, Intel Corporation
> + * Copyright (C) 2014--2023, Intel Corporation

Isn't one dash enough? 

$ git grep -n 'opyright.*[0-9]--[0-9]' | wc -l
37

$ git grep -n 'opyright.*[0-9]-[0-9]' | wc -l
15064


>   * All rights reserved.
>   *
>   * Authors: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
>   *          Darren Hart <dvhart@xxxxxxxxxxxxxxx>
>   *          Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> + *	    Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>

Seems wrong indentation in comparison to the others.

>   */

...

> +static struct fwnode_handle *
> +acpi_parse_string_ref(const struct fwnode_handle *fwnode, const char *refstring)
> +{
> +	acpi_handle scope, handle;
> +	struct acpi_data_node *dn;
> +	struct acpi_device *device;
> +	acpi_status status;
> +
> +	if (is_acpi_device_node(fwnode)) {

> +		scope = to_acpi_device_node(fwnode)->handle;

Interestingly that we have a helper for this -- ACPI_HANDLE_FWNODE()...

> +	} else if (is_acpi_data_node(fwnode)) {

> +		scope = to_acpi_data_node(fwnode)->handle;

...but not for this.

> +	} else {
> +		pr_err("bad node type for node %pfw\n", fwnode);
> +		return ERR_PTR(-EINVAL);
> +	}
> +
> +	status = acpi_get_handle(scope, refstring, &handle);
> +	if (ACPI_FAILURE(status)) {
> +		acpi_handle_debug(scope, "can't get handle for %s", refstring);
> +		return ERR_PTR(-EINVAL);
> +	}
> +
> +	device = acpi_fetch_acpi_dev(handle);
> +	if (device)
> +		return acpi_fwnode_handle(device);
> +
> +	status = acpi_get_data_full(handle, acpi_nondev_subnode_tag,
> +				    (void **)&dn, NULL);
> +	if (ACPI_FAILURE(status) || !dn) {
> +		acpi_handle_debug(handle, "can't find subnode");
> +		return ERR_PTR(-EINVAL);
> +	}
> +
> +	return &dn->fwnode;
> +}

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux