aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/m5mo.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/m5mo.c')
-rw-r--r--drivers/media/video/m5mo.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/media/video/m5mo.c b/drivers/media/video/m5mo.c
index d411269..9d29368 100644
--- a/drivers/media/video/m5mo.c
+++ b/drivers/media/video/m5mo.c
@@ -174,8 +174,6 @@ static struct m5mo_control m5mo_ctrls[] = {
},
};
-struct class *camera_class;
-
static inline struct m5mo_state *to_state(struct v4l2_subdev *sd)
{
return container_of(sd, struct m5mo_state, sd);
@@ -2935,8 +2933,8 @@ static int __devinit m5mo_probe(struct i2c_client *client,
state->dbg_level = CAM_DEBUG;
#endif
if (state->m5mo_dev == NULL) {
- state->m5mo_dev =
- device_create(camera_class, NULL, 0, NULL, "rear");
+ state->m5mo_dev = device_create(camera_class, NULL,
+ MKDEV(CAM_MAJOR, 0), NULL, "rear");
if (IS_ERR(state->m5mo_dev)) {
cam_err("failed to create device m5mo_dev!\n");
} else {
@@ -2983,7 +2981,7 @@ static int __devexit m5mo_remove(struct i2c_client *client)
device_remove_file(state->m5mo_dev, &dev_attr_rear_camtype);
device_remove_file(state->m5mo_dev, &dev_attr_rear_camfw);
- device_destroy(camera_class, 0);
+ device_destroy(camera_class, state->m5mo_dev->devt);
state->m5mo_dev = NULL;
if (state->isp.irq > 0)
@@ -3014,9 +3012,6 @@ static struct i2c_driver m5mo_i2c_driver = {
static int __init m5mo_mod_init(void)
{
- camera_class = class_create(THIS_MODULE, "camera");
- if (IS_ERR(camera_class))
- pr_err("Failed to create class(camera)!\n");
return i2c_add_driver(&m5mo_i2c_driver);
}