diff mbox series

media: si2168: drop support for old firmware file name for si2168 B40

Message ID 20210418161544.58858-1-kernel@tuxforce.de
State Accepted
Commit 40ae6eff068e32d727ad518a02574598c458a0c7
Headers show
Series media: si2168: drop support for old firmware file name for si2168 B40 | expand

Commit Message

Lukas Middendorf April 18, 2021, 4:15 p.m. UTC
The si2168 B40 firmware file name has been changed in or before 2014.
During initialization, the new file name is prefered, but the old file name is
used as a fallback when request_firmware with the new file name fails. Once
reading the old file name has been attempted, only this name will be used on
further firmware loading attempts.
During resume, firmware reading with the new file name can (and likely will)
fail even when it actually exists. So this permanent switch to the fallback
firmware name happens even when not desired.

Any system using a recent kernel version can be expected to have the firmware
under the new name. The major distributions are either using the dvb firmware
collection from LibreELEC, which has the new firmware file name, or do not
package the firmware file but have documentation pointing towards a manual
installation of the firmware file under the new name. If the firmware is
available under the old name, it is severely outdated. If the switch to the old
file name is performed, further firmware loading will either permanently fail
(if it is not available) or an outdated firmware version will be used.

Drop support for the fallback firmware file name and fail directly if the
firmware is not available under its current name.
On following attempts, the firmware read will then be retried with the correct
current name instead of the old name.

As reasoned above, there should be no negative effects of this change, while
simplifying code (the B40 variant will be handled identical compared to the
other variants of the si2168) and at the same time fixing possible problems if
firmware loading fails on resume.

Signed-off-by: Lukas Middendorf <kernel@tuxforce.de>
---
 drivers/media/dvb-frontends/si2168.c      | 21 ++++-----------------
 drivers/media/dvb-frontends/si2168_priv.h |  1 -
 2 files changed, 4 insertions(+), 18 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
index 14b93a7d3358..7fae5b1b8adf 100644
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -448,23 +448,10 @@  static int si2168_init(struct dvb_frontend *fe)
 	/* request the firmware, this will block and timeout */
 	ret = request_firmware(&fw, dev->firmware_name, &client->dev);
 	if (ret) {
-		/* fallback mechanism to handle old name for Si2168 B40 fw */
-		if (dev->chip_id == SI2168_CHIP_ID_B40) {
-			dev->firmware_name = SI2168_B40_FIRMWARE_FALLBACK;
-			ret = request_firmware(&fw, dev->firmware_name,
-					       &client->dev);
-		}
-
-		if (ret == 0) {
-			dev_notice(&client->dev,
-					"please install firmware file '%s'\n",
-					SI2168_B40_FIRMWARE);
-		} else {
-			dev_err(&client->dev,
-					"firmware file '%s' not found\n",
-					dev->firmware_name);
-			goto err_release_firmware;
-		}
+		dev_err(&client->dev,
+			"firmware file '%s' not found\n",
+			dev->firmware_name);
+		goto err_release_firmware;
 	}
 
 	dev_info(&client->dev, "downloading firmware from file '%s'\n",
diff --git a/drivers/media/dvb-frontends/si2168_priv.h b/drivers/media/dvb-frontends/si2168_priv.h
index 18bea5222082..4f4d122e3963 100644
--- a/drivers/media/dvb-frontends/si2168_priv.h
+++ b/drivers/media/dvb-frontends/si2168_priv.h
@@ -18,7 +18,6 @@ 
 #define SI2168_A30_FIRMWARE "dvb-demod-si2168-a30-01.fw"
 #define SI2168_B40_FIRMWARE "dvb-demod-si2168-b40-01.fw"
 #define SI2168_D60_FIRMWARE "dvb-demod-si2168-d60-01.fw"
-#define SI2168_B40_FIRMWARE_FALLBACK "dvb-demod-si2168-02.fw"
 
 /* state struct */
 struct si2168_dev {