From patchwork Thu Sep 20 13:42:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Qiang X-Patchwork-Id: 10607773 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 C84EE14DA for ; Thu, 20 Sep 2018 13:42:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7B4D2D70B for ; Thu, 20 Sep 2018 13:42:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB73B2D732; Thu, 20 Sep 2018 13:42:26 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 433C02D70B for ; Thu, 20 Sep 2018 13:42:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732747AbeITTZ6 (ORCPT ); Thu, 20 Sep 2018 15:25:58 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34646 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732496AbeITTZ6 (ORCPT ); Thu, 20 Sep 2018 15:25:58 -0400 Received: by mail-pf1-f196.google.com with SMTP id k19-v6so4411031pfi.1; Thu, 20 Sep 2018 06:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=o6m+8LaU0HanMrlulsKdznSgYYutZpKM4WVXP+Nd1nY=; b=i3HBnFi0zN/3e370Nh8Ft1bVHz975m7JDe8dv2AJanYLnHz6Yr4rF6uBaI7KBLa6we fmMqbFxaIn0vIonhmbViybNENUFqeWbUHAcuTzt+G3G74Mlw90dLdDBXp6C17/sEK9Tc 5cQ+uMjH0xC81VLozEzQOKTrfkiyoAa7BC4dUdBJS5DT3XZLjEE3npQSZxyV7rBcMnlt NI3/+mWCvF0n+hLDxkPsagG57hWRs1FckD2qkC9YkFuWCdJYTFJTffJWv33x02CUDN4e QVaEHodj4QiAwWwqzSJmSF+bbsRis5vNQxQ8IuBz8QN8bMPu2pTDY6f+dPLzDxMNt6vg rcmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=o6m+8LaU0HanMrlulsKdznSgYYutZpKM4WVXP+Nd1nY=; b=J8c8bnJC4fPo+xJXjfNbhubvSFrNemnMyMfcdGV8DkBfjLBgJV6nY2VDElikSleTXZ WMgY82QKfOs4jIqLHL76ywKFwKuzRBS2x1UuaYk84uuM6uU9f5LhLSFXSxlrDOJUq8y6 +RwlHsYmxkvjguOmCf55IbVZPmm0y07P/W3srXiPE4v5NGTB6MNV9BxX0XKF08vhANOp O6o4yCv2kDV2YU+njR8SQ2HMVtYOcQLIII7eHB0lCdSI7Unq6a9HXwfRN+p4tL8cJ7zR 6sKH7qrRdAp5JD7+Q7zZ+edVsbl68Nax8G12PXjyBI7HHVc8/4ycXRm6ViQh5qYWfYsk 0AoA== X-Gm-Message-State: APzg51D3GqaUdvCBsb5A1ISZaojb5NhaC7KeLatQbUpLFpoPPq6qqgU6 JG3TyPR2sJL5MYERjL259RQ= X-Google-Smtp-Source: ANB0VdYNiBQPtUPIu19Y7Bhd97e4BsH9EUAafAJJ64HrKR136BhZMMseZv4GhR0BtBU9QnHwbQlHQg== X-Received: by 2002:a62:6b41:: with SMTP id g62-v6mr6149017pfc.113.1537450944991; Thu, 20 Sep 2018 06:42:24 -0700 (PDT) Received: from localhost (104.176.229.35.bc.googleusercontent.com. [35.229.176.104]) by smtp.gmail.com with ESMTPSA id 8-v6sm28238994pgu.10.2018.09.20.06.42.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 06:42:24 -0700 (PDT) From: Song Qiang To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, shubhrajyoti@ti.com Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Song Qiang Subject: [PATCH] iio: magnetometer: hmc5843: Replace a return value. Date: Thu, 20 Sep 2018 21:42:19 +0800 Message-Id: <20180920134219.8402-1-songqiang1304521@gmail.com> X-Mailer: git-send-email 2.17.1 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 This error apparently is caused by timed out event, so a -ETIMEDOUT should be used instead of a -EIO, and it also tells user what happened , so this dev_err may not be needed anymore. Signed-off-by: Song Qiang --- I used ./scripts/get_maintainer.pl to get maintainers about this file, I thought this script searches maintainers with looking up MAINTAINER, is that right? So I searched MAINTAINER and also found nothing related to hmc5843. In the declearation area I can see Shubhrajyoti Datta wroted this driver and several other people including Peter Meerwald have contributed. Is this driver now a orphan? Or if it is, I think we may also need to add it to the MAINTAINER file. I'm also familiar with this device, I think I can add interrupt support later. drivers/iio/magnetometer/hmc5843_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/magnetometer/hmc5843_core.c b/drivers/iio/magnetometer/hmc5843_core.c index ada142fb7aa3..4fb393c3854c 100644 --- a/drivers/iio/magnetometer/hmc5843_core.c +++ b/drivers/iio/magnetometer/hmc5843_core.c @@ -170,8 +170,7 @@ static int hmc5843_wait_measurement(struct hmc5843_data *data) } if (tries < 0) { - dev_err(data->dev, "data not ready\n"); - return -EIO; + return -ETIMEDOUT; } return 0;