From patchwork Tue Sep 25 11:32:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Datta, Shubhrajyoti" X-Patchwork-Id: 186783 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-gg0-f184.google.com (mail-gg0-f184.google.com [209.85.161.184]) (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 252952C0091 for ; Tue, 25 Sep 2012 21:32:21 +1000 (EST) Received: by ggmo2 with SMTP id o2sf5691579ggm.11 for ; Tue, 25 Sep 2012 04:32:19 -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=oAG9P68mVC/tYWxWBFjkAJvoap5EiehSgRZ4DGlr3FQ=; b=FYFXHLDmkDt9gjxi2bSjgsBeKkpCQhDHSp0/7IVdXlnBhu556jWKDh7SmVdKgJWWet IdtDGdZJKjVZ0F1I2Wx64nlwyPQM8vL3F6ytIqmsOuufRLTIdsLOLjtURhM1k1i4ycLp XoxhAbzi7XTGUHrSAuB4QX1vEjhmJg9gVTjQbadfqSndUcYZ4VEeaeF53FVKWXfplor4 jWyUuZZSwsITCuEm8ZL4wLeCTqbSXkNsFkwMxu/WiBWHUx8XPXHgLmsIilSLFNc3JNtW 34vUfze+0Ne5CDEEPDvSjOO+0R+6whfKCylh9Ru96mbFq1H0Bq52QQiJjHZpEoLMHxq+ 0w5g== Received: by 10.50.212.35 with SMTP id nh3mr4008950igc.1.1348572739363; Tue, 25 Sep 2012 04:32:19 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.231.65.137 with SMTP id j9ls37811ibi.7.gmail; Tue, 25 Sep 2012 04:32:18 -0700 (PDT) Received: by 10.42.81.74 with SMTP id y10mr6133718ick.8.1348572738930; Tue, 25 Sep 2012 04:32:18 -0700 (PDT) Received: by 10.42.81.74 with SMTP id y10mr6133717ick.8.1348572738917; Tue, 25 Sep 2012 04:32:18 -0700 (PDT) Received: from devils.ext.ti.com (devils.ext.ti.com. [198.47.26.153]) by gmr-mx.google.com with ESMTPS id ba5si1318073igb.3.2012.09.25.04.32.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Sep 2012 04:32:18 -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 q8PBWGTu006299; Tue, 25 Sep 2012 06:32:17 -0500 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8PBWDMM015632; Tue, 25 Sep 2012 17:02:14 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Tue, 25 Sep 2012 17:02:13 +0530 Received: from ula0393217.india.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8PBW8pW015322; Tue, 25 Sep 2012 17:02:13 +0530 From: Shubhrajyoti D To: CC: , , , , Shubhrajyoti D Subject: [rtc-linux] [PATCHv3 1/7] rtc: Convert struct i2c_msg initialization to C99 format Date: Tue, 25 Sep 2012 17:02:00 +0530 Message-ID: <1348572726-6940-2-git-send-email-shubhrajyoti@ti.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1348572726-6940-1-git-send-email-shubhrajyoti@ti.com> References: <1348572726-6940-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 + }, + {/* read date */ + .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 */