Bluetooth: hci_bcm: Make suspend/resume functions platform_dev independent
authorHans de Goede <hdegoede@redhat.com>
Wed, 4 Oct 2017 18:43:42 +0000 (20:43 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 6 Oct 2017 18:35:48 +0000 (20:35 +0200)
Use dev_get_drvdata instead of platform_get_drvdata in the suspend /
resume functions. This is a preparation patch for adding (runtime)pm
support to the serdev path.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/hci_bcm.c

index cadf629..a9acb1a 100644 (file)
@@ -558,7 +558,7 @@ static struct sk_buff *bcm_dequeue(struct hci_uart *hu)
 #ifdef CONFIG_PM
 static int bcm_suspend_device(struct device *dev)
 {
-       struct bcm_device *bdev = platform_get_drvdata(to_platform_device(dev));
+       struct bcm_device *bdev = dev_get_drvdata(dev);
 
        bt_dev_dbg(bdev, "");
 
@@ -581,7 +581,7 @@ static int bcm_suspend_device(struct device *dev)
 
 static int bcm_resume_device(struct device *dev)
 {
-       struct bcm_device *bdev = platform_get_drvdata(to_platform_device(dev));
+       struct bcm_device *bdev = dev_get_drvdata(dev);
 
        bt_dev_dbg(bdev, "");
 
@@ -606,7 +606,7 @@ static int bcm_resume_device(struct device *dev)
 /* Platform suspend callback */
 static int bcm_suspend(struct device *dev)
 {
-       struct bcm_device *bdev = platform_get_drvdata(to_platform_device(dev));
+       struct bcm_device *bdev = dev_get_drvdata(dev);
        int error;
 
        bt_dev_dbg(bdev, "suspend: is_suspended %d", bdev->is_suspended);
@@ -638,7 +638,7 @@ unlock:
 /* Platform resume callback */
 static int bcm_resume(struct device *dev)
 {
-       struct bcm_device *bdev = platform_get_drvdata(to_platform_device(dev));
+       struct bcm_device *bdev = dev_get_drvdata(dev);
 
        bt_dev_dbg(bdev, "resume: is_suspended %d", bdev->is_suspended);