Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752831AbcKRUsc (ORCPT ); Fri, 18 Nov 2016 15:48:32 -0500 Received: from mail-eopbgr10115.outbound.protection.outlook.com ([40.107.1.115]:12896 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752475AbcKRUs3 (ORCPT ); Fri, 18 Nov 2016 15:48:29 -0500 X-Greylist: delayed 82769 seconds by postgrey-1.27 at vger.kernel.org; Fri, 18 Nov 2016 15:48:28 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Subject: Re: [v1] i2c: mux: pca954x : Supports ACPI To: , Wolfram Sang , , References: <1479481269-16363-1-git-send-email-tnhuynh@apm.com> CC: Loc Ho , Thang Nguyen , Phong Vo , From: Peter Rosin Organization: Axentia Technologies AB Message-ID: Date: Fri, 18 Nov 2016 21:48:19 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1479481269-16363-1-git-send-email-tnhuynh@apm.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: HE1PR08CA0023.eurprd08.prod.outlook.com (10.161.112.33) To VI1PR0201MB2320.eurprd02.prod.outlook.com (10.168.63.22) X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2320;2:VmXExk8IuoX/kCwVb6nXkWJJqbTIlGxP+6L+yrBr6trgRehVQhEsy1Kl1Q8yWKxvsR4sQT+mexqt3vGf/1iuxEHkxh1pBrHwURi5NWeBwOgsCEWTJ5f801HAENMe3CZwbgYb8WK6f/e8rEWz5PCwFgsyAQGHXtkd+zC5f8dRekc=;3:lvAorW6SqQcPEdW2G5vGhz4pS/69ABmyDjQ7IUnkXLvSHgWKYXeshoIlxxO397jWAkQL9ETryUAZijsZKmNrjuDgaPTVN4MXbL0cjkDEDfDS41bQyn+p8Pk56ejcFePx+dIgvJZBhEj3HJAHqMnzoJc1uPeOS48qKAoS+YTOndE=;25:21F8cjwAKA9jMBarGMewuqkA1P9rBQAHbS2SU/xKCrfi8GoxXOqQTEWKUMQe3v97+s3fcckO7rjial1KK8ZQkcdWA+kjoRKy/sZtMNPGvab/RThizTtA2X5haZFrEfnfGXAXDGPXtTXTA4LH1rR07hn60vQk8OtOodAYB+WnTIkH74zigt9+UhhE0ScfeHZnYBIWwPVk4gypYDHbo1IfYlh2KW/Fmw8Vmk1Hb3wvFaE/UVk9F/ByFNFu0XVd8GYZ0z6ajWCuzhYaTV1oRgTglgRs5npX0h9WD1ps9LOL54/k4RrrXM+ETIo2mDjb/iYIO0QqUP2K0WL0SHQIxNaYq8le+Gyi5FmR2VYEiXUhnIDy3PA1bl6os0B9Sv97UUG2mC8b1MCBXfsOtY0bbG1NIxNJNkDrJVvbKM+neeNk+e/fyFitjV+bBNkdljAyfbSYcSjhLCjUTkC8VDw2F9Rf+w== X-MS-Office365-Filtering-Correlation-Id: bc01d77d-c0d5-4687-5712-08d40ff43e2c X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:VI1PR0201MB2320; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2320;31:0HnH+hQzTyxJhzSWc6VIDQMHiVlawWVlYp7nATYHLVB0P5LqHJCG5tL52za6YdBA22bdAIYP8m1jyZ+0S+k6b/3uMkO+UM/OgX+fx85wHoOtMi2V7VlZOMQzg2Z7Ig6mPO+iZinMLFax+MZBV5eJVX6xbUSKGA3h2dB4ubseNwkzsdtIawjq5+Uv+cnSNwsbVeo2GtRksZ07PuAN3XUW7JHalpo6ZXnmENO+n8Ooojp3lwSXdyMefxjBzBBnLdk3Zp4+Uztp0ia+fO2opqjYLw==;4:OZH/CrUwcN6iPsEQUL1o7uVNBgMOkAI6ALUEt8OpQiBoxYjkFX/s0eopTDYLA1VmSSj4hCFmBKFhDFfYFOBcupjptE2MLYWntpNq6s7efD2Fxk4mnIPEYd5gZRMY5X3EvHUp4nqoFOeowwqU8JaQripun1RjM868Ca7EsdW75PtfUD58uws9cy9ZDugbd2e3Vr5TtksRHx9SPmxp9I9WzCa64dSsJGmzNxSEO6LqiN+p4PNBQGzj9ZtZDc0INgXeTb9I7zWK4ymAvICYKhJwGOmK82peFnfgsJJHG9/+i+oqdI7Xb8uKU9c+zHiH67F3EAEek9KwIhJSUjoYNyA/NH0xFiV4Pe7h+G8hWJKpixxtqhqK93tSz3xRLGDZUPRTpkRyCEqahP5O+q763aSAeJJXFW8ua+w2+TZMUGbIWnh7fy5ajYkMOKV3kEo7E14TC16PPo6qj2nBm8AIvPB2fRORnlkSg6xtoT13/dtC/aE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040281)(6060326)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041223)(6061324)(6043046);SRVR:VI1PR0201MB2320;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0201MB2320; X-Forefront-PRVS: 01304918F3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(7916002)(199003)(189002)(377424004)(24454002)(4001150100001)(97736004)(4001350100001)(54356999)(92566002)(65956001)(5001770100001)(6116002)(77096005)(50986999)(76176999)(36756003)(42186005)(38730400001)(189998001)(2950100002)(230700001)(6666003)(31686004)(23746002)(74482002)(305945005)(47776003)(7736002)(2906002)(7846002)(66066001)(65806001)(8676002)(4326007)(2201001)(101416001)(68736007)(86362001)(117156001)(83506001)(50466002)(64126003)(3846002)(105586002)(81166006)(229853002)(5660300001)(106356001)(31696002)(81156014)(33646002)(65826007)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0201MB2320;H:[192.168.0.125];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;VI1PR0201MB2320;23:7TiiE7/ALHW9xx4XoVOb4/6hD7IHMJ8NYlD?= =?Windows-1252?Q?wZXADivKbsRL0OPyv+6j62Tq2Y0pw1tAkFxnDDAudq5th4i8RQKRwZ3q?= =?Windows-1252?Q?kWPB35pimczImDZuJPfIuc00rHkCk9aeU4DU/iPMjcAXA7OeyRPHxjLf?= =?Windows-1252?Q?AtWgy2IvrIZezPrnCO0n9E5va1GMqek5cH7qgOwJ2ZLP5q5sfTzJKmI4?= =?Windows-1252?Q?klaMjGjWoGDx39wNAYRSygfMRCainlxj+AjSaTX9hUjIyV/io72GfTw3?= =?Windows-1252?Q?xxBbO2lxpAVSv85CjQ9JB7cBV5jYlU87i+qWRg4WbYm/YMxk2VCUSfsr?= =?Windows-1252?Q?K9faCQoK+cKpQr8h86R31GmMfVJJtUHe84vU4VlOAW7hE/SPNN6UHD/u?= =?Windows-1252?Q?21erA7+E8PCTF3vm+1/EHmE/aPlCriI67zL8zZR9D5GbFo/XEXqqySky?= =?Windows-1252?Q?jdFicyUvMYS+YMRgcpPtg0R1VKWsDW4+Y5faw8S7ryRnZeOK9OfLXGTm?= =?Windows-1252?Q?Y2W4fMYp6VhdqoJvSSkdFEfyw5Q9HJUzXLBEBza1CunsUJnnnLhr92zk?= =?Windows-1252?Q?hIJqmvckCToxbGRsjs8h/u/ARG2ENf4oldIcyw4vbfbbsjsHBt7hwVzy?= =?Windows-1252?Q?6hbRF5Qx9cuhwUIZ70noKaTHJfmjghuT8EPnoZxkpqougyjv9en5/KXJ?= =?Windows-1252?Q?QXjrSqtanWbxT8pP32wBW6fMtghLdbsrP1sp6jOz0wVSGfCl7+NQ1cHU?= =?Windows-1252?Q?RNJ/EADbU1qTfl3JprqhxELgneH+zbhJVSlsRQDq/wnJsuGTwXqBWy0f?= =?Windows-1252?Q?wTN3r6mCcRjDA/PLNWCtuloAUuPEEdqpitx5L/ItST7CPZt48vpdu/Ju?= =?Windows-1252?Q?a4MT7F+dMY5J/4xhF7zUgcpKw5SafzdEp6GNmznKzUnMGl4XQpHFnGLf?= =?Windows-1252?Q?5B8BiCCspKveflGEKFKSU9FOV/RIgAtJ5ZEGhtIjibD3bKq/WvA09rFX?= =?Windows-1252?Q?RFxGbV11DbVXKk8jVyiJDe5m60wr3V2QA+hAcKwQR0ilrlhKUF33kIis?= =?Windows-1252?Q?v7SiIWvDHe10JS+Ks0J23aYM1buCna2HYcsGiD4fvz1g7rYNthyyHga6?= =?Windows-1252?Q?GUG+OJM2sT1xNwBBJwTOOBGgPz72b7wrt4JBXnnZ6oBcc+sCfA7Vrj6V?= =?Windows-1252?Q?qe+5bRIqbd4tj9FOYURJ6Gys1WLX87uzDqdZ64iVgyMgqtrjCIkTET2r?= =?Windows-1252?Q?O8lKq7VoEufjKKX21WLtIo1HbX0Yu8dKlTqMUGoGR5kKMY1buJ9zWLUC?= =?Windows-1252?Q?7XTJ6uMs6v5Inx7kMInIcxo33n3fBZR+xX2KDaX1QTZruTNhH58fOm18?= =?Windows-1252?Q?IzhmIl2XE1LstxuSD9CCJNYJjzJ/lv14VdWfWTagdE+gxabhEV9sG3CS?= =?Windows-1252?Q?PEwsUaXiuGyODbCTsKTsalaxBj4f2W1jMCkD0jcdX1L5DRtsTq/Y83/C?= =?Windows-1252?Q?Y/pNMObA=3D?= X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2320;6:QLU3TuOLzNi7+SF2tMx6cT7MH2JHXzCKiuUruFS3BiHqLFmGiKmDqYdywnIXQhu5HzjCpQmzjWi90bzKYpTpG76dREYZsZTty4W+rtPI6oD7bdoQGVSXE6cK9glmsVeMXJWhEFU/OumGFDGwA989sm6bbDgk9ryAlfMbb82bvP0R9QVD0vPsF/O4YD1rpx5Qf0N7mHKsMmqlNC15h+la3wzgDt8OTPDdPopes5XBjXGZXv02LWFUn0q9U87ieb/Wiik8q4XeD3CUT6l8RTKpxBKd09pZCI97GK87y4FNfuyo1oMbLy9dvFesHhMU0Hu34AJsfRDKhNfUxhLXzdgQlKTPFwdSUJ5pW65HFLplNRYxG4YzXoYPUDqGEo59cV+Y;5:EQucOViVmLQN43yLUchk0yR736bzkNESAWPAhv2HLpdSzgcyhjt9JDqxvXU8jdJWHtidcXqG4Lo40psE/6t+jixJROVcMmo4zWyKyFSgj+/SOZ3VKe60HYTqOnM6kQ+q/e7mEz0QHaPupifRju9vhg==;24:QXOVxpV6LbUJsIFRkI6rr1JAhNMdQe14obdjENOWaGbp67tTA865B6otZvOEBZCTATsXHNVMUah51jORJVhxJ4Aqb3yNc+YHvhdD4au66+U= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2320;7:45MBUQDDwtwYpDkvalWvL2YwA+CVOava8EkZGbf4IOK1BPLfCtJnvbHzYmEWP4ZhfFriIG9ncLIrfkfSFMFG7ASYuU5nTSf6hbjtVbrmTCJD8xIcBeHcaaZoCuyu5At+3DGs/YXbDoIV8B2es34BxM9Dj/klLCLp8gLKcm/AiiyrlAIzYXXDlVTJOUocEYCVKMuM0MpcoBmCW5kgMK25rGqCOqeOZ/8df+W7+TV9+DX5QFNkHu//7QzS3RabFQ/UH/utkqN+p/ZnoeoP1vCpun3vQshmk5joUPyy1vSt+sAc1gZsZseL3h5mMlq5J6Qg6z8lDzwSkNThuPaBC0wWA44dFLNZ+cDVI/66CvrtToU= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2016 20:48:24.5554 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0201MB2320 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2550 Lines: 95 Hi, Thanks for your patch! Some small suggestions inline. On 2016-11-18 16:01, tnhuynh@apm.com wrote: > From: Tin Huynh > > This patch enable ACPI support for mux-pca954x driver. > > Signed-off-by: Tin Huynh > --- > drivers/i2c/muxes/i2c-mux-pca954x.c | 25 ++++++++++++++++++++++++- > 1 files changed, 24 insertions(+), 1 deletions(-) > > diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c > index 1091346..e7ef93b 100644 > --- a/drivers/i2c/muxes/i2c-mux-pca954x.c > +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c > @@ -42,6 +42,7 @@ > #include > #include > #include > +#include Please keep the includes sorted. > #include > #include > #include > @@ -120,6 +121,19 @@ struct pca954x { > }; > MODULE_DEVICE_TABLE(i2c, pca954x_id); > > +static const struct acpi_device_id pca954x_acpi_ids[] = { > + { "PCA9540", pca_9540 }, I would write that as: { .id = "PCA9540", .driver_data = pca_9540, }, But that doesn't seem common for other acpi_device_id tables. I wonder why? > + { "PCA9542", pca_9540 }, > + { "PCA9543", pca_9543 }, > + { "PCA9544", pca_9544 }, > + { "PCA9545", pca_9545 }, > + { "PCA9546", pca_9545 }, > + { "PCA9547", pca_9547 }, > + { "PCA9548", pca_9548 }, > + { } > +}; > +MODULE_DEVICE_TABLE(acpi, pca954x_acpi_ids); This table should be #ifdef CONFIG_ACPI. > + > #ifdef CONFIG_OF > static const struct of_device_id pca954x_of_match[] = { > { .compatible = "nxp,pca9540", .data = &chips[pca_9540] }, > @@ -245,8 +259,16 @@ static int pca954x_probe(struct i2c_client *client, > match = of_match_device(of_match_ptr(pca954x_of_match), &client->dev); > if (match) > data->chip = of_device_get_match_data(&client->dev); > - else > + else if (id) { > data->chip = &chips[id->driver_data]; > + } else { > + const struct acpi_device_id *id; Please don't shadow the outer id variable. Cheers, Peter > + > + id = acpi_match_device(pca954x_acpi_ids, &client->dev); > + if (!id) > + return -ENODEV; > + data->chip = &chips[id->driver_data]; > + } > > data->last_chan = 0; /* force the first selection */ > > @@ -321,6 +343,7 @@ static int pca954x_resume(struct device *dev) > .name = "pca954x", > .pm = &pca954x_pm, > .of_match_table = of_match_ptr(pca954x_of_match), > + .acpi_match_table = ACPI_PTR(pca954x_acpi_ids), > }, > .probe = pca954x_probe, > .remove = pca954x_remove, >