forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/iio/accel/mma9551.c
....@@ -1,15 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Freescale MMA9551L Intelligent Motion-Sensing Platform 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>
....@@ -481,7 +473,6 @@
481473
482474 mutex_init(&data->mutex);
483475
484
- indio_dev->dev.parent = &client->dev;
485476 indio_dev->channels = mma9551_channels;
486477 indio_dev->num_channels = ARRAY_SIZE(mma9551_channels);
487478 indio_dev->name = name;
....@@ -504,11 +495,14 @@
504495 ret = iio_device_register(indio_dev);
505496 if (ret < 0) {
506497 dev_err(&client->dev, "unable to register iio device\n");
507
- goto out_poweroff;
498
+ goto err_pm_cleanup;
508499 }
509500
510501 return 0;
511502
503
+err_pm_cleanup:
504
+ pm_runtime_dont_use_autosuspend(&client->dev);
505
+ pm_runtime_disable(&client->dev);
512506 out_poweroff:
513507 mma9551_set_device_state(client, false);
514508