From 4309193cab34f5f79808f03e09f8d39a5f2a7288 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 30 Oct 2008 03:51:46 +0000 Subject: V4L: struct device - replace bus_id with dev_name(), dev_set_name() From: Kay Sievers This patch is part of a larger patch series which will remove the "char bus_id[20]" name string from struct device. The device name is managed in the kobject anyway, and without any size limitation, and just needlessly copied into "struct device". To set and read the device name dev_name(dev) and dev_set_name(dev) must be used. If your code uses static kobjects, which it shouldn't do, "const char *init_name" can be used to statically provide the name the registered device should have. At registration time, the init_name field is cleared, to enforce the use of dev_name(dev) to access the device name at a later time. We need to get rid of all occurrences of bus_id in the entire tree to be able to enable the new interface. Please apply this patch, and possibly convert any remaining remaining occurrences of bus_id. We want to submit a patch to -next, which will remove bus_id from "struct device", to find the remaining pieces to convert, and finally switch over to the new api, which will remove the 20 bytes array and does no longer have a size limitation. Thanks, Kay Acked-by: Greg Kroah-Hartman Signed-Off-By: Kay Sievers Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/bt8xx/bttv-gpio.c | 7 +++---- linux/drivers/media/video/bt8xx/bttv.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'linux/drivers/media/video/bt8xx') diff --git a/linux/drivers/media/video/bt8xx/bttv-gpio.c b/linux/drivers/media/video/bt8xx/bttv-gpio.c index dce6dae57..74c325e59 100644 --- a/linux/drivers/media/video/bt8xx/bttv-gpio.c +++ b/linux/drivers/media/video/bt8xx/bttv-gpio.c @@ -42,7 +42,7 @@ static int bttv_sub_bus_match(struct device *dev, struct device_driver *drv) struct bttv_sub_driver *sub = to_bttv_sub_drv(drv); int len = strlen(sub->wanted); - if (0 == strncmp(dev->bus_id, sub->wanted, len)) + if (0 == strncmp(dev_name(dev), sub->wanted, len)) return 1; return 0; } @@ -91,15 +91,14 @@ int bttv_sub_add_device(struct bttv_core *core, char *name) sub->dev.parent = &core->pci->dev; sub->dev.bus = &bttv_sub_bus_type; sub->dev.release = release_sub_device; - snprintf(sub->dev.bus_id,sizeof(sub->dev.bus_id),"%s%d", - name, core->nr); + dev_set_name(&sub->dev, "%s%d", name, core->nr); err = device_register(&sub->dev); if (0 != err) { kfree(sub); return err; } - printk("bttv%d: add subdevice \"%s\"\n", core->nr, sub->dev.bus_id); + printk("bttv%d: add subdevice \"%s\"\n", core->nr, dev_name(&sub->dev)); list_add_tail(&sub->list,&core->subs); return 0; } diff --git a/linux/drivers/media/video/bt8xx/bttv.h b/linux/drivers/media/video/bt8xx/bttv.h index 0f2a33eb3..20f027ee4 100644 --- a/linux/drivers/media/video/bt8xx/bttv.h +++ b/linux/drivers/media/video/bt8xx/bttv.h @@ -311,7 +311,7 @@ struct bttv_sub_device { struct bttv_sub_driver { struct device_driver drv; - char wanted[BUS_ID_SIZE]; + char wanted[20]; int (*probe)(struct bttv_sub_device *sub); void (*remove)(struct bttv_sub_device *sub); }; -- cgit v1.2.3 From b4efb4ebbf8e3e7d3d0230bf4a811f7dafeef9a0 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 20 Mar 2008 01:18:11 +0000 Subject: Increase number of BT8XX devices supported in a system From: Alan McIvor The BT8XX device driver currently only supports 16 such devices in a system. This is too small for many surveillance applications. This patch increases the number to 32. -- video4linux-list mailing list Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list Signed-off-by: Alan McIvor Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/bt8xx/bttvp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/drivers/media/video/bt8xx') diff --git a/linux/drivers/media/video/bt8xx/bttvp.h b/linux/drivers/media/video/bt8xx/bttvp.h index 403695f9a..92961e130 100644 --- a/linux/drivers/media/video/bt8xx/bttvp.h +++ b/linux/drivers/media/video/bt8xx/bttvp.h @@ -461,7 +461,7 @@ struct bttv { }; /* our devices */ -#define BTTV_MAX 16 +#define BTTV_MAX 32 extern unsigned int bttv_num; extern struct bttv bttvs[BTTV_MAX]; -- cgit v1.2.3