include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / media / video / bt8xx / bttv-gpio.c
index ba081f6..fd604d3 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/device.h>
+#include <linux/slab.h>
 #include <asm/io.h>
 
 #include "bttvp.h"
@@ -42,7 +43,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;
 }
@@ -71,7 +72,6 @@ struct bus_type bttv_sub_bus_type = {
        .probe  = bttv_sub_probe,
        .remove = bttv_sub_remove,
 };
-EXPORT_SYMBOL(bttv_sub_bus_type);
 
 static void release_sub_device(struct device *dev)
 {
@@ -92,26 +92,23 @@ 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;
 }
 
 int bttv_sub_del_devices(struct bttv_core *core)
 {
-       struct bttv_sub_device *sub;
-       struct list_head *item,*save;
+       struct bttv_sub_device *sub, *save;
 
-       list_for_each_safe(item,save,&core->subs) {
-               sub = list_entry(item,struct bttv_sub_device,list);
+       list_for_each_entry_safe(sub, save, &core->subs, list) {
                list_del(&sub->list);
                device_unregister(&sub->dev);
        }
@@ -152,7 +149,6 @@ void bttv_gpio_inout(struct bttv_core *core, u32 mask, u32 outbits)
        btwrite(data,BT848_GPIO_OUT_EN);
        spin_unlock_irqrestore(&btv->gpio_lock,flags);
 }
-EXPORT_SYMBOL(bttv_gpio_inout);
 
 u32 bttv_gpio_read(struct bttv_core *core)
 {
@@ -162,7 +158,6 @@ u32 bttv_gpio_read(struct bttv_core *core)
        value = btread(BT848_GPIO_DATA);
        return value;
 }
-EXPORT_SYMBOL(bttv_gpio_read);
 
 void bttv_gpio_write(struct bttv_core *core, u32 value)
 {
@@ -170,7 +165,6 @@ void bttv_gpio_write(struct bttv_core *core, u32 value)
 
        btwrite(value,BT848_GPIO_DATA);
 }
-EXPORT_SYMBOL(bttv_gpio_write);
 
 void bttv_gpio_bits(struct bttv_core *core, u32 mask, u32 bits)
 {
@@ -185,7 +179,6 @@ void bttv_gpio_bits(struct bttv_core *core, u32 mask, u32 bits)
        btwrite(data,BT848_GPIO_DATA);
        spin_unlock_irqrestore(&btv->gpio_lock,flags);
 }
-EXPORT_SYMBOL(bttv_gpio_bits);
 
 /*
  * Local variables: