Re: [PATCH 2/3] media: si2157: Add optional firmware download

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Wed, 8 Dec 2021 17:45:43 +0100
Robert Schlabbach <robert_s@xxxxxxx> escreveu:

> > 	ret = si2157_load_firmware(fe, fw_name);
> >  	if (ret) {
> > +		if (!fw_required)
> > +			goto skip_fw_download;
> > +  
> 
> In conjunction with my proposal for PATCH 1/3, this can be simplified to:
> 
> ret = si2157_load_firmware(fe, fw_name);
> if (ret && fw_required)
>         goto err;

See the patch 3:

	ret = si2157_load_firmware(fe, fw_name);
+	if (fw_required && ret == -ENOENT)
+		warn_firmware_not_loaded = true;
+	else if (ret < 0) {
+		dev_err(&client->dev, "error %d when loading firmware file '%s'\n",
+			ret, fw_name);

Basically, it will do (about) the same thing you proposed, with one
important difference: It should only ignore errors loading the firmware
when the error is due to a non-existing firmware file. If the firmware
file is corrupted or can't be load for other reasons (ENOMEM, corrupted
file, etc), it will print the error code and bail out.

Thanks,
Mauro



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux