From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Robert Schlabbach <robert_s@gmx.net>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 2/3] media: si2157: Add optional firmware download
Date: Wed, 8 Dec 2021 18:09:17 +0100 [thread overview]
Message-ID: <20211208180917.3f503599@coco.lan> (raw)
In-Reply-To: <trinity-904b019d-ee32-4227-9160-001a00fdd69f-1638981943562@3c-app-gmx-bs36>
Em Wed, 8 Dec 2021 17:45:43 +0100
Robert Schlabbach <robert_s@gmx.net> 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
next prev parent reply other threads:[~2021-12-08 17:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-01 21:10 [PATCH 2/2] media: si2157: Add optional firmware download Robert Schlabbach
2021-12-06 14:00 ` Mauro Carvalho Chehab
2021-12-07 23:07 ` Aw: " Robert Schlabbach
2021-12-08 8:52 ` Mauro Carvalho Chehab
2021-12-08 15:42 ` Aw: " Robert Schlabbach
2021-12-08 10:13 ` [PATCH 0/3] media: si2157: rework firmware load logic Mauro Carvalho Chehab
2021-12-08 10:13 ` [PATCH 1/3] media: si2157: move firmware load to a separate function Mauro Carvalho Chehab
2021-12-08 16:40 ` Robert Schlabbach
2021-12-08 17:03 ` Mauro Carvalho Chehab
2021-12-08 10:13 ` [PATCH 2/3] media: si2157: Add optional firmware download Mauro Carvalho Chehab
2021-12-08 16:45 ` Robert Schlabbach
2021-12-08 17:09 ` Mauro Carvalho Chehab [this message]
2021-12-08 10:13 ` [PATCH 3/3] media: si2157: rework the firmware load logic Mauro Carvalho Chehab
2021-12-08 22:37 ` Robert Schlabbach
2021-12-09 11:34 ` Mauro Carvalho Chehab
2021-12-09 19:37 ` Robert Schlabbach
2021-12-10 6:45 ` Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211208180917.3f503599@coco.lan \
--to=mchehab+huawei@kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=robert_s@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.