From patchwork Fri Jul 27 06:42:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10546643 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 1E4B2180E for ; Fri, 27 Jul 2018 06:43:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1121F2B32B for ; Fri, 27 Jul 2018 06:43:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04A732B325; Fri, 27 Jul 2018 06:43:13 +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 62F3C2B325 for ; Fri, 27 Jul 2018 06:43:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725983AbeG0IDe (ORCPT ); Fri, 27 Jul 2018 04:03:34 -0400 Received: from mail-eopbgr680080.outbound.protection.outlook.com ([40.107.68.80]:13689 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725861AbeG0IDd (ORCPT ); Fri, 27 Jul 2018 04:03:33 -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=mgaHmcju60xVQpynVrizMVSoTRy/cVSji1ELSzpSF50=; b=u0EurvbiBicK/I0GAb7WZIEYlv+e5S965q3DkfWSPRdDM1VJGJeVpey5yE0CwSM7E05ShgpBL1lc7FBUvN0K2HxrnMGeKQDwBC11pchalFgwp1IrwEV9LswTpuQVeDJPq6D7K6hu5wbJ6lhnAmulOjB+ObxGXPIXJQQ3AQEogMU= Received: from BN3PR03CA0088.namprd03.prod.outlook.com (2a01:111:e400:7a4d::48) by CY4PR03MB3126.namprd03.prod.outlook.com (2603:10b6:910:53::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.16; Fri, 27 Jul 2018 06:43:07 +0000 Received: from BN1AFFO11FD006.protection.gbl (2a01:111:f400:7c10::183) by BN3PR03CA0088.outlook.office365.com (2a01:111:e400:7a4d::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.16 via Frontend Transport; Fri, 27 Jul 2018 06:43:00 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.57) smtp.mailfrom=analog.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.57 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.57; helo=nwd2mta4.analog.com; Received: from nwd2mta4.analog.com (137.71.25.57) by BN1AFFO11FD006.mail.protection.outlook.com (10.58.52.66) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.995.16 via Frontend Transport; Fri, 27 Jul 2018 06:43:00 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta4.analog.com (8.13.8/8.13.8) with ESMTP id w6R6h0n3022864 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK); Thu, 26 Jul 2018 23:43:00 -0700 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.301.0; Fri, 27 Jul 2018 02:43:00 -0400 Received: from saturn.analog.com ([10.50.1.244]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id w6R6gvpp003997; Fri, 27 Jul 2018 02:42:57 -0400 From: Alexandru Ardelean To: , , , CC: Alexandru Ardelean Subject: [PATCH] iio: ad9523: Fix return value for ad952x_store() Date: Fri, 27 Jul 2018 09:42:45 +0300 Message-ID: <20180727064245.7954-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.57;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39840400004)(136003)(396003)(376002)(346002)(2980300002)(438002)(199004)(189003)(246002)(8936002)(2906002)(5660300001)(51416003)(7696005)(36756003)(106466001)(110136005)(50226002)(53416004)(486006)(6666003)(8676002)(316002)(106002)(16586007)(47776003)(44832011)(48376002)(14444005)(336012)(476003)(126002)(2616005)(426003)(478600001)(107886003)(4326008)(50466002)(1076002)(305945005)(7636002)(86362001)(2201001)(356003)(186003)(26005)(77096007)(1857600001)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR03MB3126;H:nwd2mta4.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail11.analog.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD006;1:98AJOJF674pdOLudv49pnfvUUg892PLh5PfY5FCcqbERJ89jPo3uZBsUkEt9IBSdLd18FzRqQgRyTeAYGpFVqYrF//7/aVS7b9ZNxyqECqzguoLkq8nOChLLkqxcC4ro X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0792f53a-2dfb-4e6b-1310-08d5f38c3251 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:CY4PR03MB3126; X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB3126;3:J3tWvuICxVgeAbaQ5kCOw83Pe3Ohdal8WstJsvr3YxjOeKvDZYIqD9s1+DrV7028pjWrWkHLeMo23+KtJXrhlEIQT/wVtQu2LXRIiU4ZSl65UxaFIb97kdSIDfh0WdGcDZW+o8DOtpWzg2ORE/xGnjq7wM7Gvdx5X0E0h4cr2u1jnpqiGiA2VCefP0kJk7H72hpQiiQV1wPPmxssRlE8jzR4VHlmpOgasNbGLSFBBa7hkxtKHh45+CysdvR8bFIjxlcJ++ykmg1URM5BXFpdQp8qhEvD29F2GFmWE6Em466aqf0aGVtp2Ruvv+XJdyIkORUKf5pzVIaIRhUKRZ9MdjkL14mXQAXO4XDJpcgNpmk=;25:WQ2d/7hj3Crd7ta2FzhrT7vAsKjQB5SBKx2T64ZXiFHs2S3sCPrzLewuj36g+z01PzARm6fssozlkyvP9hfh6sI0eHgEwhpmX6Xd7uJwSSVJ0tfFOS7fgueDoH8DopBQiDIPr7pT9CgiJhVpMsFVJ1+CyevG6Db2Ba1rKdHl8sZvMBPqOAaASD6mtJ4E6Z4TUFyfnyGvA5LG3wW5fuepmzW1OKMf+9KlEicZbnUNdDbluqoKmgtV4t0x4a63UEUHQNqobzvq3cPW/s86g0/rEcEvgKLAJ/b76T7RrNbayJ3FzxRVbze92PLvZIy4pIBpnz0UM7CUXOdSOCth3bwfcQ== X-MS-TrafficTypeDiagnostic: CY4PR03MB3126: X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB3126;31:/IkF3he4+9NZZxG7r4CKkUimH+leJTNI7XHotDmPlSmUdfvPCpDp3f4RO1yDNoD7NbiulhjAEy/ROo0bra/w3JQRVJvd8xuYbGzDsPW02A6qY4LHuANO65nUq48TXoBVvoZtElPSj1zt17F6qHrIUoGuke+4KCIUbm7cwNDMqUzWcwA5ASpA319TRmzLyt0Fa542zD3f1hNPRpnosProvi3Scnd1AqyP2STFDtmoatk=;20:TL+iVCkn/SRKolrJ1/u3HUbdYq4Zb5MRZTUDTJ+hpPZ5//w9dbZbcp9TNWpP4DEZD7clhGPz9h5jE2i1L/XNZzey2+ecY+GOpjdVKo+8N7H48LFC+F3HI//VXvtjNtdd7OsJ510gPiQUHVZlBLqBGVnniNYCmUmFO+Efb+as2Ui4phe+XIaiDMr0/nkM4wA/lPpRTTj7KiFRnY4WFVQeLAri5RD96wWXSTNgFLLvJPT2ZMAebuBelz+xxXMc+YRm+F+BOxAvm8UP6nQAyyDiX8hRxPP/uH7H3DMao8z8FaJKF8budWY8CZmsPUVhn9wgbEKSIEvcBBFALLrmSzFrgixUO1xhEnWoOL7bKG3aEi8MA0RizFDD2QaiJ1z7+AguhHuIMXE3GNlMr+z1jmckdRwr2iPonmlyR5xy6AGfiUnVB+cOjRTRsreVD0OJl8lzbd9beMLk/vO3/iFItnRl0mMgqMhz1bas1bdA+Xc5A3pyRMMLIS9niQv+uLWoBL47 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)(10201501046)(3002001)(93006095)(93004095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:CY4PR03MB3126;BCL:0;PCL:0;RULEID:;SRVR:CY4PR03MB3126; X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB3126;4:doYfinQfpIdY8a0fQ5qrq68sbQKc9xGPoTr0QjWnlsdBF1kQ8U+Cq0yK9Ooy8Cv36WNaLMj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A4Ah98LdDSnxsrkb+GA768vVlCwLQ5YHUPsXVqLWox3RuroxHtCHGp2UrOR/2lP5XS67NylWbOaN9lUBM90N3+0prjSNxmCXdlE8CtTWp3ofBKxQHr3YDNJi5YH9ySi39wbRuwLUnvp8LE4ubVQPAVh8B0FQ2w==;5:wrLNEMmJnztR9BRfIs8hm313IsT7GKDKRpQDtAtJ+QCIvYBDvzKhRp1KEm/BKEc+pHztTYglt0iIjvoNoXbBUcoMEA9i/AaC55YAEehOnJjJK13qCsAbylb4vzZtciXMT8tTSMxS27GxeuOZWOFuNQ1k2oRccmamfJ6LNoHdxpE=;7:n3lPvW+ffDMnx8pPyqZJdKUrF37J4ulVzRd/uh1EFMJ7mGIZF4WY0Q5AY8C9chdlArInYyRQLg/DO7CS66y2SsOR2+X2ByKh+5FE3d/lk8dHjM/aqsZp0H/q6f4oOwLg1RK14hvaIx1nVFo0NA/DJXAFrrORpJ9xefbRPVZkSD65YxSqYuhGN59h6LbfHCuBwiVAMQQ0Ir6ulbmm57WxAT09oWWHdVr+hZSdGtSZxQvqDxHnvvhgpbey8eGrg2mX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2018 06:43:00.6845 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0792f53a-2dfb-4e6b-1310-08d5f38c3251 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.57];Helo=[nwd2mta4.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB3126 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 From: Lars-Peter Clausen A sysfs write callback function needs to either return the number of consumed characters or an error. The ad952x_store() function currently returns 0 if the input value was "0", this will signal that no characters have been consumed and the function will be called repeatedly in a loop indefinitely. Fix this by returning number of supplied characters to indicate that the whole input string has been consumed. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/iio/frequency/ad9523.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/frequency/ad9523.c b/drivers/iio/frequency/ad9523.c index 37504739c277..059b2fda8cbd 100644 --- a/drivers/iio/frequency/ad9523.c +++ b/drivers/iio/frequency/ad9523.c @@ -518,7 +518,7 @@ static ssize_t ad9523_store(struct device *dev, return ret; if (!state) - return 0; + return len; mutex_lock(&st->lock); switch ((u32)this_attr->address) {