diff options
| -rw-r--r-- | drivers/input/misc/max8997_haptic.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c index a806ba3818f7..8d6326d7e7be 100644 --- a/drivers/input/misc/max8997_haptic.c +++ b/drivers/input/misc/max8997_haptic.c | |||
| @@ -255,12 +255,14 @@ static int max8997_haptic_probe(struct platform_device *pdev) | |||
| 255 | struct max8997_dev *iodev = dev_get_drvdata(pdev->dev.parent); | 255 | struct max8997_dev *iodev = dev_get_drvdata(pdev->dev.parent); |
| 256 | const struct max8997_platform_data *pdata = | 256 | const struct max8997_platform_data *pdata = |
| 257 | dev_get_platdata(iodev->dev); | 257 | dev_get_platdata(iodev->dev); |
| 258 | const struct max8997_haptic_platform_data *haptic_pdata = | 258 | const struct max8997_haptic_platform_data *haptic_pdata = NULL; |
| 259 | pdata->haptic_pdata; | ||
| 260 | struct max8997_haptic *chip; | 259 | struct max8997_haptic *chip; |
| 261 | struct input_dev *input_dev; | 260 | struct input_dev *input_dev; |
| 262 | int error; | 261 | int error; |
| 263 | 262 | ||
| 263 | if (pdata) | ||
| 264 | haptic_pdata = pdata->haptic_pdata; | ||
| 265 | |||
| 264 | if (!haptic_pdata) { | 266 | if (!haptic_pdata) { |
| 265 | dev_err(&pdev->dev, "no haptic platform data\n"); | 267 | dev_err(&pdev->dev, "no haptic platform data\n"); |
| 266 | return -EINVAL; | 268 | return -EINVAL; |
