Skip to content

Commit

Permalink
hwmon: (sht15) fix bad error code
Browse files Browse the repository at this point in the history
When no platform data was supplied, returned error code was 0.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: stable@vger.kernel.org # 2.6.32+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
  • Loading branch information
vivien authored and Guenter Roeck committed Jan 29, 2012
1 parent cba9384 commit 6edf3c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hwmon/sht15.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ static int sht15_invalidate_voltage(struct notifier_block *nb,

static int __devinit sht15_probe(struct platform_device *pdev)
{
int ret = 0;
int ret;
struct sht15_data *data = kzalloc(sizeof(*data), GFP_KERNEL);
u8 status = 0;

Expand All @@ -901,6 +901,7 @@ static int __devinit sht15_probe(struct platform_device *pdev)
init_waitqueue_head(&data->wait_queue);

if (pdev->dev.platform_data == NULL) {
ret = -EINVAL;
dev_err(&pdev->dev, "no platform data supplied\n");
goto err_free_data;
}
Expand Down

0 comments on commit 6edf3c3

Please sign in to comment.