From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: jarod@redhat.com
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: [PATCH 3/3] mceusb: Allow a per-model device name
Date: Fri, 22 Oct 2010 11:25:28 -0200 [thread overview]
Message-ID: <20101022112528.6c2e4131@pedra> (raw)
In-Reply-To: <cover.1287753463.git.mchehab@redhat.com>
It is better to use a per-model device name, especially on multi-function
devices like Polaris. So, allow overriding the default name at the
mceusb model table.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c
index e72bfa1..35425ee 100644
--- a/drivers/media/IR/mceusb.c
+++ b/drivers/media/IR/mceusb.c
@@ -126,6 +126,7 @@ struct mceusb_model {
u32 is_polaris:1;
const char *rc_map; /* Allow specify a per-board map */
+ const char *name; /* per-board name */
};
static const struct mceusb_model mceusb_model[] = {
@@ -155,6 +156,7 @@ static const struct mceusb_model mceusb_model[] = {
* to allow testing it
*/
.rc_map = RC_MAP_RC5_HAUPPAUGE_NEW,
+ .name = "cx231xx MCE IR",
},
};
@@ -960,6 +962,7 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir)
struct ir_dev_props *props;
struct device *dev = ir->dev;
const char *rc_map = RC_MAP_RC6_MCE;
+ const char *name = "Media Center Ed. eHome Infrared Remote Transceiver";
int ret = -ENODEV;
idev = input_allocate_device();
@@ -975,8 +978,11 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir)
goto props_alloc_failed;
}
- snprintf(ir->name, sizeof(ir->name), "Media Center Ed. eHome "
- "Infrared Remote Transceiver (%04x:%04x)",
+ if (mceusb_model[ir->model].name)
+ name = mceusb_model[ir->model].name;
+
+ snprintf(ir->name, sizeof(ir->name), "%s (%04x:%04x)",
+ name,
le16_to_cpu(ir->usbdev->descriptor.idVendor),
le16_to_cpu(ir->usbdev->descriptor.idProduct));
--
1.7.1
prev parent reply other threads:[~2010-10-22 13:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1287753463.git.mchehab@redhat.com>
2010-10-22 13:25 ` [PATCH 1/3] mceusb: add a per-model structure Mauro Carvalho Chehab
2010-10-22 13:25 ` [PATCH 2/3] mceusb: allow a per-model RC map Mauro Carvalho Chehab
2010-10-22 13:25 ` Mauro Carvalho Chehab [this message]
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=20101022112528.6c2e4131@pedra \
--to=mchehab@redhat.com \
--cc=jarod@redhat.com \
--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