From patchwork Mon Sep 17 13:58:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Datta, Shubhrajyoti" X-Patchwork-Id: 184410 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-gh0-f184.google.com (mail-gh0-f184.google.com [209.85.160.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 697222C008A for ; Mon, 17 Sep 2012 23:58:28 +1000 (EST) Received: by ghbf11 with SMTP id f11sf3459107ghb.11 for ; Mon, 17 Sep 2012 06:58:25 -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=tTgxS149ZlcmbrqFxWIwUc8ufvqiBT/uX1FNy2O9cM0=; b=esjkDSKC2EajIec9Oe3gLP6Mtg0QIKOejSF3B7A+zwLWoCIk+kALMUf1fmnV6Eg1fM T3Ih+f01HRYg/X/Yf79nQkwPFAn+ALIiZ842ntKQkXqhHb90Z5XbWaFW13bGN8ZlA2TZ j9zbdKh0yTtZb+dqFN0pmllWo94GG1JNxNN3nhyGYxN4h2ljW8FQDGuUZPCQIHXwCWCO oAVPNhZQBnZhiNHQhnw4j7aJhXfhMP7qOZObim7LN0vVHLp6cO0sz+uO0AW1slKmbWj7 q82L5ToQ4wgOkm/fku5dNMFfdQzPYE7H65S+ByMCooYUvcNmygDZIJuvK6Qk90ndyyxj 8HJA== Received: by 10.50.157.225 with SMTP id wp1mr3054030igb.0.1347890304873; Mon, 17 Sep 2012 06:58:24 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.231.55.155 with SMTP id u27ls14369614ibg.8.gmail; Mon, 17 Sep 2012 06:58:24 -0700 (PDT) Received: by 10.50.85.136 with SMTP id h8mr5073885igz.0.1347890304425; Mon, 17 Sep 2012 06:58:24 -0700 (PDT) Received: by 10.50.85.136 with SMTP id h8mr5073884igz.0.1347890304414; Mon, 17 Sep 2012 06:58:24 -0700 (PDT) Received: from bear.ext.ti.com (bear.ext.ti.com. [192.94.94.41]) by gmr-mx.google.com with ESMTPS id vb5si2598117igb.0.2012.09.17.06.58.24 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 06:58:24 -0700 (PDT) Received-SPF: pass (google.com: domain of shubhrajyoti@ti.com designates 192.94.94.41 as permitted sender) client-ip=192.94.94.41; Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8HDwMeb005549; Mon, 17 Sep 2012 08:58:23 -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 q8HDwJtU026482; Mon, 17 Sep 2012 19:28:21 +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; Mon, 17 Sep 2012 19:28:19 +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 q8HDwGag005802; Mon, 17 Sep 2012 19:28:19 +0530 From: Shubhrajyoti D To: CC: , , Shubhrajyoti D Subject: [rtc-linux] [PATCH 1/7] rtc: Convert struct i2c_msg initialization to C99 format Date: Mon, 17 Sep 2012 19:28:08 +0530 Message-ID: <1347890294-28467-2-git-send-email-shubhrajyoti@ti.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1347890294-28467-1-git-send-email-shubhrajyoti@ti.com> References: <1347890294-28467-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 192.94.94.41 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..b44b2a1 100644 --- a/drivers/rtc/rtc-ds1672.c +++ b/drivers/rtc/rtc-ds1672.c @@ -37,8 +37,18 @@ 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 */ + { + .addr = client->addr, + .flags = 0, + .len = 1, + .buf = &addr + }, /* setup read ptr */ + { + .addr = client->addr, + .flags = I2C_M_RD, + .len = 4, + .buf = buf + }, /* read date */ }; /* read date registers */ @@ -99,8 +109,16 @@ 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 */ + { .addr = client->addr, + .flags = 0, + .len = 1, + .buf = &addr + }, /* setup read ptr */ + { .addr = client->addr, + .flags = I2C_M_RD, + .len = 1, + .buf = status + }, /* read control */ }; /* read control register */