Re: [PATCH 1/3] media: si2157: move firmware load to a separate function

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

 



> @@ -181,45 +228,13 @@  static int si2157_init(struct dvb_frontend *fe)
>  	if (fw_name == NULL)
>  		goto skip_fw_download;

You can invert the condition now and put the si2157_load_firmware() call
inside the if () block, and do away with the goto.

> -	/* request the firmware, this will block and timeout */
> -	ret = request_firmware(&fw, fw_name, &client->dev);
> +	ret = si2157_load_firmware(fe, fw_name);
>  	if (ret) {
>  		dev_err(&client->dev, "firmware file '%s' not found\n",

This will produce duplicate error messages, because the called function
will already output some error messages. You should move this line to
the extracted function as well, and reduce the code in the init function
to:

if (fw_name != null) {
        ret = si2157_load_firmware(fe, fw_name);
        if (ret)
                goto err;
}

Best Regards,
-Robert Schlabbach



[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