Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754167Ab2KUJnV (ORCPT ); Wed, 21 Nov 2012 04:43:21 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:31358 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751937Ab2KUJnQ (ORCPT ); Wed, 21 Nov 2012 04:43:16 -0500 X-AuditID: cbfee61a-b7fa66d0000004cf-bd-50aca233ad05 From: Kukjin Kim To: "'Doug Anderson'" , linux-samsung-soc@vger.kernel.org Cc: linux-i2c@vger.kernel.org, "'Olof Johansson'" , "'Thomas Abraham'" , "'Padmavathi Venna'" , "'Ben Dooks'" , "'Wolfram Sang'" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <1353450428-2615-1-git-send-email-dianders@chromium.org> <1353450428-2615-2-git-send-email-dianders@chromium.org> In-reply-to: <1353450428-2615-2-git-send-email-dianders@chromium.org> Subject: RE: [PATCH 2/2] i2c: s3c2410: Get the i2c bus number from alias id Date: Wed, 21 Nov 2012 18:43:15 +0900 Message-id: <0dfd01cdc7cc$a10b98c0$e322ca40$%kim@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac3HblPOtyAJMLMwSDujTmdTun+LaAAOiprg Content-language: ko DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrIIsWRmVeSWpSXmKPExsVy+t8zI13jRWsCDBbeVbTo+PuF0eLyrjls FjPO72NyYPb4vEkugDGKyyYlNSezLLVI3y6BK6N93zu2gh28Fasf7GRrYPzG1cXIySEhYCKx 5t8jdghbTOLCvfVsXYxcHEICyxglDpzbxgpTdG/dG3aIxHRGieMTrzBDOH8ZJe59+8EMUsUm oCFx+P0zsFEiAn4SR5/vYAIpYhZYzyRxq/kY2CghgXqJzu5mIJuDg1PAVeJjWx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NQjJpFpJJs5C0LGBkWcUomlqQ XFCclJ5rqFecmFtcmpeul5yfu4kRHM3PpHYwrmywOMQowMGoxMO7ce3qACHWxLLiytxDjBIc zEoivJumrAkQ4k1JrKxKLcqPLyrNSS0+xOgD9OhEZinR5HxgoskriTc0NjEzsjQyszAyMTfH IawkztvskRIgJJCeWJKanZpakFoEM46Jg1OqgVGk9q3xQuuAL3Wl1dUtsyecWdPwTvL6xbiY xaItV8Uvij5J8WJj+ObjoMXVWnBoypMTt64em7ymT1e0RHzL1cg88++Wk6vLylZeFOVkO7nm wZJeyYrJJzsE3wUyLtCf2X7ieQFfa+YuobkH5zDOnbbsnKBosa2fTpLD9fUTs601/cR16t3e H1FiKc5INNRiLipOBAAzIeGoEwMAAA== X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1908 Lines: 62 Doug Anderson wrote: > > From: Padmavathi Venna > > Get the i2c bus number that the device is connected to using the alias > id. This makes debugging / grokking of kernel messages much easier. > > [dianders: slight patch cleanup from Padmavathi's original.] > > Signed-off-by: Padmavathi Venna > Signed-off-by: Doug Anderson Acked-by: Kukjin Kim Thanks. Best regards, Kgene. -- Kukjin Kim , Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. > --- > drivers/i2c/busses/i2c-s3c2410.c | 10 +++++++++- > 1 files changed, 9 insertions(+), 1 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c- > s3c2410.c > index 3e0335f..ca43590 100644 > --- a/drivers/i2c/busses/i2c-s3c2410.c > +++ b/drivers/i2c/busses/i2c-s3c2410.c > @@ -899,11 +899,19 @@ static void > s3c24xx_i2c_parse_dt(struct device_node *np, struct s3c24xx_i2c *i2c) > { > struct s3c2410_platform_i2c *pdata = i2c->pdata; > + int id; > > if (!np) > return; > > - pdata->bus_num = -1; /* i2c bus number is dynamically assigned */ > + id = of_alias_get_id(np, "i2c"); > + if (id < 0) { > + dev_warn(i2c->dev, "failed to get alias id:%d\n", id); > + pdata->bus_num = -1; > + } else { > + /* i2c bus number is statically assigned from alias */ > + pdata->bus_num = id; > + } > of_property_read_u32(np, "samsung,i2c-sda-delay", &pdata- > >sda_delay); > of_property_read_u32(np, "samsung,i2c-slave-addr", &pdata- > >slave_addr); > of_property_read_u32(np, "samsung,i2c-max-bus-freq", > -- > 1.7.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/