diff options
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-sensor-hub.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index 0e0fad0285ab..d9d73e9163eb 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c | |||
@@ -555,8 +555,7 @@ static int sensor_hub_probe(struct hid_device *hdev, | |||
555 | sizeof(struct mfd_cell), | 555 | sizeof(struct mfd_cell), |
556 | GFP_KERNEL); | 556 | GFP_KERNEL); |
557 | if (sd->hid_sensor_hub_client_devs == NULL) { | 557 | if (sd->hid_sensor_hub_client_devs == NULL) { |
558 | hid_err(hdev, | 558 | hid_err(hdev, "Failed to allocate memory for mfd cells\n"); |
559 | "Failed to allocate memory for mfd cells\n"); | ||
560 | ret = -ENOMEM; | 559 | ret = -ENOMEM; |
561 | goto err_close; | 560 | goto err_close; |
562 | } | 561 | } |
@@ -568,10 +567,9 @@ static int sensor_hub_probe(struct hid_device *hdev, | |||
568 | name = kasprintf(GFP_KERNEL, "HID-SENSOR-%x", | 567 | name = kasprintf(GFP_KERNEL, "HID-SENSOR-%x", |
569 | field->physical); | 568 | field->physical); |
570 | if (name == NULL) { | 569 | if (name == NULL) { |
571 | hid_err(hdev, | 570 | hid_err(hdev, "Failed MFD device name\n"); |
572 | "Failed MFD device name\n"); | ||
573 | ret = -ENOMEM; | 571 | ret = -ENOMEM; |
574 | goto err_free_cells; | 572 | goto err_free_names; |
575 | } | 573 | } |
576 | sd->hid_sensor_hub_client_devs[ | 574 | sd->hid_sensor_hub_client_devs[ |
577 | sd->hid_sensor_client_cnt].name = name; | 575 | sd->hid_sensor_client_cnt].name = name; |
@@ -595,10 +593,8 @@ static int sensor_hub_probe(struct hid_device *hdev, | |||
595 | err_free_names: | 593 | err_free_names: |
596 | for (i = 0; i < sd->hid_sensor_client_cnt ; ++i) | 594 | for (i = 0; i < sd->hid_sensor_client_cnt ; ++i) |
597 | kfree(sd->hid_sensor_hub_client_devs[i].name); | 595 | kfree(sd->hid_sensor_hub_client_devs[i].name); |
598 | err_free_cells: | ||
599 | kfree(sd->hid_sensor_hub_client_devs); | 596 | kfree(sd->hid_sensor_hub_client_devs); |
600 | err_close: | 597 | err_close: |
601 | hid_hw_stop(hdev); | ||
602 | hid_hw_close(hdev); | 598 | hid_hw_close(hdev); |
603 | err_stop_hw: | 599 | err_stop_hw: |
604 | hid_hw_stop(hdev); | 600 | hid_hw_stop(hdev); |
@@ -617,8 +613,8 @@ static void sensor_hub_remove(struct hid_device *hdev) | |||
617 | int i; | 613 | int i; |
618 | 614 | ||
619 | hid_dbg(hdev, " hardware removed\n"); | 615 | hid_dbg(hdev, " hardware removed\n"); |
620 | hid_hw_stop(hdev); | ||
621 | hid_hw_close(hdev); | 616 | hid_hw_close(hdev); |
617 | hid_hw_stop(hdev); | ||
622 | spin_lock_irqsave(&data->lock, flags); | 618 | spin_lock_irqsave(&data->lock, flags); |
623 | if (data->pending.status) | 619 | if (data->pending.status) |
624 | complete(&data->pending.ready); | 620 | complete(&data->pending.ready); |