From patchwork Tue Sep 25 10:33:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Datta, Shubhrajyoti" X-Patchwork-Id: 186763 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 343E32C0093 for ; Tue, 25 Sep 2012 20:33:56 +1000 (EST) Received: by vcqp16 with SMTP id p16sf5592346vcq.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=0c0c0mHgrcYV+pgCoc2J74i8Vlz3ox+uD6cnwKnBAg4=; b=aXg1ZB9IUVYloudE1JDimfjnaLNXrTlIk4t7AVgCNaSYn73xC95WKxSagYJ7HUeIiv SEkLhWv06fCWWP0mAE5eMvR8w/FWbgfcHUBjMMyo7H37n48jNhwIfc/4MVDtWl1FwYyW q0W5YgK1iYedP/9DLxogAKTwKKDxpNDcP4rSbW2SOEw7WuftOncNrLNeJedYbNV2+zWf wx1C1e05R9Sp7SZCZ+YNU3OrdOoijxmY0htw3+4XekjWowOSkz6RVLVolzu/472gUhAw 4AWE+fS75MWVTfdo/ikfUu870Yiw9KlxRUri3/ko5DRCSmBwiyvh5MesigzOFgq+Xkao mxQQ== Received: by 10.50.12.199 with SMTP id a7mr3916995igc.2.1348569233906; Tue, 25 Sep 2012 03:33:53 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.50.214.34 with SMTP id nx2ls5272666igc.1.gmail; Tue, 25 Sep 2012 03:33:53 -0700 (PDT) Received: by 10.50.153.199 with SMTP id vi7mr3899806igb.0.1348569233423; Tue, 25 Sep 2012 03:33:53 -0700 (PDT) Received: by 10.50.153.199 with SMTP id vi7mr3899805igb.0.1348569233414; Tue, 25 Sep 2012 03:33:53 -0700 (PDT) Received: from devils.ext.ti.com (devils.ext.ti.com. [198.47.26.153]) by gmr-mx.google.com with ESMTPS id i2si869703igl.1.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 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 q8PAXpLV001128; Tue, 25 Sep 2012 05:33:52 -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 q8PAXn07000863; Tue, 25 Sep 2012 16:03:49 +0530 (IST) Received: from dbdp33.itg.ti.com (172.24.170.252) by DBDE71.ent.ti.com (172.24.170.149) 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 q8PAXkDk021365; Tue, 25 Sep 2012 16:03:49 +0530 From: Shubhrajyoti D To: CC: , , , Shubhrajyoti D Subject: [rtc-linux] [PATCHv2 1/7] rtc: Convert struct i2c_msg initialization to C99 format Date: Tue, 25 Sep 2012 16:03:38 +0530 Message-ID: <1348569224-4096-2-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 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 */