Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964842AbWC1Xvz (ORCPT ); Tue, 28 Mar 2006 18:51:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964848AbWC1Xvy (ORCPT ); Tue, 28 Mar 2006 18:51:54 -0500 Received: from nommos.sslcatacombnetworking.com ([67.18.224.114]:57405 "EHLO nommos.sslcatacombnetworking.com") by vger.kernel.org with ESMTP id S964842AbWC1Xvy (ORCPT ); Tue, 28 Mar 2006 18:51:54 -0500 In-Reply-To: <20060329014851.0f54da89@inspiron> References: <20060329004122.64e91176@inspiron> <20060329014851.0f54da89@inspiron> Mime-Version: 1.0 (Apple Message framework v746.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit From: Kumar Gala Subject: Re: [PATCH][UPDATE] rtc: Added support for ds1672 control Date: Tue, 28 Mar 2006 17:52:00 -0600 To: Alessandro Zummo X-Mailer: Apple Mail (2.746.3) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - nommos.sslcatacombnetworking.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - kernel.crashing.org X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1143 Lines: 44 On Mar 28, 2006, at 5:48 PM, Alessandro Zummo wrote: > On Tue, 28 Mar 2006 16:55:01 -0600 (CST) > Kumar Gala wrote: > >> +/* following are the sysfs callback functions */ >> +static ssize_t show_control(struct device *dev, struct >> device_attribute *attr, char *buf) >> +{ >> + struct i2c_client *client = to_i2c_client(dev); >> + char *state = "enabled"; >> + u8 control; >> + int err; >> + >> + err = ds1672_get_control(client, &control); >> + if (err) >> + return err; > > shouldn't this be > if (err < 0) > return err; It could be, but doesn't need to. ds1672_get_control either returns 0 (success) or non-zero (-EIO) for failure. >> + /* read control register */ >> + err = ds1672_get_control(client, &control); >> + if (err) { >> + dev_err(&client->dev, "%s: read error\n", __FUNCTION__); >> + goto exit_detach; >> + } > > ditto. ditto. - kumar - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/