mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
media: cxd2880: Eliminate dead code
An spi remove callback is never called with an spi_device pointer that is NULL. Also it is only called for devices that probed successfully. As cxd2880_spi_probe() always sets driver data, spi_get_drvdata() cannot be NULL. Also the return value of spi remove callbacks is ignored anyway and not freeing resources in .remove() is a bad idea. Link: https://lore.kernel.org/linux-media/20211012153945.2651412-8-u.kleine-koenig@pengutronix.de Cc: Mark Brown <broonie@kernel.org>, kernel@pengutronix.de, linux-media@vger.kernel.org, linux-spi@vger.kernel.org Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
48f45c2a96
commit
61b738e938
@ -628,19 +628,8 @@ fail_regulator:
|
||||
static int
|
||||
cxd2880_spi_remove(struct spi_device *spi)
|
||||
{
|
||||
struct cxd2880_dvb_spi *dvb_spi;
|
||||
struct cxd2880_dvb_spi *dvb_spi = spi_get_drvdata(spi);
|
||||
|
||||
if (!spi) {
|
||||
pr_err("invalid arg\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dvb_spi = spi_get_drvdata(spi);
|
||||
|
||||
if (!dvb_spi) {
|
||||
pr_err("failed\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
dvb_spi->demux.dmx.remove_frontend(&dvb_spi->demux.dmx,
|
||||
&dvb_spi->dmx_fe);
|
||||
dvb_dmxdev_release(&dvb_spi->dmxdev);
|
||||
|
Loading…
Reference in New Issue
Block a user