From: "Bjørn Mork" <bjorn@mork.no>
To: "Jon Arne Jørgensen" <jonarne@jonarne.no>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
hverkuil@xs4all.nl, elezegarcia@gmail.com
Subject: Re: [RFC V1 7/8] smi2021: Add smi2021_bl.c
Date: Mon, 18 Mar 2013 10:31:14 +0100 [thread overview]
Message-ID: <871ubd3vh9.fsf@nemi.mork.no> (raw)
In-Reply-To: <1363270024-12127-8-git-send-email-jonarne@jonarne.no> ("Jon Arne =?utf-8?Q?J=C3=B8rgensen=22's?= message of "Thu, 14 Mar 2013 15:07:03 +0100")
Jon Arne Jørgensen <jonarne@jonarne.no> writes:
> This is the smi2021-bootloader module.
> This module will upload the firmware for the different somagic devices.
I really don't understand why you want to make that a separate module.
Building both the bootlader driver and the real driver into the same
module will make sure that either both or none are available, document
the relationship to the end user, and allow you to tell the user that
firmware files may be needed for the real driver by using the
MODULE_FIRMWARE macro (which you should do, IMHO).
> +static unsigned int firmware_version;
> +module_param(firmware_version, int, 0644);
> +MODULE_PARM_DESC(firmware_version,
> + "Firmware version to be uploaded to device\n"
> + "if there are more than one firmware present");
> +
> +struct usb_device_id smi2021_bootloader_id_table[] = {
> + { USB_DEVICE(0x1c88, 0x0007) },
> + { }
> +};
> +
> +struct smi2021_firmware {
> + int id;
> + const char *name;
> + int found;
> +};
> +
> +struct smi2021_firmware available_fw[] = {
> + {
> + .id = 0x3c,
> + .name = "smi2021_3c.bin",
> + },
> + {
> + .id = 0x3e,
> + .name = "smi2021_3e.bin",
> + },
> + {
> + .id = 0x3f,
> + .name = "smi2021_3f.bin",
> + }
> +};
How does the user know which firmware to select? Will any of them work,
or are they device specific? Either way I believe you should publish all
three names using MODULE_FIRMWARE.
> +static int smi2021_load_firmware(struct usb_device *udev,
> + const struct firmware *firmware)
> +{
> + int i, size, rc = 0;
> + u8 *chunk;
> + u16 ack = 0x0000;
> +
> + if (udev == NULL)
> + goto end_out;
Is this possible?
> + size = FIRMWARE_CHUNK_SIZE + FIRMWARE_HEADER_SIZE;
> + chunk = kzalloc(size, GFP_KERNEL);
> + chunk[0] = 0x05;
> + chunk[1] = 0xff;
> +
> + if (chunk == NULL) {
This on the other hand, will happen. But you have already oopsed when
you test it here...
Bjørn
next prev parent reply other threads:[~2013-03-18 9:31 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-14 14:06 [RFC V1 0/8] Add a driver for somagic smi2021 Jon Arne Jørgensen
2013-03-14 14:06 ` [RFC V1 1/8] smi2021: Add the header file Jon Arne Jørgensen
2013-03-15 12:13 ` Ezequiel Garcia
2013-03-17 20:16 ` Jon Arne Jørgensen
2013-03-14 14:06 ` [RFC V1 2/8] smi2021: Add smi2021_main.c Jon Arne Jørgensen
2013-03-15 12:20 ` Ezequiel Garcia
2013-03-17 20:14 ` Jon Arne Jørgensen
2013-03-18 7:58 ` Hans Verkuil
2013-03-20 9:30 ` Jon Arne Jørgensen
2013-03-18 8:30 ` Hans Verkuil
2013-03-20 9:31 ` Jon Arne Jørgensen
2013-03-14 14:06 ` [RFC V1 3/8] smi2021: Add smi2021_i2c.c Jon Arne Jørgensen
2013-03-15 12:27 ` Ezequiel Garcia
2013-03-17 19:59 ` Jon Arne Jørgensen
2013-03-18 8:04 ` Hans Verkuil
2013-03-20 9:32 ` Jon Arne Jørgensen
2013-03-14 14:07 ` [RFC V1 4/8] smi2021: Add smi2021_v4l2.c Jon Arne Jørgensen
2013-03-15 12:33 ` Ezequiel Garcia
2013-03-17 20:27 ` Jon Arne Jørgensen
2013-03-18 8:12 ` Hans Verkuil
2013-03-20 9:43 ` Jon Arne Jørgensen
2013-03-20 10:07 ` Hans Verkuil
2013-03-18 8:29 ` Hans Verkuil
2013-03-20 9:48 ` Jon Arne Jørgensen
2013-03-20 10:10 ` Hans Verkuil
2013-03-20 10:16 ` Jon Arne Jørgensen
2013-03-20 10:21 ` Hans Verkuil
2013-03-20 11:09 ` Jon Arne Jørgensen
2013-03-14 14:07 ` [RFC V1 5/8] smi2021: Add smi2021_video.c Jon Arne Jørgensen
2013-03-15 12:40 ` Ezequiel Garcia
2013-03-17 20:19 ` Jon Arne Jørgensen
2013-03-18 8:17 ` Hans Verkuil
2013-03-18 8:58 ` Bjørn Mork
2013-03-20 10:06 ` Jon Arne Jørgensen
2013-03-20 10:09 ` Hans Verkuil
2013-03-14 14:07 ` [RFC V1 6/8] smi2021: Add smi2021_audio.c Jon Arne Jørgensen
2013-03-14 14:07 ` [RFC V1 7/8] smi2021: Add smi2021_bl.c Jon Arne Jørgensen
2013-03-18 9:31 ` Bjørn Mork [this message]
2013-03-20 8:59 ` Jon Arne Jørgensen
2013-03-14 14:07 ` [RFC V1 8/8] smi2021: Add Kconfig and Makefiles Jon Arne Jørgensen
2013-03-15 12:08 ` [RFC V1 0/8] Add a driver for somagic smi2021 Ezequiel Garcia
2013-03-17 20:01 ` Jon Arne Jørgensen
2013-03-18 0:05 ` Ezequiel Garcia
2013-03-20 10:11 ` Jon Arne Jørgensen
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=871ubd3vh9.fsf@nemi.mork.no \
--to=bjorn@mork.no \
--cc=elezegarcia@gmail.com \
--cc=hverkuil@xs4all.nl \
--cc=jonarne@jonarne.no \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome