diff options
author | Rob Herring <robh@kernel.org> | 2017-07-18 17:43:08 -0400 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2017-07-22 17:00:43 -0400 |
commit | 3921db46a8c5bc256c5956a04ad49cbbeac28e7d (patch) | |
tree | e24726d316ce7b981bec78b02d5b30191be7e021 | |
parent | 065a7c0b1fec9df9b22cf228b777fc3d2f4e6ba9 (diff) |
iio: Convert to using %pOF instead of full_name
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: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Carlo Caione <carlo@caione.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: linux-iio@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-amlogic@lists.infradead.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r-- | drivers/iio/adc/max9611.c | 4 | ||||
-rw-r--r-- | drivers/iio/adc/meson_saradc.c | 8 | ||||
-rw-r--r-- | drivers/iio/adc/ti-ads1015.c | 16 | ||||
-rw-r--r-- | drivers/iio/inkern.c | 4 |
4 files changed, 16 insertions, 16 deletions
diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c index b0526e4b9530..b1dd17cbce58 100644 --- a/drivers/iio/adc/max9611.c +++ b/drivers/iio/adc/max9611.c | |||
@@ -549,8 +549,8 @@ static int max9611_probe(struct i2c_client *client, | |||
549 | ret = of_property_read_u32(of_node, shunt_res_prop, &of_shunt); | 549 | ret = of_property_read_u32(of_node, shunt_res_prop, &of_shunt); |
550 | if (ret) { | 550 | if (ret) { |
551 | dev_err(&client->dev, | 551 | dev_err(&client->dev, |
552 | "Missing %s property for %s node\n", | 552 | "Missing %s property for %pOF node\n", |
553 | shunt_res_prop, of_node->full_name); | 553 | shunt_res_prop, of_node); |
554 | return ret; | 554 | return ret; |
555 | } | 555 | } |
556 | max9611->shunt_resistor_uohm = of_shunt; | 556 | max9611->shunt_resistor_uohm = of_shunt; |
diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c index c4e904bbf168..2e8dbb89c8c9 100644 --- a/drivers/iio/adc/meson_saradc.c +++ b/drivers/iio/adc/meson_saradc.c | |||
@@ -572,8 +572,8 @@ static int meson_sar_adc_clk_init(struct iio_dev *indio_dev, | |||
572 | struct clk_init_data init; | 572 | struct clk_init_data init; |
573 | const char *clk_parents[1]; | 573 | const char *clk_parents[1]; |
574 | 574 | ||
575 | init.name = devm_kasprintf(&indio_dev->dev, GFP_KERNEL, "%s#adc_div", | 575 | init.name = devm_kasprintf(&indio_dev->dev, GFP_KERNEL, "%pOF#adc_div", |
576 | of_node_full_name(indio_dev->dev.of_node)); | 576 | indio_dev->dev.of_node); |
577 | init.flags = 0; | 577 | init.flags = 0; |
578 | init.ops = &clk_divider_ops; | 578 | init.ops = &clk_divider_ops; |
579 | clk_parents[0] = __clk_get_name(priv->clkin); | 579 | clk_parents[0] = __clk_get_name(priv->clkin); |
@@ -591,8 +591,8 @@ static int meson_sar_adc_clk_init(struct iio_dev *indio_dev, | |||
591 | if (WARN_ON(IS_ERR(priv->adc_div_clk))) | 591 | if (WARN_ON(IS_ERR(priv->adc_div_clk))) |
592 | return PTR_ERR(priv->adc_div_clk); | 592 | return PTR_ERR(priv->adc_div_clk); |
593 | 593 | ||
594 | init.name = devm_kasprintf(&indio_dev->dev, GFP_KERNEL, "%s#adc_en", | 594 | init.name = devm_kasprintf(&indio_dev->dev, GFP_KERNEL, "%pOF#adc_en", |
595 | of_node_full_name(indio_dev->dev.of_node)); | 595 | indio_dev->dev.of_node); |
596 | init.flags = CLK_SET_RATE_PARENT; | 596 | init.flags = CLK_SET_RATE_PARENT; |
597 | init.ops = &clk_gate_ops; | 597 | init.ops = &clk_gate_ops; |
598 | clk_parents[0] = __clk_get_name(priv->adc_div_clk); | 598 | clk_parents[0] = __clk_get_name(priv->adc_div_clk); |
diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c index f76d979fb7e8..5866118fafbf 100644 --- a/drivers/iio/adc/ti-ads1015.c +++ b/drivers/iio/adc/ti-ads1015.c | |||
@@ -505,24 +505,24 @@ static int ads1015_get_channels_config_of(struct i2c_client *client) | |||
505 | unsigned int data_rate = ADS1015_DEFAULT_DATA_RATE; | 505 | unsigned int data_rate = ADS1015_DEFAULT_DATA_RATE; |
506 | 506 | ||
507 | if (of_property_read_u32(node, "reg", &pval)) { | 507 | if (of_property_read_u32(node, "reg", &pval)) { |
508 | dev_err(&client->dev, "invalid reg on %s\n", | 508 | dev_err(&client->dev, "invalid reg on %pOF\n", |
509 | node->full_name); | 509 | node); |
510 | continue; | 510 | continue; |
511 | } | 511 | } |
512 | 512 | ||
513 | channel = pval; | 513 | channel = pval; |
514 | if (channel >= ADS1015_CHANNELS) { | 514 | if (channel >= ADS1015_CHANNELS) { |
515 | dev_err(&client->dev, | 515 | dev_err(&client->dev, |
516 | "invalid channel index %d on %s\n", | 516 | "invalid channel index %d on %pOF\n", |
517 | channel, node->full_name); | 517 | channel, node); |
518 | continue; | 518 | continue; |
519 | } | 519 | } |
520 | 520 | ||
521 | if (!of_property_read_u32(node, "ti,gain", &pval)) { | 521 | if (!of_property_read_u32(node, "ti,gain", &pval)) { |
522 | pga = pval; | 522 | pga = pval; |
523 | if (pga > 6) { | 523 | if (pga > 6) { |
524 | dev_err(&client->dev, "invalid gain on %s\n", | 524 | dev_err(&client->dev, "invalid gain on %pOF\n", |
525 | node->full_name); | 525 | node); |
526 | of_node_put(node); | 526 | of_node_put(node); |
527 | return -EINVAL; | 527 | return -EINVAL; |
528 | } | 528 | } |
@@ -532,8 +532,8 @@ static int ads1015_get_channels_config_of(struct i2c_client *client) | |||
532 | data_rate = pval; | 532 | data_rate = pval; |
533 | if (data_rate > 7) { | 533 | if (data_rate > 7) { |
534 | dev_err(&client->dev, | 534 | dev_err(&client->dev, |
535 | "invalid data_rate on %s\n", | 535 | "invalid data_rate on %pOF\n", |
536 | node->full_name); | 536 | node); |
537 | of_node_put(node); | 537 | of_node_put(node); |
538 | return -EINVAL; | 538 | return -EINVAL; |
539 | } | 539 | } |
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 487bf6b75172..6c69da942321 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c | |||
@@ -205,8 +205,8 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np, | |||
205 | if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) | 205 | if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) |
206 | break; | 206 | break; |
207 | else if (name && index >= 0) { | 207 | else if (name && index >= 0) { |
208 | pr_err("ERROR: could not get IIO channel %s:%s(%i)\n", | 208 | pr_err("ERROR: could not get IIO channel %pOF:%s(%i)\n", |
209 | np->full_name, name ? name : "", index); | 209 | np, name ? name : "", index); |
210 | return NULL; | 210 | return NULL; |
211 | } | 211 | } |
212 | 212 | ||