Skip to content

Commit 3572ad8

Browse files
committed
ASoC: drop bogus container_of() error handling
Merge series from Johan Hovold <johan@kernel.org>: The dev_to_sdw_dev() helper uses container_of() to return the containing soundwire device structure of its pointer argument and will never return NULL.
2 parents 6c11aa2 + 870b10f commit 3572ad8

3 files changed

Lines changed: 0 additions & 15 deletions

File tree

sound/soc/codecs/pm4125.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,13 +1533,7 @@ static int pm4125_bind(struct device *dev)
15331533

15341534
pm4125->sdw_priv[AIF1_CAP] = dev_get_drvdata(pm4125->txdev);
15351535
pm4125->sdw_priv[AIF1_CAP]->pm4125 = pm4125;
1536-
15371536
pm4125->tx_sdw_dev = dev_to_sdw_dev(pm4125->txdev);
1538-
if (!pm4125->tx_sdw_dev) {
1539-
dev_err(dev, "could not get txslave with matching of dev\n");
1540-
ret = -EINVAL;
1541-
goto error_put_tx;
1542-
}
15431537

15441538
/*
15451539
* As TX is the main CSR reg interface, which should not be suspended first.

sound/soc/codecs/wcd937x.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2763,11 +2763,6 @@ static int wcd937x_bind(struct device *dev)
27632763
wcd937x->sdw_priv[AIF1_CAP] = dev_get_drvdata(wcd937x->txdev);
27642764
wcd937x->sdw_priv[AIF1_CAP]->wcd937x = wcd937x;
27652765
wcd937x->tx_sdw_dev = dev_to_sdw_dev(wcd937x->txdev);
2766-
if (!wcd937x->tx_sdw_dev) {
2767-
dev_err(dev, "could not get txslave with matching of dev\n");
2768-
ret = -EINVAL;
2769-
goto err_put_txdev;
2770-
}
27712766

27722767
/*
27732768
* As TX is the main CSR reg interface, which should not be suspended first.

sound/soc/sdw_utils/soc_sdw_utils.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,10 +1414,6 @@ static int is_sdca_endpoint_present(struct device *dev,
14141414
}
14151415

14161416
slave = dev_to_sdw_dev(sdw_dev);
1417-
if (!slave) {
1418-
ret = -EINVAL;
1419-
goto put_device;
1420-
}
14211417

14221418
/* Make sure BIOS provides SDCA properties */
14231419
if (!slave->sdca_data.interface_revision) {

0 commit comments

Comments
 (0)