From patchwork Mon Apr 23 10:33:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Baptiste Maneyrol X-Patchwork-Id: 10356573 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C0D2A60209 for ; Mon, 23 Apr 2018 10:34:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B160B28464 for ; Mon, 23 Apr 2018 10:34:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3E1D28A3B; Mon, 23 Apr 2018 10:34:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0459E28464 for ; Mon, 23 Apr 2018 10:34:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754617AbeDWKeO (ORCPT ); Mon, 23 Apr 2018 06:34:14 -0400 Received: from mail-bn3nam01on0055.outbound.protection.outlook.com ([104.47.33.55]:62584 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754442AbeDWKeN (ORCPT ); Mon, 23 Apr 2018 06:34:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invensense.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=+VxsUEs1Zqru1zgllQOzjP64h8Pfa3Qqt7LtMb0qh4w=; b=W9Xbg59B8ukgRK1sSwEDfqbo7eT9ZZiNP9uayk7xdXZ+7JOqd2jOVnQjU5QuX0OoekeDqeg8Prraj0oSESTGRsV/v0CX5Q3+czzhIDbaXd6bn28CkNDHIvYxUWDgmpl9Jt7xpwbPOl0Nw8dm4U/anMipY0w5jM8PJTXwgmfcXLk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=JManeyrol@invensense.com; Received: from frgnb-l-34296kv.invcorp.invensense.com (2a01:e35:87fd:c140:39a5:e592:8e24:6975) by BN6PR1201MB0178.namprd12.prod.outlook.com (2603:10b6:405:56::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.12; Mon, 23 Apr 2018 10:34:10 +0000 From: Jean-Baptiste Maneyrol To: linux-iio@vger.kernel.org Cc: Jean-Baptiste Maneyrol Subject: [PATCH v4 2/4] iio: imu: inv_mpu6050: use devm_* at init and delete remove Date: Mon, 23 Apr 2018 12:33:31 +0200 Message-Id: <1524479613-23954-2-git-send-email-jmaneyrol@invensense.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524479613-23954-1-git-send-email-jmaneyrol@invensense.com> References: <1524479613-23954-1-git-send-email-jmaneyrol@invensense.com> MIME-Version: 1.0 X-Originating-IP: [2a01:e35:87fd:c140:39a5:e592:8e24:6975] X-ClientProxiedBy: DB6PR0601CA0023.eurprd06.prod.outlook.com (2603:10a6:4:7b::33) To BN6PR1201MB0178.namprd12.prod.outlook.com (2603:10b6:405:56::10) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BN6PR1201MB0178; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0178; 3:D8Spwek62ci3cipqOhXcbsrzOAY8rl0eEo7Umfi3n7KqAMZelBxpI34Cd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LyhDgjuFaJb8ZX7CL0S70+iMOLRF13baCLBb0vgMCpFs+zThZrY3d7wIW6zLDCug3pYpTJxAGDCyfbB6nhDYhPwfyDxH0jSp0IqkIaZTH75VE16XTGNz40Gl3AUr2iTHCnvgMxYEKDKUzaAxVYEqHQQpmn7D/SJX0ojrRes+c5/O8L7n7a8HpgRfZU6vWNQNiPnX0nK7nVcKIgVKDpv+Jp1b696QbJIOzMwDbMishyX84w/wLhCifq9/axbNFaFM9YacqEvvwb5ZuI2fXxVYXNi; 4:6nTTsuPqeIj7Scnshx//vljXUp9xxN3/rtTknvZ3BVS/t3xvYLitu1cn2F8NAuiv3BrC2HKWDWDosRXfDO8kJemx7IcUtm4EmTYGS/YAXL+vU/5Bti+HlLakJ2DjFCY0ruJk/9mfzMvrFwrz/2JAI38hONN9anPYl10Yfa34b3fAmZ3qMHuJmDS/Uc5GPaqlieG5+mVg/NtQMli3Rk3HDCiT/mTlxKCDTotLX4Ttk+5aO9dcRfzAai+xtHgVGLCC6/IVuN6PEc3iU1pH9x/sh+RzzmvhU/bull8L8suY6Gug0ZWq8QIf3YVqOcR357sQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(257004950022427); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231232)(944501410)(52105095)(10201501046)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:BN6PR1201MB0178; BCL:0; PCL:0; RULEID:; SRVR:BN6PR1201MB0178; X-Forefront-PRVS: 06515DA04B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(39850400004)(376002)(396003)(346002)(39380400002)(366004)(36756003)(305945005)(5660300001)(6116002)(50466002)(48376002)(2906002)(80792005)(81166006)(8676002)(59450400001)(47776003)(86362001)(8936002)(50226002)(575784001)(2351001)(72206003)(386003)(7736002)(25786009)(2616005)(11346002)(446003)(46003)(476003)(76176011)(16526019)(186003)(52116002)(51416003)(478600001)(7696005)(6666003)(53936002)(52396003)(2361001)(16586007)(6486002)(4326008)(316002)(6916009)(107886003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1201MB0178; H:frgnb-l-34296kv.invcorp.invensense.com; FPR:; SPF:None; LANG:en; MLV:ovrnspm; PTR:InfoNoRecords; Received-SPF: None (protection.outlook.com: invensense.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR1201MB0178; 23:RS2cPcIwEKjyjZ3Hol0rPOxsKzQNsRiJISZtYL9?= =?us-ascii?Q?0N9cOr4gKJF19WpoS/RnTTuzwP9GIdT5hvTZomYJR0GeAs3sHRqYK9I5wGt0?= =?us-ascii?Q?tLntRaA1GJmKOECim/khtETyJYnKtQfzS4PFXML5PjE1q91zFpB4AhiyUE5X?= =?us-ascii?Q?G95kiAddwHPzQVXFzBABbUNpRhzPWzSTuY0py0DTanIZVLODi/VKvKtf4hFZ?= =?us-ascii?Q?Pb7ZRRYnbwJ3UcAkWJ7J4AN7rxGml8RqatD1rcI5GLuM1yI98nSyoOxoxcd2?= =?us-ascii?Q?7xkZ8gC5n5D0WmasEUvdi8cUb2BlNqJsk7MP1PYIvg28srazQ7Wn1MdwOhnk?= =?us-ascii?Q?oR8yUxTK6YKtJG5b6QEfmTgFb51SqTDzHP4CtN/7e+HfMq7ap7dKNMVa97a/?= =?us-ascii?Q?3HsMPuTCZqhGUWTLWoIiyAuOdloIWgqc9Ds8gtJeQ19IXah+V/C3yRVpulSx?= =?us-ascii?Q?b420OMMuNhlQwKfK/omVh0zHWwvQRIb6cUiX7FXYVOgZzzOFEp0gwCdr8KM9?= =?us-ascii?Q?/FimsU/LPbLvCThPYt8uzznJvvIKzxWTedt7xZySXLvySbbtp7IvcRvDaIii?= =?us-ascii?Q?srquOA9Q3kHsYiy03B4ZDjmYamhGg3z73YKj6UUx1XJ5FyUV/ILxjtttooTp?= =?us-ascii?Q?7lu2i8vhrN1vIpy94EoeeE+t1D1ifNTxEfJo2t5dPoaAu2DM11Jh95xJ+V7B?= =?us-ascii?Q?LdhIQTUpZTy5YjgYAUuOsFdNEKO52XNug4HdITxL37AgeMaOeOzxnubM0AKo?= =?us-ascii?Q?SNFEjliaJkDZifFwroRAXaq0glG2N6WSq0x0lc3Iq1EcCvlAEAVnTaiaoa/Y?= =?us-ascii?Q?9r4xWz0mx+LvHbKYrIyQSsIE10zSgLE+STuYgMY6gNAnFjOFKeB5pyTv5lSQ?= =?us-ascii?Q?sJNRjjoSXIwfJT1/BninIWsZJcmu01ut8fL7OOmciSLxP9MdtABa6z2e6DiT?= =?us-ascii?Q?qy4qd4ES4p8CLgnAyolj8dMEhEIZKE20I+wvvI5s9cm6cwxogwgX5W1k6UaD?= =?us-ascii?Q?AIkhYVxI/7ecm0KmKJ17Vzu8H6oeZMW4g8iOeC2Xo+FrL5w/aEOpiJDyvqjj?= =?us-ascii?Q?tXN3Kb721d+n6/jIoE7z7clUH7MZiQMfQE3jxmnlk/obeAuuieGDIe0j5kXO?= =?us-ascii?Q?GUkLoAorGnF0e2nLxqCx5UvtkPrjAZx8E2obfxqRxX9b8/2B+Ud6kVT3OmvL?= =?us-ascii?Q?hxn9wvH+b6ElLTP5w0SJuSIlskee9MS+7Ql3LKq4XKjjVlfPIM8AonhinVg?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Antispam-Message-Info: F4djBjXwoN3C6pBVpPEpyE0syR9EY0uM8yKHbvM/Ps6DMzGr5jo5mhkqZyPF3pOTmHcwqoAi8MPp9Bo2yntTImnXEglXoBdNMuTwaD9HGJZenCIuiwJEPLqvHP0O3EE+DcdW3DsmeixSBqcuFREm2HdB9/AslQzqZUXMEBcY79bbQjhHVmRX9LaczZCNw2nd X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0178; 6:cLyCg6+3EQ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QbTU1sQKes4lK9P3 X-MS-Office365-Filtering-Correlation-Id: 0faf8d88-249c-460b-4002-08d5a905c0aa X-OriginatorOrg: invensense.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2018 10:34:10.6825 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0faf8d88-249c-460b-4002-08d5a905c0aa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 462b3b3b-e42b-47ea-801a-f1581aac892d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0178 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_* for iio_triggered_buffer_setup, iio_device_register, iio_trigger_register. Delete unneeded inv_mpu6050_remove_trigger, inv_mpu_core_remove, and inv_mpu_remove for spi driver. Signed-off-by: Jean-Baptiste Maneyrol --- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 32 ++++++--------------------- drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 12 ++++------ drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 2 -- drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 6 ----- drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c | 7 +----- 5 files changed, 12 insertions(+), 47 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index 5062fbe..45f57f7 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -984,10 +984,10 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, indio_dev->info = &mpu_info; indio_dev->modes = INDIO_BUFFER_TRIGGERED; - result = iio_triggered_buffer_setup(indio_dev, - inv_mpu6050_irq_handler, - inv_mpu6050_read_fifo, - NULL); + result = devm_iio_triggered_buffer_setup(dev, indio_dev, + inv_mpu6050_irq_handler, + inv_mpu6050_read_fifo, + NULL); if (result) { dev_err(dev, "configure buffer fail %d\n", result); return result; @@ -995,39 +995,21 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, result = inv_mpu6050_probe_trigger(indio_dev, irq_type); if (result) { dev_err(dev, "trigger probe fail %d\n", result); - goto out_unreg_ring; + return result; } INIT_KFIFO(st->timestamps); spin_lock_init(&st->time_stamp_lock); - result = iio_device_register(indio_dev); + result = devm_iio_device_register(dev, indio_dev); if (result) { dev_err(dev, "IIO register fail %d\n", result); - goto out_remove_trigger; + return result; } return 0; - -out_remove_trigger: - inv_mpu6050_remove_trigger(st); -out_unreg_ring: - iio_triggered_buffer_cleanup(indio_dev); - return result; } EXPORT_SYMBOL_GPL(inv_mpu_core_probe); -int inv_mpu_core_remove(struct device *dev) -{ - struct iio_dev *indio_dev = dev_get_drvdata(dev); - - iio_device_unregister(indio_dev); - inv_mpu6050_remove_trigger(iio_priv(indio_dev)); - iio_triggered_buffer_cleanup(indio_dev); - - return 0; -} -EXPORT_SYMBOL_GPL(inv_mpu_core_remove); - #ifdef CONFIG_PM_SLEEP static int inv_mpu_resume(struct device *dev) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c index 27e777c..90fdc5e 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c @@ -129,14 +129,12 @@ static int inv_mpu_probe(struct i2c_client *client, 1, 0, I2C_MUX_LOCKED | I2C_MUX_GATE, inv_mpu6050_select_bypass, inv_mpu6050_deselect_bypass); - if (!st->muxc) { - result = -ENOMEM; - goto out_unreg_device; - } + if (!st->muxc) + return -ENOMEM; st->muxc->priv = dev_get_drvdata(&client->dev); result = i2c_mux_add_adapter(st->muxc, 0, 0, 0); if (result) - goto out_unreg_device; + return result; result = inv_mpu_acpi_create_mux_client(client); if (result) @@ -146,8 +144,6 @@ static int inv_mpu_probe(struct i2c_client *client, out_del_mux: i2c_mux_del_adapters(st->muxc); -out_unreg_device: - inv_mpu_core_remove(&client->dev); return result; } @@ -159,7 +155,7 @@ static int inv_mpu_remove(struct i2c_client *client) inv_mpu_acpi_delete_mux_client(client); i2c_mux_del_adapters(st->muxc); - return inv_mpu_core_remove(&client->dev); + return 0; } /* diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h index c8aad13..142a835 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h @@ -301,7 +301,6 @@ enum inv_mpu6050_clock_sel_e { irqreturn_t inv_mpu6050_irq_handler(int irq, void *p); irqreturn_t inv_mpu6050_read_fifo(int irq, void *p); int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev, int irq_type); -void inv_mpu6050_remove_trigger(struct inv_mpu6050_state *st); int inv_reset_fifo(struct iio_dev *indio_dev); int inv_mpu6050_switch_engine(struct inv_mpu6050_state *st, bool en, u32 mask); int inv_mpu6050_write_reg(struct inv_mpu6050_state *st, int reg, u8 val); @@ -310,5 +309,4 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client); void inv_mpu_acpi_delete_mux_client(struct i2c_client *client); int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, int (*inv_mpu_bus_setup)(struct iio_dev *), int chip_type); -int inv_mpu_core_remove(struct device *dev); extern const struct dev_pm_ops inv_mpu_pmops; diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c index a7b0f15..fe0bf5a 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c @@ -69,11 +69,6 @@ static int inv_mpu_probe(struct spi_device *spi) inv_mpu_i2c_disable, chip_type); } -static int inv_mpu_remove(struct spi_device *spi) -{ - return inv_mpu_core_remove(&spi->dev); -} - /* * device id table is used to identify what device can be * supported by this driver @@ -98,7 +93,6 @@ MODULE_DEVICE_TABLE(acpi, inv_acpi_match); static struct spi_driver inv_mpu_driver = { .probe = inv_mpu_probe, - .remove = inv_mpu_remove, .id_table = inv_mpu_id, .driver = { .acpi_match_table = ACPI_PTR(inv_acpi_match), diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c index fc8843c..8a9f869 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c @@ -154,7 +154,7 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev, int irq_type) st->trig->ops = &inv_mpu_trigger_ops; iio_trigger_set_drvdata(st->trig, indio_dev); - ret = iio_trigger_register(st->trig); + ret = devm_iio_trigger_register(&indio_dev->dev, st->trig); if (ret) return ret; @@ -162,8 +162,3 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev, int irq_type) return 0; } - -void inv_mpu6050_remove_trigger(struct inv_mpu6050_state *st) -{ - iio_trigger_unregister(st->trig); -}