Skip to content

Commit 478f389

Browse files
ukleinekvinodkoul
authored andcommitted
soundwire: Make remove function return no value
All remove functions return zero and the driver core ignores any other returned value (just emits a warning about it being ignored). So make all remove callbacks return void instead of an ignored int. This is in line with most other subsystems. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/20251215174925.1327021-5-u.kleine-koenig@baylibre.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 5994637 commit 478f389

25 files changed

Lines changed: 26 additions & 73 deletions

drivers/soundwire/bus_type.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ static int sdw_drv_remove(struct device *dev)
168168
{
169169
struct sdw_slave *slave = dev_to_sdw_dev(dev);
170170
struct sdw_driver *drv = drv_to_sdw_driver(dev->driver);
171-
int ret = 0;
172171

173172
mutex_lock(&slave->sdw_dev_lock);
174173

@@ -177,11 +176,11 @@ static int sdw_drv_remove(struct device *dev)
177176
mutex_unlock(&slave->sdw_dev_lock);
178177

179178
if (drv->remove)
180-
ret = drv->remove(slave);
179+
drv->remove(slave);
181180

182181
ida_free(&slave->bus->slave_ida, slave->index);
183182

184-
return ret;
183+
return 0;
185184
}
186185

187186
static void sdw_drv_shutdown(struct device *dev)

include/linux/soundwire/sdw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ struct sdw_master_device {
705705

706706
struct sdw_driver {
707707
int (*probe)(struct sdw_slave *sdw, const struct sdw_device_id *id);
708-
int (*remove)(struct sdw_slave *sdw);
708+
void (*remove)(struct sdw_slave *sdw);
709709
void (*shutdown)(struct sdw_slave *sdw);
710710

711711
const struct sdw_device_id *id_table;

sound/soc/codecs/cs35l56-sdw.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ static int cs35l56_sdw_probe(struct sdw_slave *peripheral, const struct sdw_devi
554554
return 0;
555555
}
556556

557-
static int cs35l56_sdw_remove(struct sdw_slave *peripheral)
557+
static void cs35l56_sdw_remove(struct sdw_slave *peripheral)
558558
{
559559
struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev);
560560

@@ -566,8 +566,6 @@ static int cs35l56_sdw_remove(struct sdw_slave *peripheral)
566566
sdw_write_no_pm(peripheral, CS35L56_SDW_GEN_INT_STAT_1, 0xFF);
567567

568568
cs35l56_remove(cs35l56);
569-
570-
return 0;
571569
}
572570

573571
static const struct dev_pm_ops cs35l56_sdw_pm = {

sound/soc/codecs/cs42l42-sdw.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,14 +585,12 @@ static int cs42l42_sdw_probe(struct sdw_slave *peripheral, const struct sdw_devi
585585
return 0;
586586
}
587587

588-
static int cs42l42_sdw_remove(struct sdw_slave *peripheral)
588+
static void cs42l42_sdw_remove(struct sdw_slave *peripheral)
589589
{
590590
struct cs42l42_private *cs42l42 = dev_get_drvdata(&peripheral->dev);
591591

592592
cs42l42_common_remove(cs42l42);
593593
pm_runtime_disable(cs42l42->dev);
594-
595-
return 0;
596594
}
597595

598596
static const struct dev_pm_ops cs42l42_sdw_pm = {

sound/soc/codecs/max98373-sdw.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -839,11 +839,9 @@ static int max98373_sdw_probe(struct sdw_slave *slave,
839839
return max98373_init(slave, regmap);
840840
}
841841

842-
static int max98373_sdw_remove(struct sdw_slave *slave)
842+
static void max98373_sdw_remove(struct sdw_slave *slave)
843843
{
844844
pm_runtime_disable(&slave->dev);
845-
846-
return 0;
847845
}
848846

849847
#if defined(CONFIG_OF)

sound/soc/codecs/pm4125-sdw.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,13 +436,11 @@ static int pm4125_probe(struct sdw_slave *pdev, const struct sdw_device_id *id)
436436
return 0;
437437
}
438438

439-
static int pm4125_remove(struct sdw_slave *pdev)
439+
static void pm4125_remove(struct sdw_slave *pdev)
440440
{
441441
struct device *dev = &pdev->dev;
442442

443443
component_del(dev, &wcd_sdw_component_ops);
444-
445-
return 0;
446444
}
447445

448446
static const struct sdw_device_id pm4125_slave_id[] = {

sound/soc/codecs/rt1017-sdca-sdw.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,14 +741,12 @@ static int rt1017_sdca_sdw_probe(struct sdw_slave *slave,
741741
return rt1017_sdca_init(&slave->dev, regmap, slave);
742742
}
743743

744-
static int rt1017_sdca_sdw_remove(struct sdw_slave *slave)
744+
static void rt1017_sdca_sdw_remove(struct sdw_slave *slave)
745745
{
746746
struct rt1017_sdca_priv *rt1017 = dev_get_drvdata(&slave->dev);
747747

748748
if (rt1017->first_hw_init)
749749
pm_runtime_disable(&slave->dev);
750-
751-
return 0;
752750
}
753751

754752
static const struct sdw_device_id rt1017_sdca_id[] = {

sound/soc/codecs/rt1308-sdw.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -739,11 +739,9 @@ static int rt1308_sdw_probe(struct sdw_slave *slave,
739739
return rt1308_sdw_init(&slave->dev, regmap, slave);
740740
}
741741

742-
static int rt1308_sdw_remove(struct sdw_slave *slave)
742+
static void rt1308_sdw_remove(struct sdw_slave *slave)
743743
{
744744
pm_runtime_disable(&slave->dev);
745-
746-
return 0;
747745
}
748746

749747
static const struct sdw_device_id rt1308_id[] = {

sound/soc/codecs/rt1316-sdw.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,11 +716,9 @@ static int rt1316_sdw_probe(struct sdw_slave *slave,
716716
return rt1316_sdw_init(&slave->dev, regmap, slave);
717717
}
718718

719-
static int rt1316_sdw_remove(struct sdw_slave *slave)
719+
static void rt1316_sdw_remove(struct sdw_slave *slave)
720720
{
721721
pm_runtime_disable(&slave->dev);
722-
723-
return 0;
724722
}
725723

726724
static const struct sdw_device_id rt1316_id[] = {

sound/soc/codecs/rt1318-sdw.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,11 +793,9 @@ static int rt1318_sdw_probe(struct sdw_slave *slave,
793793
return rt1318_sdw_init(&slave->dev, regmap, slave);
794794
}
795795

796-
static int rt1318_sdw_remove(struct sdw_slave *slave)
796+
static void rt1318_sdw_remove(struct sdw_slave *slave)
797797
{
798798
pm_runtime_disable(&slave->dev);
799-
800-
return 0;
801799
}
802800

803801
static const struct sdw_device_id rt1318_id[] = {

0 commit comments

Comments
 (0)