Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755882AbbHQQhm (ORCPT ); Mon, 17 Aug 2015 12:37:42 -0400 Received: from mail-bn1bon0113.outbound.protection.outlook.com ([157.56.111.113]:40032 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753333AbbHQQhk (ORCPT ); Mon, 17 Aug 2015 12:37:40 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yorksun@freescale.com; Message-ID: <55D20DC9.2060304@freescale.com> Date: Mon, 17 Aug 2015 09:37:29 -0700 From: York Sun User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Wolfram Sang CC: , , "Peter Korsgaard" Subject: Re: [PATCH] driver/i2c/mux: Add register based mux i2c-mux-reg References: <1434475692-4611-1-git-send-email-yorksun@freescale.com> <20150815202302.GB3463@katana> In-Reply-To: <20150815202302.GB3463@katana> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [192.88.168.50] X-ClientProxiedBy: CY1PR20CA0114.namprd20.prod.outlook.com (25.164.213.168) To BLUPR03MB149.namprd03.prod.outlook.com (10.255.212.17) X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB149;2:q0ECq1QqjnMexqepYIdiUAuedWmoeOtEQNK6aT6G0k4jauzdn2Ry7RaAnbFZwE0t9rkXTLDQmv64cYibmo9D5DfNhdxvDSqFij5AMZWsXI44Do0OV9nwJNhVx054dUOHSvy45NfjgT/rCJF5VcZ/ujECOX1q2KEPAMJ5FNW2qL4=;3:hBBln+hZhUqqPDvWyOaGXbgXU6f3JPkuahINf95/Z0bZiJh0ZPe10LMRvBLZa0hUlari5/m3fHxKhhj4F0F/jF2jtirozNwXInjFhePSErKxUOb3P+Eqh6a3HJ+M+IqeG/+FiJnuMVhts7PgcIL4jA==;25:aCdhfYMHnKi3fVG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c6bxNmIkx3w/ORKwzOJRtbhCHTol6y7Y2/SfH3ZzwMBYiUcR7AmgLELp+LgJgmSHOd5a9iFUOMAr1qJLw4lnG07enJwIWdNwBprtZzzrG1R0O4IchUGXFozgGZ8lhJF/MCL9TUD4HF1xriULqFWEEuGfqElrDsWpSvOKcbvMEnIDdHLcVgW1TzYgtTHyuAy1iRAYMigbk99+MvZP83hhmRAnIFzaxvenEt7w7YpsFYbP64vla X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(8121501046)(3002001);SRVR:BLUPR03MB149;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB149; X-Forefront-PRVS: 0671F32598 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(6009001)(189002)(377454003)(24454002)(479174004)(52604005)(199003)(36756003)(81156007)(97736004)(62966003)(40100003)(110136002)(5001830100001)(77156002)(42186005)(5001960100002)(5001860100001)(189998001)(105586002)(23746002)(50466002)(4001540100001)(19580395003)(80316001)(86362001)(46102003)(4001350100001)(64126003)(83506001)(2950100001)(59896002)(76176999)(230783001)(50986999)(77096005)(87266999)(19580405001)(68736005)(101416001)(65956001)(54356999)(65806001)(66066001)(47776003)(92566002)(64706001)(106356001)(87976001)(33656002)(65816999)(122386002);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB149;H:[10.214.84.243];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BLUPR03MB149;23:o3VA9RV1P+5qDTwYjEqjoEW7HijMnMADZDOi4z?= =?Windows-1252?Q?5NCGr8Zi13qyE1IAr33YNMWlW/7K7EwzcCc60P3mLh1lsCApm5a6myxa?= =?Windows-1252?Q?/4R1I8xRalaK4Hrq3AwZ/jbE+sDcO1wwnPrOTf3JJHcdm+kwSHtPZATX?= =?Windows-1252?Q?oHI2900hFV2G0AR8OaFdjmeOvs0OXadhTXEmxhm3pK2Q4IzUh/XgGbNZ?= =?Windows-1252?Q?hr8gCoy5ctH4iYFAuwCgnHghw3OZBZO1tD2uq0wqPoLygs56KY17pODq?= =?Windows-1252?Q?UNoL95NRk/wGpus0qFsS1pRkJTBLx93gqjvA7qfe2f02Ku+MZdr5Rl6B?= =?Windows-1252?Q?Z8ZEYZlOw/gzue5jHN+l/HfR97rBcXL8mVT2Dj6gHUtY7bLwYdVYWM8X?= =?Windows-1252?Q?0gJfD12hFHqz/SMEk0pn11me7F6srjo8gxqB7gD9GerbbU30dagTKfjH?= =?Windows-1252?Q?YGOyp88OSiBCq4fto16X9hborUtdqgKTSBRiXLlxImsOx5J4XZJhkK09?= =?Windows-1252?Q?asxCo32OwvVH9Aib+uVgqUWF5QA3gQWklN4x8c32KB1E1l/oo4R3a8tm?= =?Windows-1252?Q?a5Uzzxp4ProDqU/ydwogxitzUAyzfAoyEStniZDUlFdlWL6dDyzYjqNi?= =?Windows-1252?Q?p6DYBuw5nFMKn4HKL0tEQ6toPooey8EcmnZYY7n11lKvqYhUZRNYo0uA?= =?Windows-1252?Q?K9cV8kpj5rRtUbe+aMyNQBJ1m2N80IvWpFIp/FRegZiTErJhEZpDBpFX?= =?Windows-1252?Q?65/YEfCZ1kNre4rRiiXBU3YWUp7M75irbCemdG4GRsdAb7JCju3Riax1?= =?Windows-1252?Q?dKPcLve5or/bvu95RN7N8As9U5faVvjrUceGUEOmdSOJcLAJy68H+62S?= =?Windows-1252?Q?kgDrl8TLQFQi5Fwq2uR4CnX2UeTtCpW4VedQMeq6YrtZpgRHPKnFUmte?= =?Windows-1252?Q?LT/t8yJKlL5GLn/TrrDHWBF2wMM1ZfymmHvevaSuoLE5F9hqe3bElFUp?= =?Windows-1252?Q?Cy4Am4Nh0VKttNGzDn+rVJwR2l+xIzGobbbjiC/8Qw8r9kMNFp272Uvz?= =?Windows-1252?Q?8gjmpTYZYWiooyzhnQTNgPVB7kk3hCfmU546w3bmjNPFPmUMwLdXpFwF?= =?Windows-1252?Q?6L7DENniWSjcqnupsuzMaxui2XLdAbXIxxDUbdkTJu4iLTCom6aqZws1?= =?Windows-1252?Q?5jGWz7+qeMaUjALnUX2EEoKkm6m0DMgSTGteIOhdHAPZpORlpaSgXMQq?= =?Windows-1252?Q?rhUjCruc0J3O4gRbA3IdRP7Gx6PwHdS6jhFsoyGYegYKcT0RnGBvR7zY?= =?Windows-1252?Q?y3S/9fFzonXKUGy2o+lev9vnwVJ6JJr+PJyRepqb/lyjk6oyqYuW9Rw5?= =?Windows-1252?Q?8GjIZnGde6VG+crsIyuuHfvZQdA++7rAWv4SsSYBB7//3pagM5H3eJQY?= =?Windows-1252?Q?lGqz3IhunI4ZaricDqjZRT3hMmsmalj9iObz0Lm+C7+Pf7nWiG6LCcz5?= =?Windows-1252?Q?/tDDU=3D?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB149;5:WwMWgQdBCLs8a0IZR0pq9LzDetpcNZOAhBtb2YgR7VcgSh/0WtSp7x3BjdY6a+n9N9AXlOYQkqH4rhPBzSWQ3zJqTdxvLARLA8pZNG4HJSJnBXVRfDErIsL5gr3ghGy3KsezPDstEGbgE24qBzv1NQ==;24:TdNeaJ0P9eHKtUmvbpb8LuOCakSxA+ZlhPfcJHxaUyjgWaXogN4IvTuoqD16oTbn0YXEn3ttXNTSJ6ehJAgl6NEtD/KlO+SfMRZ8rlGjM4g=;20:7OrK6ElYmljZ4enuraRLzHids3Ooo6w5SrkjIZn4BzF+k9ZMP8y3x8QEs+FbiEVL+0BjNkTIn07JPDVdEPkxOg== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2015 16:37:35.8148 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB149 X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB035;2:jDyxBkhY2UHws4+MOAwS9NiWzmLRabnQ9Eoqw0r1igqRTaN9W7LbcipT3yp88bo580x0XVTJKA8/ve9aeEIM3VkYZaJxxVuOMty4Z8j4/RDETOSscqkZSxkwtTFZ4XfNcJ82Ox+nMY1GWG9xwGyGylbXL9rpz2qfxsbek+D3hl4=;3:fbQl/OupvdyvtH3xjpUu9BO7qVxQdf4UyTwWYIX54DmadZCFpCRPYPm67SWuFAjT7GusXSzV1GyWxUtKynJlmsy91+/ZmD8+scamASgMZjEPPOg/uDWUQ11ZT2X2jghT7tvRAUdevtNEhme9PrFkEw==;25:dt28AZ4OfVXF4jaRy9ZhfiuEqfc5xud64/6RgBwAQlYW4puFe6CEYOISVIG3WhzNWDncj9nv1wr7n5rPuXzXf6usDuTOGNMOk3KV0joYTX+UrdGk0tTyMsXJkQGAh8Gsk4FGec6kq97sESPNtA1zv4j1Pkvl0Mt9Dm0kLKIWstnlVIMWW7fGwvB/lSkqZ4UvKji/WHufnj1HKIaMrsl/ivioeZ8p16MubOQBol4ibPi/DFD3c6OZDeJvtekv6fo8;23:FhhWTHslHKnjq7lctjrv2B1Wof5VIZ6CtnPhwIfPST0MqknmgMwaGD53i2BkbQrzYclpanCsfCW295sqh19iqMxezF19fHpy1ahpmSHR7ImuBCn2usC51atQ9TyYucaE8+XhFYhpMb6smeEf0dn8xrLyiPlirnS4qNatRMvZTIszCAwZrF8vtz1Inne16+oL X-OriginatorOrg: freescale.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1791 Lines: 54 On 08/15/2015 01:23 PM, Wolfram Sang wrote: > On Tue, Jun 16, 2015 at 10:28:12AM -0700, York Sun wrote: >> Based on i2c-mux-gpio driver, similarly the register based mux >> switch from one bus to another by setting a single register. >> The register can be on PCIe bus, local bus, or any memory-mapped >> address. >> >> Signed-off-by: York Sun >> CC: Wolfram Sang >> CC: Peter Korsgaard > > Mostly good. > >> +static int i2c_mux_reg_probe(struct platform_device *pdev) >> +{ >> + struct regmux *mux; >> + struct i2c_adapter *parent; >> + struct resource *res; >> + int (*deselect)(struct i2c_adapter *, void *, u32); >> + unsigned int initial_state, class; > > gcc says: > > drivers/i2c/muxes/i2c-mux-reg.c:182:15: warning: variable 'initial_state' set but not used [-Wunused-but-set-variable] > > It seens you prepared for setting the initial state but don't do the > actual set? Thanks for catching this. I set the initial state variable but used another variable when it is actually used. Kernel Makefile disables unused-but-set-variable by default. How did you enable this warning without being flooded by the warnings? (I tried W=1) > >> +static struct platform_driver i2c_mux_reg_driver = { >> + .probe = i2c_mux_reg_probe, >> + .remove = i2c_mux_reg_remove, >> + .driver = { >> + .owner = THIS_MODULE, > > coccicheck says: > > drivers/i2c/muxes/i2c-mux-reg.c:288:3-8: No need to set .owner here. The core will do it. Will drop it in next version. York -- 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/