From patchwork Fri Sep 6 11:33:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 273155 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-yh0-x23a.google.com (mail-yh0-x23a.google.com [IPv6:2607:f8b0:4002:c01::23a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 0F0912C00F9 for ; Fri, 6 Sep 2013 21:51:44 +1000 (EST) Received: by mail-yh0-f58.google.com with SMTP id a41sf688191yho.13 for ; Fri, 06 Sep 2013 04:51:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe:content-type; bh=rycOdvcVE3JL2oo2gYNBawJE5mLyxT6OJ4Yix0sFPRI=; b=a/crMmmuhVWKv0G8tdy8WIJVu1UUDzTD6Y+Q1PZXik6oCJqcsOoMC6WcV+eroCWrAs OQhRNIA4b1KSeObOWOsfJK33+o5S1HBZWCbV4bcnYKsyNyElNEPmSuXbZ57ZyABBBNlC sOkm1/wrFmNZZlvjITdnfIs7j8QfiyZNa+abZWzuFf7sfRVc6LQt39VVWtlt/4wB/m+v wN2zTXCTUs1/Mr/fSU0qreL0LDIAJ0FKpkKWnJkD91N/eB7iXuScKQs8jJNPYv6dUqtF EKCSUfN8yCBuXjEyH0heZ4JM6KsTZLd5GVXy3k5Ql/U7nN9sppm/iZ3LBf8KxkXj8ntg kZ3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=rycOdvcVE3JL2oo2gYNBawJE5mLyxT6OJ4Yix0sFPRI=; b=FGL2DD6qKASbyqUZYFavcygTF8Q0+pNZ3dzHEYtD69fDv864vyOtEk6S2BLp0DMPWY dd1GklQpX9TLDqjhQnyBtHVNQmFDgBNcCBT6tDxiNdLoh6oVIe0YKmsNo+3uACLZQxtq UB0HTGb37oRm9ATOGnCDDgi22Sjz8UWBOEUok68FVtxKNNl7xAl6HLj/iPv6/2IC99tf r6OWzOQxn/R+4Ac71X3Ue4/Oi7W5n6+C7v9DnafraNM4JFoSBPZ3vODsI5zSRAWFw5ps ykZvql+h1MRDkO/1mdxieXQMpRsQhb0sHRpltVOE9uZ1XlOQpy501qlnggUHrisITjR3 mp5w== X-Received: by 10.50.27.37 with SMTP id q5mr97490igg.9.1378468302258; Fri, 06 Sep 2013 04:51:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.50.43.232 with SMTP id z8ls441270igl.32.canary; Fri, 06 Sep 2013 04:51:41 -0700 (PDT) X-Received: by 10.68.137.163 with SMTP id qj3mr682239pbb.4.1378468301775; Fri, 06 Sep 2013 04:51:41 -0700 (PDT) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by gmr-mx.google.com with ESMTPS id dk16si452728pac.0.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Sep 2013 04:51:41 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.174 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.192.174; Received: by mail-pd0-f174.google.com with SMTP id y13so3180165pdi.33 for ; Fri, 06 Sep 2013 04:51:41 -0700 (PDT) X-Gm-Message-State: ALoCoQlgV9P3qoonj0mrx+sBteFQEBMMwIpk/oTs8ibOOEiehTIYhZIByV3D5FSRRhCQXjfZPtTc X-Received: by 10.68.88.161 with SMTP id bh1mr1501727pbb.200.1378468301683; Fri, 06 Sep 2013 04:51:41 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id q1sm3323153pbd.12.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Sep 2013 04:51:41 -0700 (PDT) From: Sachin Kamat To: rtc-linux@googlegroups.com Cc: a.zummo@towertech.it, akpm@linux-foundation.org, sachin.kamat@linaro.org Subject: [rtc-linux] [PATCH 03/10] drivers/rtc/rtc-max6900.c: Remove redundant checks Date: Fri, 6 Sep 2013 17:03:36 +0530 Message-Id: <1378467223-26231-3-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1378467223-26231-1-git-send-email-sachin.kamat@linaro.org> References: <1378467223-26231-1-git-send-email-sachin.kamat@linaro.org> X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.192.174 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , i2c_smbus_write_byte_data() returns negative errno on failure or 0 on success. Return the value obtained from it directly. Signed-off-by: Sachin Kamat --- drivers/rtc/rtc-max6900.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/rtc/rtc-max6900.c b/drivers/rtc/rtc-max6900.c index 55969b1..4804985 100644 --- a/drivers/rtc/rtc-max6900.c +++ b/drivers/rtc/rtc-max6900.c @@ -164,14 +164,7 @@ static int max6900_i2c_read_time(struct i2c_client *client, struct rtc_time *tm) static int max6900_i2c_clear_write_protect(struct i2c_client *client) { - int rc; - rc = i2c_smbus_write_byte_data(client, MAX6900_REG_CONTROL_WRITE, 0); - if (rc < 0) { - dev_err(&client->dev, "%s: control register write failed\n", - __func__); - return -EIO; - } - return 0; + return i2c_smbus_write_byte_data(client, MAX6900_REG_CONTROL_WRITE, 0); } static int