aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-sony.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-sony.c')
-rw-r--r--drivers/hid/hid-sony.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 87fbe2924cfa..30dbb6b40bbf 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -624,7 +624,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
624 struct sony_sc *sc; 624 struct sony_sc *sc;
625 unsigned int connect_mask = HID_CONNECT_DEFAULT; 625 unsigned int connect_mask = HID_CONNECT_DEFAULT;
626 626
627 sc = kzalloc(sizeof(*sc), GFP_KERNEL); 627 sc = devm_kzalloc(&hdev->dev, sizeof(*sc), GFP_KERNEL);
628 if (sc == NULL) { 628 if (sc == NULL) {
629 hid_err(hdev, "can't alloc sony descriptor\n"); 629 hid_err(hdev, "can't alloc sony descriptor\n");
630 return -ENOMEM; 630 return -ENOMEM;
@@ -636,7 +636,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
636 ret = hid_parse(hdev); 636 ret = hid_parse(hdev);
637 if (ret) { 637 if (ret) {
638 hid_err(hdev, "parse failed\n"); 638 hid_err(hdev, "parse failed\n");
639 goto err_free; 639 return ret;
640 } 640 }
641 641
642 if (sc->quirks & VAIO_RDESC_CONSTANT) 642 if (sc->quirks & VAIO_RDESC_CONSTANT)
@@ -649,7 +649,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
649 ret = hid_hw_start(hdev, connect_mask); 649 ret = hid_hw_start(hdev, connect_mask);
650 if (ret) { 650 if (ret) {
651 hid_err(hdev, "hw start failed\n"); 651 hid_err(hdev, "hw start failed\n");
652 goto err_free; 652 return ret;
653 } 653 }
654 654
655 if (sc->quirks & SIXAXIS_CONTROLLER_USB) { 655 if (sc->quirks & SIXAXIS_CONTROLLER_USB) {
@@ -669,8 +669,6 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
669 return 0; 669 return 0;
670err_stop: 670err_stop:
671 hid_hw_stop(hdev); 671 hid_hw_stop(hdev);
672err_free:
673 kfree(sc);
674 return ret; 672 return ret;
675} 673}
676 674
@@ -682,7 +680,6 @@ static void sony_remove(struct hid_device *hdev)
682 buzz_remove(hdev); 680 buzz_remove(hdev);
683 681
684 hid_hw_stop(hdev); 682 hid_hw_stop(hdev);
685 kfree(sc);
686} 683}
687 684
688static const struct hid_device_id sony_devices[] = { 685static const struct hid_device_id sony_devices[] = {