From patchwork Thu Sep 13 09:51:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10599205 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 71706920 for ; Thu, 13 Sep 2018 10:04:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 602F12A838 for ; Thu, 13 Sep 2018 10:04:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 542632A849; Thu, 13 Sep 2018 10:04:25 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 68CEE2A838 for ; Thu, 13 Sep 2018 10:04:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbeIMPNG (ORCPT ); Thu, 13 Sep 2018 11:13:06 -0400 Received: from mail-eopbgr680088.outbound.protection.outlook.com ([40.107.68.88]:59380 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726741AbeIMPNF (ORCPT ); Thu, 13 Sep 2018 11:13:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UAk5LXlzq9+AgCdMZfkSOmh7f7fgZP0B77FfsqbnVkw=; b=RNJNu2B/m1P7/3XQJhz58A+OEgcO2XV7+svjUr0kr3ZpBNts1R7SSt0asUzHQaa+wNQ6jnBcZtZuq6geU8CYMUpYNZI+EgdSMUL+LuZR/iV0FDjLTTvHxXri60DcQyQK53zXlzqpmHKLFGJD417G+BzmKBPZ8+zHvePdI3k0avU= Received: from BN6PR03CA0096.namprd03.prod.outlook.com (2603:10b6:405:6f::34) by BN6PR03MB3122.namprd03.prod.outlook.com (2603:10b6:405:3c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Thu, 13 Sep 2018 10:04:11 +0000 Received: from BL2FFO11FD015.protection.gbl (2a01:111:f400:7c09::125) by BN6PR03CA0096.outlook.office365.com (2603:10b6:405:6f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.16 via Frontend Transport; Thu, 13 Sep 2018 10:04:11 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; gmx.de; dkim=none (message not signed) header.d=none;gmx.de; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by BL2FFO11FD015.mail.protection.outlook.com (10.173.160.223) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1143.11 via Frontend Transport; Thu, 13 Sep 2018 10:04:11 +0000 Received: from NWD2HUBCAS9.ad.analog.com (nwd2hubcas9.ad.analog.com [10.64.69.109]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id w8DA4BHK013083 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 13 Sep 2018 03:04:11 -0700 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS9.ad.analog.com (10.64.69.109) with Microsoft SMTP Server id 14.3.210.2; Thu, 13 Sep 2018 06:04:11 -0400 Received: from saturn.analog.com ([10.50.1.244]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id w8DA4835032065; Thu, 13 Sep 2018 06:04:08 -0400 From: Alexandru Ardelean To: , , , CC: , , Alexandru Ardelean Subject: [PATCH] staging:iio:ad7606: update api calls to devm_* variants Date: Thu, 13 Sep 2018 12:51:38 +0300 Message-ID: <20180913095138.18427-1-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(376002)(39860400002)(136003)(346002)(2980300002)(438002)(199004)(189003)(50466002)(48376002)(1076002)(4326008)(53416004)(7636002)(305945005)(106466001)(356003)(5660300001)(47776003)(54906003)(107886003)(106002)(110136005)(316002)(6666003)(16586007)(8676002)(186003)(7696005)(51416003)(246002)(336012)(476003)(8936002)(2906002)(50226002)(126002)(486006)(44832011)(77096007)(426003)(2616005)(26005)(86362001)(478600001)(2201001)(36756003)(14444005)(1857600001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR03MB3122;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD015;1:08kECNsddZHTP88N8EJErXUzSyX5iJ6um5LsmA3seUMUEZCIKNa+aWNh0rlnoG2nn4/J33eLb9+Gx4bAtubY2uWG/NKbua2yFCYcmeQrUr6YPhhqJe0bu0FUD+WO5xJC X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1a47a7f-e3aa-45f2-dc27-08d61960410f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BN6PR03MB3122; X-Microsoft-Exchange-Diagnostics: 1;BN6PR03MB3122;3:8rwjlGEPy97qtNt+hx69rMc8z/ZAajxQtElkxZxl+5ggbZXKA6SXXTScRVU0hOp16aKV8TrJY1i9xevwvF/wPa6X4KF6mTBcteAftz5rIJlPANS6DwGjHfTnq5cFPUV4fRM1hdWDPKBr6iSp138RckryExq3ko99WBLs1Ho8Vw+IFBmJVnaNowk8ofrtaVMbOMPUyp38u963zVNqkrpd+hzN2WpXUc5js6yrbJXUTs/FVgxtgtGcANzcOAvqhQk05hLDI2p4MvMtePc+Canm4XSb5fdpIrpz6G2qf260gfYOryGwxxvckHO0hfwjFOncM6Z0rrSguUY4gK2nhb2uMHkpozDStmAKwoxE7ifdrbo=;25:Efxh8O+kX7QNM2ioYhiHIKyZKZVGyrkn9Xg2IsBt+R+AqrR0opBl/ppLwVE+JxuDlph9ZqiX81Or1E9hk6SAox7WuJoZ8QKhLw2VYv4cHGHFM4/f9twTuXgrZ+x2gpPNnSK+S6km0yaL8/ui77K2fNvsEFYfDDQgB6aX8HgitsbXMPFZ2q/ah6FwUgeaW5Ww4cGNfmK9/OaiF+wM0zxjkHJ7KYjgdWx4wmtNGJPEegRDhADnif78+7p5vwS0a8ZGWXjNv9FvfGL6aMsIv8YSvCCIa8xhz9Q2PP2mGUl0WI0q5R1TRgFel139ZWQ2IWv+RoGKFRi7bwbo50aCNmBtuQ== X-MS-TrafficTypeDiagnostic: BN6PR03MB3122: X-Microsoft-Exchange-Diagnostics: 1;BN6PR03MB3122;31:X8khNZDsghj+Cfudf1/u/2JbuOtF5cy2aa4wRw0UUl74j2wY8WGsth8rYG+7vypFx8J8akcr8OkfcXE/TdJ74Shf/RbDfW8HWTSu7f+3HF78oXvKE5Wd+PQr9HZiCrz3d1xUiMHgdeHuTPuq3WYdGts4XJso2dhl6uSXadhDZda0vm8Ox/4Sd6rht4xE2iGn+DKFpY4TdwTlP8nJ9C41iHAaGJg9Et5VeJW31WK3tEo=;20:TSrrGq4lWykyugE9o4Ux4Q21NUJ71zbowK1FWecpjcAcH3m9zb9dXKPWHKYtOLw/8gtmIGSLyjIF9nWCx/mBuGT2WH2xj/OYAGmunuWn7oCmlCrYt6Z3PZ3ArjyYjkQUE0p/gSM3ajxN6yYblvlZOpCPgTQmCzWVjOhCEOT/jjU1M9VZ+Bn67ZlddEdvfqUQU76zQxvcjsorPVwP578lZgFZxa1gHOPP5SojWyNrfpy1z/NVsHzl6OWJgnCDyzorzeGHsm+ElQYf/5UXvjBb3+TL3ikUn5/Ogg/gLpau2q/niULZV8p8irkonjB0sqZvv7OUcXCUal5QUm2U+SFyqDbzaCaH5a83RvMNCVTSkgrxmvL0FyC73KaRjDIPgXzAvROwq5TE9RZ4TfCUB7MRD3R0oRWOctAWeWavzUoajy6XBhPmxyroq6Lko9mQBGDcVldf1pw0Z3V4/pBPxTbY7hbJDfm0kasis6w021vkp/fawVujOY55UbznIFx/T+tZ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(232431446821674); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050);SRVR:BN6PR03MB3122;BCL:0;PCL:0;RULEID:;SRVR:BN6PR03MB3122; X-Microsoft-Exchange-Diagnostics: 1;BN6PR03MB3122;4:5TTauJCTkXS56cmadYDfAnIceMgVyOIXmtt5QQvRRcAhaoS8dAhyuBZt6cQkoIkyqWiAH494i+luPgNHNglJY6FY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C8Qcrp+EgV4y2akFXWwmubbCuiZvLwiqFDsXT01UC6I6unK76oFirqgS2U1JI9UfNhxwJqQlHHj0P8RVnSeJ78nsBN68Fp6azkLgJgAvPlEwRNMV68YYAp06SmhH9sNJWWg==;5:M/GRxE5EViUU948HXJlraOkLVs6ZgBa8UB9HCQr+UueLEL1wMYo0P+kta1jYHj5FZU2BMjXeB+0YAlMCtXJiVr9j7lISqHZC6+ASOdmwiUxM57ZWpryI58ihaaj06ddey4tCs20QbGq92+pwfxvimtVWJQp9bevSDQkCtdVNqJc=;7:SFl73DSUBJ/hzUW1PDbUTdxY+CqA6q1RG7hZqCGsj4nuP6lvQ0zZ5uhTTLluCvU9jZYWHFEgYwdMkfWHGfwgs19m86pIApUpvtkjAsin9cJKohMyNYL48wNL0yDUzIGETmQbCC8vcTEzCfA1rmjdEVZ2orgQYErkjZFb0dAcfCF/PUopcQAIUntFHJrXJC5iAo6EtB2NCngFH56EJ6UrzIMC50o566zHR+8RdvJfIH0IQ7m6PcVTllmHLY74+j3t SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 10:04:11.7680 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f1a47a7f-e3aa-45f2-dc27-08d61960410f X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB3122 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 No significant functional changes. This just replaces the code with devm_* that reduce the driver code, and simplifies some error code paths in the ad7606_probe() function. Signed-off-by: Alexandru Ardelean --- drivers/staging/iio/adc/ad7606.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/staging/iio/adc/ad7606.c b/drivers/staging/iio/adc/ad7606.c index 87d5fb073c95..793de92f27ed 100644 --- a/drivers/staging/iio/adc/ad7606.c +++ b/drivers/staging/iio/adc/ad7606.c @@ -458,28 +458,25 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address, if (ret) dev_warn(st->dev, "failed to RESET: no RESET GPIO specified\n"); - ret = request_irq(irq, ad7606_interrupt, IRQF_TRIGGER_FALLING, name, - indio_dev); + ret = devm_request_irq(dev, irq, ad7606_interrupt, + IRQF_TRIGGER_FALLING, + name, indio_dev); if (ret) goto error_disable_reg; - ret = iio_triggered_buffer_setup(indio_dev, &ad7606_trigger_handler, - NULL, NULL); + ret = devm_iio_triggered_buffer_setup(dev, indio_dev, + &ad7606_trigger_handler, + NULL, NULL); if (ret) - goto error_free_irq; + goto error_disable_reg; - ret = iio_device_register(indio_dev); + ret = devm_iio_device_register(dev, indio_dev); if (ret) - goto error_unregister_ring; + goto error_disable_reg; dev_set_drvdata(dev, indio_dev); return 0; -error_unregister_ring: - iio_triggered_buffer_cleanup(indio_dev); - -error_free_irq: - free_irq(irq, indio_dev); error_disable_reg: regulator_disable(st->reg); @@ -492,10 +489,6 @@ int ad7606_remove(struct device *dev, int irq) struct iio_dev *indio_dev = dev_get_drvdata(dev); struct ad7606_state *st = iio_priv(indio_dev); - iio_device_unregister(indio_dev); - iio_triggered_buffer_cleanup(indio_dev); - - free_irq(irq, indio_dev); regulator_disable(st->reg); return 0;