From patchwork Tue Sep 25 10:33:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Datta, Shubhrajyoti" X-Patchwork-Id: 186762 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-vc0-f184.google.com (mail-vc0-f184.google.com [209.85.220.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 3821C2C0094 for ; Tue, 25 Sep 2012 20:33:56 +1000 (EST) Received: by vcqp16 with SMTP id p16sf5592348vcq.11 for ; Tue, 25 Sep 2012 03:33:54 -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=OwwqtaPCxVXUvb1URtVd7yIHFhAJMSZjZQyePQtY08I=; b=L/IKMPHiG7TDUgE2KIuhtKkqV/qtrepvoUV+H5nR8CgWFLHkVZ38BKQNOXDbDI90mX HAKLd5IPZdb2nvq8XTayEncN6gEt3/te6yElzqs8Q6ns6z5RX8XUa1ceruarjy8WsHnF Ti7gfACJBhkdMcyi23KRNQTgzl8OrEGmVMjcJ5nRRXAAoQnifEDxLF4mNROnG1fE4v4R QCLmb5BNXsiSZeSDIfR5vGJ4HdE44/6RpmWdQh98uaajmtO15QGjpnpELdUOt61le7UT UVyOhRT2XWTC6XNRDN88D1fW5VOs1tS0suGq5POjWABrCqejqcZ1XhLd9L+VDk7rxxX8 D9uQ== Received: by 10.50.34.169 with SMTP id a9mr3911247igj.6.1348569234015; Tue, 25 Sep 2012 03:33:54 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.231.62.200 with SMTP id y8ls4675314ibh.5.gmail; Tue, 25 Sep 2012 03:33:53 -0700 (PDT) Received: by 10.50.171.102 with SMTP id at6mr4249614igc.1.1348569233686; Tue, 25 Sep 2012 03:33:53 -0700 (PDT) Received: by 10.50.171.102 with SMTP id at6mr4249613igc.1.1348569233676; Tue, 25 Sep 2012 03:33:53 -0700 (PDT) Received: from bear.ext.ti.com (bear.ext.ti.com. [192.94.94.41]) by gmr-mx.google.com with ESMTPS id s9si1826405igw.0.2012.09.25.03.33.53 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Sep 2012 03:33:53 -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 q8PAXpJh018253; Tue, 25 Sep 2012 05:33:52 -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 q8PAXnKf000861; Tue, 25 Sep 2012 16:03:51 +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; Tue, 25 Sep 2012 16:03:49 +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 q8PAXkDp021365; Tue, 25 Sep 2012 16:03:49 +0530 From: Shubhrajyoti D To: CC: , , , Shubhrajyoti D Subject: [rtc-linux] [PATCHv2 6/7] rtc: Convert struct i2c_msg initialization to C99 format Date: Tue, 25 Sep 2012 16:03:43 +0530 Message-ID: <1348569224-4096-7-git-send-email-shubhrajyoti@ti.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1348569224-4096-1-git-send-email-shubhrajyoti@ti.com> References: <1348569224-4096-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-isl1208.c | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c index 0ea86ac..26c81f2 100644 --- a/drivers/rtc/rtc-isl1208.c +++ b/drivers/rtc/rtc-isl1208.c @@ -68,9 +68,17 @@ isl1208_i2c_read_regs(struct i2c_client *client, u8 reg, u8 buf[], { u8 reg_addr[1] = { reg }; struct i2c_msg msgs[2] = { - {client->addr, 0, sizeof(reg_addr), reg_addr} - , - {client->addr, I2C_M_RD, len, buf} + { + .addr = client->addr, + .len = sizeof(reg_addr), + .buf = reg_addr + }, + { + .addr = client->addr, + .flags = I2C_M_RD, + .len = len, + .buf = buf + } }; int ret; @@ -90,7 +98,11 @@ isl1208_i2c_set_regs(struct i2c_client *client, u8 reg, u8 const buf[], { u8 i2c_buf[ISL1208_REG_USR2 + 2]; struct i2c_msg msgs[1] = { - {client->addr, 0, len + 1, i2c_buf} + { + .addr = client->addr, + .len = len + 1, + .buf = i2c_buf + } }; int ret;