@@ -32,23 +32,24 @@ static void syscon_poweroff(void)
static int syscon_poweroff_probe(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
int mask_err, value_err;
- map = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "regmap");
+ map = syscon_regmap_lookup_by_phandle(dev->of_node, "regmap");
if (IS_ERR(map)) {
- dev_err(&pdev->dev, "unable to get syscon");
+ dev_err(dev, "unable to get syscon");
return PTR_ERR(map);
}
- if (of_property_read_u32(pdev->dev.of_node, "offset", &offset)) {
- dev_err(&pdev->dev, "unable to read 'offset'");
+ if (of_property_read_u32(dev->of_node, "offset", &offset)) {
+ dev_err(dev, "unable to read 'offset'");
return -EINVAL;
}
- value_err = of_property_read_u32(pdev->dev.of_node, "value", &value);
- mask_err = of_property_read_u32(pdev->dev.of_node, "mask", &mask);
+ value_err = of_property_read_u32(dev->of_node, "value", &value);
+ mask_err = of_property_read_u32(dev->of_node, "mask", &mask);
if (value_err && mask_err) {
- dev_err(&pdev->dev, "unable to read 'value' and 'mask'");
+ dev_err(dev, "unable to read 'value' and 'mask'");
return -EINVAL;
}
@@ -62,7 +63,7 @@ static int syscon_poweroff_probe(struct platform_device *pdev)
}
if (pm_power_off) {
- dev_err(&pdev->dev, "pm_power_off already claimed for %ps",
+ dev_err(dev, "pm_power_off already claimed for %ps",
pm_power_off);
return -EBUSY;
}
Make the probe() code a bit simpler and shorter by storing all the '&pdev->dev' as 'dev'. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> --- drivers/power/reset/syscon-poweroff.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)