Skip to content

Commit

Permalink
[media] m5mols: Remove superfluous irq field from the platform data s…
Browse files Browse the repository at this point in the history
…truct

There is no need to put the IRQ number in driver's private platform
data structure as this can also be passed in struct i2c_lient.irq.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Sep 24, 2011
1 parent 12ecf56 commit 5b3bdfc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions drivers/media/video/m5mols/m5mols_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ static int __devinit m5mols_probe(struct i2c_client *client,
return -EINVAL;
}

if (!pdata->irq) {
if (!client->irq) {
dev_err(&client->dev, "Interrupt not assigned\n");
return -EINVAL;
}
Expand Down Expand Up @@ -973,7 +973,7 @@ static int __devinit m5mols_probe(struct i2c_client *client,

init_waitqueue_head(&info->irq_waitq);
INIT_WORK(&info->work_irq, m5mols_irq_work);
ret = request_irq(pdata->irq, m5mols_irq_handler,
ret = request_irq(client->irq, m5mols_irq_handler,
IRQF_TRIGGER_RISING, MODULE_NAME, sd);
if (ret) {
dev_err(&client->dev, "Interrupt request failed: %d\n", ret);
Expand All @@ -998,7 +998,7 @@ static int __devexit m5mols_remove(struct i2c_client *client)
struct m5mols_info *info = to_m5mols(sd);

v4l2_device_unregister_subdev(sd);
free_irq(info->pdata->irq, sd);
free_irq(client->irq, sd);

regulator_bulk_free(ARRAY_SIZE(supplies), supplies);
gpio_free(info->pdata->gpio_reset);
Expand Down
4 changes: 1 addition & 3 deletions include/media/m5mols.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@

/**
* struct m5mols_platform_data - platform data for M-5MOLS driver
* @irq: GPIO getting the irq pin of M-5MOLS
* @gpio_reset: GPIO driving the reset pin of M-5MOLS
* @reset_polarity: active state for gpio_rst pin, 0 or 1
* @reset_polarity: active state for gpio_reset pin, 0 or 1
* @set_power: an additional callback to the board setup code
* to be called after enabling and before disabling
* the sensor's supply regulators
*/
struct m5mols_platform_data {
int irq;
int gpio_reset;
u8 reset_polarity;
int (*set_power)(struct device *dev, int on);
Expand Down

0 comments on commit 5b3bdfc

Please sign in to comment.