hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/iio/accel/mma9553.c
....@@ -1,15 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Freescale MMA9553L Intelligent Pedometer driver
34 * Copyright (c) 2014, Intel Corporation.
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
135 */
146
157 #include <linux/module.h>
....@@ -1111,7 +1103,6 @@
11111103 if (ret < 0)
11121104 return ret;
11131105
1114
- indio_dev->dev.parent = &client->dev;
11151106 indio_dev->channels = mma9553_channels;
11161107 indio_dev->num_channels = ARRAY_SIZE(mma9553_channels);
11171108 indio_dev->name = name;
....@@ -1143,12 +1134,15 @@
11431134 ret = iio_device_register(indio_dev);
11441135 if (ret < 0) {
11451136 dev_err(&client->dev, "unable to register iio device\n");
1146
- goto out_poweroff;
1137
+ goto err_pm_cleanup;
11471138 }
11481139
11491140 dev_dbg(&indio_dev->dev, "Registered device %s\n", name);
11501141 return 0;
11511142
1143
+err_pm_cleanup:
1144
+ pm_runtime_dont_use_autosuspend(&client->dev);
1145
+ pm_runtime_disable(&client->dev);
11521146 out_poweroff:
11531147 mma9551_set_device_state(client, false);
11541148 return ret;