]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/soc_camera.c
V4L/DVB (9521): V4L: struct device - replace bus_id with dev_name(), dev_set_name()
[linux-2.6-omap-h63xx.git] / drivers / media / video / soc_camera.c
index b6be5ee678b6112514b70c3335282919259219f0..28cf5c94bd611fa4af0afd86e021f8c2a8cd3501 100644 (file)
@@ -732,10 +732,36 @@ static int soc_camera_remove(struct device *dev)
        return 0;
 }
 
+static int soc_camera_suspend(struct device *dev, pm_message_t state)
+{
+       struct soc_camera_device *icd = to_soc_camera_dev(dev);
+       struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
+       int ret = 0;
+
+       if (ici->ops->suspend)
+               ret = ici->ops->suspend(icd, state);
+
+       return ret;
+}
+
+static int soc_camera_resume(struct device *dev)
+{
+       struct soc_camera_device *icd = to_soc_camera_dev(dev);
+       struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
+       int ret = 0;
+
+       if (ici->ops->resume)
+               ret = ici->ops->resume(icd);
+
+       return ret;
+}
+
 static struct bus_type soc_camera_bus_type = {
        .name           = "soc-camera",
        .probe          = soc_camera_probe,
        .remove         = soc_camera_remove,
+       .suspend        = soc_camera_suspend,
+       .resume         = soc_camera_resume,
 };
 
 static struct device_driver ic_drv = {
@@ -757,7 +783,7 @@ int soc_camera_host_register(struct soc_camera_host *ici)
                return -EINVAL;
 
        /* Number might be equal to the platform device ID */
-       sprintf(ici->dev.bus_id, "camera_host%d", ici->nr);
+       dev_set_name(&ici->dev, "camera_host%d", ici->nr);
 
        mutex_lock(&list_lock);
        list_for_each_entry(ix, &hosts, list) {
@@ -841,8 +867,7 @@ int soc_camera_device_register(struct soc_camera_device *icd)
 
        icd->devnum = num;
        icd->dev.bus = &soc_camera_bus_type;
-       snprintf(icd->dev.bus_id, sizeof(icd->dev.bus_id),
-                "%u-%u", icd->iface, icd->devnum);
+       dev_set_name(&icd->dev, "%u-%u", icd->iface, icd->devnum);
 
        icd->dev.release = dummy_release;