diff mbox

mmc: Convert to using %pOF instead of full_name

Message ID 20170718214339.7774-36-robh@kernel.org
State New, archived
Headers show

Commit Message

Rob Herring July 18, 2017, 9:43 p.m. UTC
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: Jan Glauber <jglauber@cavium.com>
Cc: David Daney <david.daney@cavium.com>
Cc: "Steven J. Hill" <Steven.Hill@cavium.com>
Cc: linux-mmc@vger.kernel.org
---
 drivers/mmc/core/core.c      | 8 ++++----
 drivers/mmc/host/atmel-mci.c | 4 ++--
 drivers/mmc/host/cavium.c    | 6 ++----
 3 files changed, 8 insertions(+), 10 deletions(-)

--
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Daney July 18, 2017, 10 p.m. UTC | #1
On 07/18/2017 02:43 PM, Rob Herring wrote:
> Now that we have a custom printf format specifier, convert users of
> full_name to use %pOF instead. This is preparation to remove storing
> of the full path string for each node.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> Cc: Jan Glauber <jglauber@cavium.com>
> Cc: David Daney <david.daney@cavium.com>
> Cc: "Steven J. Hill" <Steven.Hill@cavium.com>
> Cc: linux-mmc@vger.kernel.org

For the Cavium bits, I haven't tested them, but they look fine, so ...

Acked-by: David Daney <david.daney@cavium.com>


> ---
>   drivers/mmc/core/core.c      | 8 ++++----
>   drivers/mmc/host/atmel-mci.c | 4 ++--
>   drivers/mmc/host/cavium.c    | 6 ++----
>   3 files changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 26431267a3e2..6b4117615ad6 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1137,11 +1137,11 @@ int mmc_of_parse_voltage(struct device_node *np, u32 *mask)
>   	voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
>   	num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
>   	if (!voltage_ranges) {
> -		pr_debug("%s: voltage-ranges unspecified\n", np->full_name);
> +		pr_debug("%pOF: voltage-ranges unspecified\n", np);
>   		return 0;
>   	}
>   	if (!num_ranges) {
> -		pr_err("%s: voltage-ranges empty\n", np->full_name);
> +		pr_err("%pOF: voltage-ranges empty\n", np);
>   		return -EINVAL;
>   	}
> 
> @@ -1153,8 +1153,8 @@ int mmc_of_parse_voltage(struct device_node *np, u32 *mask)
>   				be32_to_cpu(voltage_ranges[j]),
>   				be32_to_cpu(voltage_ranges[j + 1]));
>   		if (!ocr_mask) {
> -			pr_err("%s: voltage-range #%d is invalid\n",
> -				np->full_name, i);
> +			pr_err("%pOF: voltage-range #%d is invalid\n",
> +				np, i);
>   			return -EINVAL;
>   		}
>   		*mask |= ocr_mask;
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index 97de2d32ba84..b7c1cd384306 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -665,8 +665,8 @@ atmci_of_init(struct platform_device *pdev)
> 
>   	for_each_child_of_node(np, cnp) {
>   		if (of_property_read_u32(cnp, "reg", &slot_id)) {
> -			dev_warn(&pdev->dev, "reg property is missing for %s\n",
> -				 cnp->full_name);
> +			dev_warn(&pdev->dev, "reg property is missing for %pOF\n",
> +				 cnp);
>   			continue;
>   		}
> 
> diff --git a/drivers/mmc/host/cavium.c b/drivers/mmc/host/cavium.c
> index 3686d77c717b..27fb625cbcf3 100644
> --- a/drivers/mmc/host/cavium.c
> +++ b/drivers/mmc/host/cavium.c
> @@ -957,14 +957,12 @@ static int cvm_mmc_of_parse(struct device *dev, struct cvm_mmc_slot *slot)
> 
>   	ret = of_property_read_u32(node, "reg", &id);
>   	if (ret) {
> -		dev_err(dev, "Missing or invalid reg property on %s\n",
> -			of_node_full_name(node));
> +		dev_err(dev, "Missing or invalid reg property on %pOF\n", node);
>   		return ret;
>   	}
> 
>   	if (id >= CAVIUM_MAX_MMC || slot->host->slot[id]) {
> -		dev_err(dev, "Invalid reg property on %s\n",
> -			of_node_full_name(node));
> +		dev_err(dev, "Invalid reg property on %pOF\n", node);
>   		return -EINVAL;
>   	}
> 
> --
> 2.11.0
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steven J. Hill July 18, 2017, 10:43 p.m. UTC | #2
On 07/18/2017 05:00 PM, David Daney wrote:
> On 07/18/2017 02:43 PM, Rob Herring wrote:
>> Now that we have a custom printf format specifier, convert users of
>> full_name to use %pOF instead. This is preparation to remove storing
>> of the full path string for each node.
>>
>> Signed-off-by: Rob Herring <robh@kernel.org>
>> Cc: Ulf Hansson <ulf.hansson@linaro.org>
>> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
>> Cc: Jan Glauber <jglauber@cavium.com>
>> Cc: David Daney <david.daney@cavium.com>
>> Cc: "Steven J. Hill" <Steven.Hill@cavium.com>
>> Cc: linux-mmc@vger.kernel.org
> 
> For the Cavium bits, I haven't tested them, but they look fine, so ...
> 
> Acked-by: David Daney <david.daney@cavium.com>
> 
Tested and work on our platforms....

Tested-by: Steven J. Hill <Steven.Hill@cavium.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ludovic Desroches July 19, 2017, 5:55 a.m. UTC | #3
On Tue, Jul 18, 2017 at 04:43:16PM -0500, Rob Herring wrote:
> Now that we have a custom printf format specifier, convert users of
> full_name to use %pOF instead. This is preparation to remove storing
> of the full path string for each node.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> Cc: Jan Glauber <jglauber@cavium.com>
> Cc: David Daney <david.daney@cavium.com>
> Cc: "Steven J. Hill" <Steven.Hill@cavium.com>
> Cc: linux-mmc@vger.kernel.org
> ---
>  drivers/mmc/core/core.c      | 8 ++++----
>  drivers/mmc/host/atmel-mci.c | 4 ++--

Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>

>  drivers/mmc/host/cavium.c    | 6 ++----
>  3 files changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 26431267a3e2..6b4117615ad6 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1137,11 +1137,11 @@ int mmc_of_parse_voltage(struct device_node *np, u32 *mask)
>  	voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
>  	num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
>  	if (!voltage_ranges) {
> -		pr_debug("%s: voltage-ranges unspecified\n", np->full_name);
> +		pr_debug("%pOF: voltage-ranges unspecified\n", np);
>  		return 0;
>  	}
>  	if (!num_ranges) {
> -		pr_err("%s: voltage-ranges empty\n", np->full_name);
> +		pr_err("%pOF: voltage-ranges empty\n", np);
>  		return -EINVAL;
>  	}
> 
> @@ -1153,8 +1153,8 @@ int mmc_of_parse_voltage(struct device_node *np, u32 *mask)
>  				be32_to_cpu(voltage_ranges[j]),
>  				be32_to_cpu(voltage_ranges[j + 1]));
>  		if (!ocr_mask) {
> -			pr_err("%s: voltage-range #%d is invalid\n",
> -				np->full_name, i);
> +			pr_err("%pOF: voltage-range #%d is invalid\n",
> +				np, i);
>  			return -EINVAL;
>  		}
>  		*mask |= ocr_mask;
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index 97de2d32ba84..b7c1cd384306 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -665,8 +665,8 @@ atmci_of_init(struct platform_device *pdev)
> 
>  	for_each_child_of_node(np, cnp) {
>  		if (of_property_read_u32(cnp, "reg", &slot_id)) {
> -			dev_warn(&pdev->dev, "reg property is missing for %s\n",
> -				 cnp->full_name);
> +			dev_warn(&pdev->dev, "reg property is missing for %pOF\n",
> +				 cnp);
>  			continue;
>  		}
> 
> diff --git a/drivers/mmc/host/cavium.c b/drivers/mmc/host/cavium.c
> index 3686d77c717b..27fb625cbcf3 100644
> --- a/drivers/mmc/host/cavium.c
> +++ b/drivers/mmc/host/cavium.c
> @@ -957,14 +957,12 @@ static int cvm_mmc_of_parse(struct device *dev, struct cvm_mmc_slot *slot)
> 
>  	ret = of_property_read_u32(node, "reg", &id);
>  	if (ret) {
> -		dev_err(dev, "Missing or invalid reg property on %s\n",
> -			of_node_full_name(node));
> +		dev_err(dev, "Missing or invalid reg property on %pOF\n", node);
>  		return ret;
>  	}
> 
>  	if (id >= CAVIUM_MAX_MMC || slot->host->slot[id]) {
> -		dev_err(dev, "Invalid reg property on %s\n",
> -			of_node_full_name(node));
> +		dev_err(dev, "Invalid reg property on %pOF\n", node);
>  		return -EINVAL;
>  	}
> 
> --
> 2.11.0
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson July 27, 2017, 2:48 p.m. UTC | #4
On 18 July 2017 at 23:43, Rob Herring <robh@kernel.org> wrote:
> Now that we have a custom printf format specifier, convert users of
> full_name to use %pOF instead. This is preparation to remove storing
> of the full path string for each node.
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> Cc: Jan Glauber <jglauber@cavium.com>
> Cc: David Daney <david.daney@cavium.com>
> Cc: "Steven J. Hill" <Steven.Hill@cavium.com>
> Cc: linux-mmc@vger.kernel.org

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/core/core.c      | 8 ++++----
>  drivers/mmc/host/atmel-mci.c | 4 ++--
>  drivers/mmc/host/cavium.c    | 6 ++----
>  3 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 26431267a3e2..6b4117615ad6 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1137,11 +1137,11 @@ int mmc_of_parse_voltage(struct device_node *np, u32 *mask)
>         voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
>         num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
>         if (!voltage_ranges) {
> -               pr_debug("%s: voltage-ranges unspecified\n", np->full_name);
> +               pr_debug("%pOF: voltage-ranges unspecified\n", np);
>                 return 0;
>         }
>         if (!num_ranges) {
> -               pr_err("%s: voltage-ranges empty\n", np->full_name);
> +               pr_err("%pOF: voltage-ranges empty\n", np);
>                 return -EINVAL;
>         }
>
> @@ -1153,8 +1153,8 @@ int mmc_of_parse_voltage(struct device_node *np, u32 *mask)
>                                 be32_to_cpu(voltage_ranges[j]),
>                                 be32_to_cpu(voltage_ranges[j + 1]));
>                 if (!ocr_mask) {
> -                       pr_err("%s: voltage-range #%d is invalid\n",
> -                               np->full_name, i);
> +                       pr_err("%pOF: voltage-range #%d is invalid\n",
> +                               np, i);
>                         return -EINVAL;
>                 }
>                 *mask |= ocr_mask;
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index 97de2d32ba84..b7c1cd384306 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -665,8 +665,8 @@ atmci_of_init(struct platform_device *pdev)
>
>         for_each_child_of_node(np, cnp) {
>                 if (of_property_read_u32(cnp, "reg", &slot_id)) {
> -                       dev_warn(&pdev->dev, "reg property is missing for %s\n",
> -                                cnp->full_name);
> +                       dev_warn(&pdev->dev, "reg property is missing for %pOF\n",
> +                                cnp);
>                         continue;
>                 }
>
> diff --git a/drivers/mmc/host/cavium.c b/drivers/mmc/host/cavium.c
> index 3686d77c717b..27fb625cbcf3 100644
> --- a/drivers/mmc/host/cavium.c
> +++ b/drivers/mmc/host/cavium.c
> @@ -957,14 +957,12 @@ static int cvm_mmc_of_parse(struct device *dev, struct cvm_mmc_slot *slot)
>
>         ret = of_property_read_u32(node, "reg", &id);
>         if (ret) {
> -               dev_err(dev, "Missing or invalid reg property on %s\n",
> -                       of_node_full_name(node));
> +               dev_err(dev, "Missing or invalid reg property on %pOF\n", node);
>                 return ret;
>         }
>
>         if (id >= CAVIUM_MAX_MMC || slot->host->slot[id]) {
> -               dev_err(dev, "Invalid reg property on %s\n",
> -                       of_node_full_name(node));
> +               dev_err(dev, "Invalid reg property on %pOF\n", node);
>                 return -EINVAL;
>         }
>
> --
> 2.11.0
>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 26431267a3e2..6b4117615ad6 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1137,11 +1137,11 @@  int mmc_of_parse_voltage(struct device_node *np, u32 *mask)
 	voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
 	num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
 	if (!voltage_ranges) {
-		pr_debug("%s: voltage-ranges unspecified\n", np->full_name);
+		pr_debug("%pOF: voltage-ranges unspecified\n", np);
 		return 0;
 	}
 	if (!num_ranges) {
-		pr_err("%s: voltage-ranges empty\n", np->full_name);
+		pr_err("%pOF: voltage-ranges empty\n", np);
 		return -EINVAL;
 	}

@@ -1153,8 +1153,8 @@  int mmc_of_parse_voltage(struct device_node *np, u32 *mask)
 				be32_to_cpu(voltage_ranges[j]),
 				be32_to_cpu(voltage_ranges[j + 1]));
 		if (!ocr_mask) {
-			pr_err("%s: voltage-range #%d is invalid\n",
-				np->full_name, i);
+			pr_err("%pOF: voltage-range #%d is invalid\n",
+				np, i);
 			return -EINVAL;
 		}
 		*mask |= ocr_mask;
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 97de2d32ba84..b7c1cd384306 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -665,8 +665,8 @@  atmci_of_init(struct platform_device *pdev)

 	for_each_child_of_node(np, cnp) {
 		if (of_property_read_u32(cnp, "reg", &slot_id)) {
-			dev_warn(&pdev->dev, "reg property is missing for %s\n",
-				 cnp->full_name);
+			dev_warn(&pdev->dev, "reg property is missing for %pOF\n",
+				 cnp);
 			continue;
 		}

diff --git a/drivers/mmc/host/cavium.c b/drivers/mmc/host/cavium.c
index 3686d77c717b..27fb625cbcf3 100644
--- a/drivers/mmc/host/cavium.c
+++ b/drivers/mmc/host/cavium.c
@@ -957,14 +957,12 @@  static int cvm_mmc_of_parse(struct device *dev, struct cvm_mmc_slot *slot)

 	ret = of_property_read_u32(node, "reg", &id);
 	if (ret) {
-		dev_err(dev, "Missing or invalid reg property on %s\n",
-			of_node_full_name(node));
+		dev_err(dev, "Missing or invalid reg property on %pOF\n", node);
 		return ret;
 	}

 	if (id >= CAVIUM_MAX_MMC || slot->host->slot[id]) {
-		dev_err(dev, "Invalid reg property on %s\n",
-			of_node_full_name(node));
+		dev_err(dev, "Invalid reg property on %pOF\n", node);
 		return -EINVAL;
 	}