From patchwork Mon Sep 24 09:47:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Datta, Shubhrajyoti" X-Patchwork-Id: 186352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-qa0-f56.google.com (mail-qa0-f56.google.com [209.85.216.56]) (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 4AFA92C008F for ; Mon, 24 Sep 2012 19:48:01 +1000 (EST) Received: by qaas11 with SMTP id s11sf1108002qaa.11 for ; Mon, 24 Sep 2012 02:47:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-beenthere:received-spf:from:to:cc:subject:date:message-id :x-mailer:in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=0c0c0mHgrcYV+pgCoc2J74i8Vlz3ox+uD6cnwKnBAg4=; b=JMOsMobwOnbxmnQyueJPYNCjHm7nsXGup6GBvfIRUEOxbU2MYLRXYD9IFW9AUl8RDB ooEC7JcnaKBBTA1yUChY+Z3BrOyd5gGMyNTyXfP3kcXwoCdbb8H7kQ0cHxwkxrgR2YqB /0xRhHE6gv2yhKQaYQOcqwW1ZABbJIqd/y6Uorp7a7DVAajhwf2zsB15QfdSIZBBfTmH oaN+q+HSwjybH7vSZW2pyxQvfnMzdSMqEBI7JGKU16sWJWg0/poQDSORr6JhtI2IMoFA afp4T9QVc0MegxGqP1/mFAUOJNxTSIIuqnI5R7JlD9UysBEUreLKH84opBfFBzR6u40d 2puA== Received: by 10.50.36.194 with SMTP id s2mr1917392igj.2.1348480078677; Mon, 24 Sep 2012 02:47:58 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.231.65.137 with SMTP id j9ls2196063ibi.7.gmail; Mon, 24 Sep 2012 02:47:58 -0700 (PDT) Received: by 10.42.80.3 with SMTP id t3mr4855635ick.24.1348480078103; Mon, 24 Sep 2012 02:47:58 -0700 (PDT) Received: by 10.42.80.3 with SMTP id t3mr4855634ick.24.1348480078094; Mon, 24 Sep 2012 02:47:58 -0700 (PDT) Received: from devils.ext.ti.com (devils.ext.ti.com. [198.47.26.153]) by gmr-mx.google.com with ESMTPS id cu8si1369193igc.1.2012.09.24.02.47.57 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Sep 2012 02:47:57 -0700 (PDT) Received-SPF: pass (google.com: domain of shubhrajyoti@ti.com designates 198.47.26.153 as permitted sender) client-ip=198.47.26.153; Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8O9ltg7012575; Mon, 24 Sep 2012 04:47:56 -0500 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8O9lqTr009803; Mon, 24 Sep 2012 15:17:53 +0530 (IST) Received: from dbdp33.itg.ti.com (172.24.170.252) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Mon, 24 Sep 2012 15:17:52 +0530 Received: from ula0393217.india.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp33.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8O9lmmH014192; Mon, 24 Sep 2012 15:17:51 +0530 From: Shubhrajyoti D To: CC: , , , Shubhrajyoti D Subject: [rtc-linux] [PATCHv2 1/7] rtc: Convert struct i2c_msg initialization to C99 format Date: Mon, 24 Sep 2012 15:17:40 +0530 Message-ID: <1348480066-3132-2-git-send-email-shubhrajyoti@ti.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1348480066-3132-1-git-send-email-shubhrajyoti@ti.com> References: <1348480066-3132-1-git-send-email-shubhrajyoti@ti.com> MIME-Version: 1.0 X-Original-Sender: shubhrajyoti@ti.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of shubhrajyoti@ti.com designates 198.47.26.153 as permitted sender) smtp.mail=shubhrajyoti@ti.com 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: , Convert the struct i2c_msg initialization to C99 format. This makes maintaining and editing the code simpler. Also helps once other fields like transferred are added in future. Signed-off-by: Shubhrajyoti D --- drivers/rtc/rtc-ds1672.c | 26 ++++++++++++++++++++++---- 1 files changed, 22 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-ds1672.c b/drivers/rtc/rtc-ds1672.c index 7fa67d0..577dbae 100644 --- a/drivers/rtc/rtc-ds1672.c +++ b/drivers/rtc/rtc-ds1672.c @@ -37,8 +37,17 @@ static int ds1672_get_datetime(struct i2c_client *client, struct rtc_time *tm) unsigned char buf[4]; struct i2c_msg msgs[] = { - {client->addr, 0, 1, &addr}, /* setup read ptr */ - {client->addr, I2C_M_RD, 4, buf}, /* read date */ + {/* setup read ptr */ + .addr = client->addr, + .len = 1, + .buf = &addr + }, + {/* setup read ptr */ + .addr = client->addr, + .flags = I2C_M_RD, + .len = 4, + .buf = buf + }, }; /* read date registers */ @@ -99,8 +108,17 @@ static int ds1672_get_control(struct i2c_client *client, u8 *status) unsigned char addr = DS1672_REG_CONTROL; struct i2c_msg msgs[] = { - {client->addr, 0, 1, &addr}, /* setup read ptr */ - {client->addr, I2C_M_RD, 1, status}, /* read control */ + {/* setup read ptr */ + .addr = client->addr, + .len = 1, + .buf = &addr + }, + {/* read control */ + .addr = client->addr, + .flags = I2C_M_RD, + .len = 1, + .buf = status + }, }; /* read control register */