mirror of
https://github.com/torvalds/linux.git
synced 2024-12-02 17:11:33 +00:00
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>
This commit is contained in:
parent
065a7c0b1f
commit
3921db46a8
@ -549,8 +549,8 @@ static int max9611_probe(struct i2c_client *client,
|
|||||||
ret = of_property_read_u32(of_node, shunt_res_prop, &of_shunt);
|
ret = of_property_read_u32(of_node, shunt_res_prop, &of_shunt);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&client->dev,
|
dev_err(&client->dev,
|
||||||
"Missing %s property for %s node\n",
|
"Missing %s property for %pOF node\n",
|
||||||
shunt_res_prop, of_node->full_name);
|
shunt_res_prop, of_node);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
max9611->shunt_resistor_uohm = of_shunt;
|
max9611->shunt_resistor_uohm = of_shunt;
|
||||||
|
@ -572,8 +572,8 @@ static int meson_sar_adc_clk_init(struct iio_dev *indio_dev,
|
|||||||
struct clk_init_data init;
|
struct clk_init_data init;
|
||||||
const char *clk_parents[1];
|
const char *clk_parents[1];
|
||||||
|
|
||||||
init.name = devm_kasprintf(&indio_dev->dev, GFP_KERNEL, "%s#adc_div",
|
init.name = devm_kasprintf(&indio_dev->dev, GFP_KERNEL, "%pOF#adc_div",
|
||||||
of_node_full_name(indio_dev->dev.of_node));
|
indio_dev->dev.of_node);
|
||||||
init.flags = 0;
|
init.flags = 0;
|
||||||
init.ops = &clk_divider_ops;
|
init.ops = &clk_divider_ops;
|
||||||
clk_parents[0] = __clk_get_name(priv->clkin);
|
clk_parents[0] = __clk_get_name(priv->clkin);
|
||||||
@ -591,8 +591,8 @@ static int meson_sar_adc_clk_init(struct iio_dev *indio_dev,
|
|||||||
if (WARN_ON(IS_ERR(priv->adc_div_clk)))
|
if (WARN_ON(IS_ERR(priv->adc_div_clk)))
|
||||||
return PTR_ERR(priv->adc_div_clk);
|
return PTR_ERR(priv->adc_div_clk);
|
||||||
|
|
||||||
init.name = devm_kasprintf(&indio_dev->dev, GFP_KERNEL, "%s#adc_en",
|
init.name = devm_kasprintf(&indio_dev->dev, GFP_KERNEL, "%pOF#adc_en",
|
||||||
of_node_full_name(indio_dev->dev.of_node));
|
indio_dev->dev.of_node);
|
||||||
init.flags = CLK_SET_RATE_PARENT;
|
init.flags = CLK_SET_RATE_PARENT;
|
||||||
init.ops = &clk_gate_ops;
|
init.ops = &clk_gate_ops;
|
||||||
clk_parents[0] = __clk_get_name(priv->adc_div_clk);
|
clk_parents[0] = __clk_get_name(priv->adc_div_clk);
|
||||||
|
@ -505,24 +505,24 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
|
|||||||
unsigned int data_rate = ADS1015_DEFAULT_DATA_RATE;
|
unsigned int data_rate = ADS1015_DEFAULT_DATA_RATE;
|
||||||
|
|
||||||
if (of_property_read_u32(node, "reg", &pval)) {
|
if (of_property_read_u32(node, "reg", &pval)) {
|
||||||
dev_err(&client->dev, "invalid reg on %s\n",
|
dev_err(&client->dev, "invalid reg on %pOF\n",
|
||||||
node->full_name);
|
node);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
channel = pval;
|
channel = pval;
|
||||||
if (channel >= ADS1015_CHANNELS) {
|
if (channel >= ADS1015_CHANNELS) {
|
||||||
dev_err(&client->dev,
|
dev_err(&client->dev,
|
||||||
"invalid channel index %d on %s\n",
|
"invalid channel index %d on %pOF\n",
|
||||||
channel, node->full_name);
|
channel, node);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!of_property_read_u32(node, "ti,gain", &pval)) {
|
if (!of_property_read_u32(node, "ti,gain", &pval)) {
|
||||||
pga = pval;
|
pga = pval;
|
||||||
if (pga > 6) {
|
if (pga > 6) {
|
||||||
dev_err(&client->dev, "invalid gain on %s\n",
|
dev_err(&client->dev, "invalid gain on %pOF\n",
|
||||||
node->full_name);
|
node);
|
||||||
of_node_put(node);
|
of_node_put(node);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@ -532,8 +532,8 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
|
|||||||
data_rate = pval;
|
data_rate = pval;
|
||||||
if (data_rate > 7) {
|
if (data_rate > 7) {
|
||||||
dev_err(&client->dev,
|
dev_err(&client->dev,
|
||||||
"invalid data_rate on %s\n",
|
"invalid data_rate on %pOF\n",
|
||||||
node->full_name);
|
node);
|
||||||
of_node_put(node);
|
of_node_put(node);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -205,8 +205,8 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np,
|
|||||||
if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER)
|
if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER)
|
||||||
break;
|
break;
|
||||||
else if (name && index >= 0) {
|
else if (name && index >= 0) {
|
||||||
pr_err("ERROR: could not get IIO channel %s:%s(%i)\n",
|
pr_err("ERROR: could not get IIO channel %pOF:%s(%i)\n",
|
||||||
np->full_name, name ? name : "", index);
|
np, name ? name : "", index);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user