From 7db0a07273e8f581d0b3e8a102d3d9dd99f43528 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Thu, 6 Aug 2020 11:29:01 +0100 Subject: macintosh: windfarm: remove detatch debug containing spelling mistakes There are spelling mistakes in two debug messages. As recommended by Wolfram Sang, these can be removed as there is plenty of debug in the driver core. Signed-off-by: Colin Ian King Reviewed-by: Wolfram Sang Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200806102901.44988-1-colin.king@canonical.com --- drivers/macintosh/windfarm_lm75_sensor.c | 2 -- drivers/macintosh/windfarm_lm87_sensor.c | 2 -- 2 files changed, 4 deletions(-) (limited to 'drivers/macintosh') diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index 1e5fa09845e7..29f48c2028b6 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c @@ -152,8 +152,6 @@ static int wf_lm75_remove(struct i2c_client *client) { struct wf_lm75_sensor *lm = i2c_get_clientdata(client); - DBG("wf_lm75: i2c detatch called for %s\n", lm->sens.name); - /* Mark client detached */ lm->i2c = NULL; diff --git a/drivers/macintosh/windfarm_lm87_sensor.c b/drivers/macintosh/windfarm_lm87_sensor.c index d011899c0a8a..9fab0b47cd3d 100644 --- a/drivers/macintosh/windfarm_lm87_sensor.c +++ b/drivers/macintosh/windfarm_lm87_sensor.c @@ -149,8 +149,6 @@ static int wf_lm87_remove(struct i2c_client *client) { struct wf_lm87_sensor *lm = i2c_get_clientdata(client); - DBG("wf_lm87: i2c detatch called for %s\n", lm->sens.name); - /* Mark client detached */ lm->i2c = NULL; -- cgit v1.2.3 From 8f7e57e8e29c4fc788811dd4db96126272b8df91 Mon Sep 17 00:00:00 2001 From: Qinglang Miao Date: Mon, 14 Sep 2020 14:14:11 +0800 Subject: macintosh: windfarm: use for_each_child_of_node() macro Use for_each_child_of_node() macro instead of open coding it. Signed-off-by: Qinglang Miao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200914061411.3356-1-miaoqinglang@huawei.com --- drivers/macintosh/windfarm_smu_sat.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/macintosh') diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index cb75dc035616..e46e1153a0b4 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c @@ -216,8 +216,7 @@ static int wf_sat_probe(struct i2c_client *client, vsens[0] = vsens[1] = -1; isens[0] = isens[1] = -1; - child = NULL; - while ((child = of_get_next_child(dev, child)) != NULL) { + for_each_child_of_node(dev, child) { reg = of_get_property(child, "reg", NULL); loc = of_get_property(child, "location", NULL); if (reg == NULL || loc == NULL) -- cgit v1.2.3 From 3db8715ec9dc1d32ecafc67af9fb96508c98efe5 Mon Sep 17 00:00:00 2001 From: Wang Wensheng Date: Mon, 14 Sep 2020 12:26:15 +0000 Subject: drivers/macintosh/smu.c: Fix undeclared symbol warning Make kernel with `C=2`: drivers/macintosh/smu.c:1018:30: warning: symbol '__smu_get_sdb_partition' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Wang Wensheng Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200914122615.65669-1-wangwensheng4@huawei.com --- drivers/macintosh/smu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/macintosh') diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 23f1f41c8602..ca2a0bc5c33e 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c @@ -1015,7 +1015,7 @@ static struct smu_sdbp_header *smu_create_sdb_partition(int id) /* Note: Only allowed to return error code in pointers (using ERR_PTR) * when interruptible is 1 */ -const struct smu_sdbp_header *__smu_get_sdb_partition(int id, +static const struct smu_sdbp_header *__smu_get_sdb_partition(int id, unsigned int *size, int interruptible) { char pname[32]; -- cgit v1.2.3 From 9c826d31a73815464bd3df81e56d39b3d908ac73 Mon Sep 17 00:00:00 2001 From: Qinglang Miao Date: Wed, 16 Sep 2020 14:21:22 +0800 Subject: drivers/macintosh/smu.c: use for_each_child_of_node() macro Use for_each_child_of_node() macro instead of open coding it. Signed-off-by: Qinglang Miao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200916062122.190586-1-miaoqinglang@huawei.com --- drivers/macintosh/smu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/macintosh') diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index ca2a0bc5c33e..51b6f2aa5291 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c @@ -638,7 +638,7 @@ static void smu_expose_childs(struct work_struct *unused) { struct device_node *np; - for (np = NULL; (np = of_get_next_child(smu->of_node, np)) != NULL;) + for_each_child_of_node(smu->of_node, np) if (of_device_is_compatible(np, "smu-sensors")) of_platform_device_create(np, "smu-sensors", &smu->of_dev->dev); -- cgit v1.2.3 From acff5e6c37fa4bf8d002c917a762c4f7615f6eaf Mon Sep 17 00:00:00 2001 From: Qinglang Miao Date: Wed, 16 Sep 2020 14:21:25 +0800 Subject: macintosh: smu_sensors: use for_each_child_of_node() macro Use for_each_child_of_node() macro instead of open coding it. Signed-off-by: Qinglang Miao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200916062125.190729-1-miaoqinglang@huawei.com --- drivers/macintosh/windfarm_smu_sensors.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/macintosh') diff --git a/drivers/macintosh/windfarm_smu_sensors.c b/drivers/macintosh/windfarm_smu_sensors.c index 3e6059eaa138..c8706cfb83fd 100644 --- a/drivers/macintosh/windfarm_smu_sensors.c +++ b/drivers/macintosh/windfarm_smu_sensors.c @@ -421,8 +421,7 @@ static int __init smu_sensors_init(void) return -ENODEV; /* Look for sensors subdir */ - for (sensors = NULL; - (sensors = of_get_next_child(smu, sensors)) != NULL;) + for_each_child_of_node(smu, sensors) if (of_node_name_eq(sensors, "sensors")) break; -- cgit v1.2.3