From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934092AbdA0LQF (ORCPT ); Fri, 27 Jan 2017 06:16:05 -0500 Received: from bert.emutex.com ([91.103.1.109]:57830 "EHLO bert.emutex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933118AbdA0LQC (ORCPT ); Fri, 27 Jan 2017 06:16:02 -0500 Subject: Re: [PATCH v3 3/3] spi: acpi: Initialize modalias from of_compatible To: Andy Shevchenko References: <1485187737-22414-1-git-send-email-dan@emutex.com> <1485187737-22414-4-git-send-email-dan@emutex.com> Cc: "linux-acpi@vger.kernel.org" , "Rafael J . Wysocki" , Jarkko Nikula , Mika Westerberg , Mark Brown , Len Brown , linux-i2c@vger.kernel.org, Wolfram Sang , linux-spi , "linux-kernel@vger.kernel.org" , Crestez Dan Leonard From: "Dan O'Donovan" Message-ID: <1114c19b-5398-799e-8302-ff87adf9d8a3@emutex.com> Date: Fri, 27 Jan 2017 10:35:32 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.0 (-) X-Spam-Report: Spam detection software, running on the system "statler.emutex.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: On 01/23/2017 05:11 PM, Andy Shevchenko wrote: > On Mon, Jan 23, 2017 at 6:08 PM, Dan O'Donovan wrote: >> From: Crestez Dan Leonard >> >> When using devicetree spi_device.modalias is set to the compatible >> string with the vendor prefix removed. For SPI devices described via >> ACPI the spi_device.modalias string is initialized by acpi_device_hid. >> When using ACPI and DT ids this string ends up something like "PRP0001". >> >> Change acpi_register_spi_device to use the of_compatible property if >> present. This makes it easier to instantiate spi drivers through ACPI >> with DT ids. >> + /* >> + * Populate modalias from compatible property if available, >> + * otherwise use native ACPI information >> + */ >> + if ((!adev->data.of_compatible) || >> + acpi_of_modalias(adev, spi->modalias, sizeof(spi->modalias))) > Same comment as in patch 2. Thanks for the feedback, Andy. The check on of_compatible is redundant, because its repeated in acpi_of_modalias(), so I'll remove it here (and in patch 2) to reduce this to one line. v4 on the way. >> + strlcpy(spi->modalias, acpi_device_hid(adev), >> + sizeof(spi->modalias)); > Could this be one line? I couldn't see a way to reduce this to one line without exceeding 80 chars or adding another line somewhere else, so I'll leave this one as it is if that's ok. [...] Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/23/2017 05:11 PM, Andy Shevchenko wrote: > On Mon, Jan 23, 2017 at 6:08 PM, Dan O'Donovan wrote: >> From: Crestez Dan Leonard >> >> When using devicetree spi_device.modalias is set to the compatible >> string with the vendor prefix removed. For SPI devices described via >> ACPI the spi_device.modalias string is initialized by acpi_device_hid. >> When using ACPI and DT ids this string ends up something like "PRP0001". >> >> Change acpi_register_spi_device to use the of_compatible property if >> present. This makes it easier to instantiate spi drivers through ACPI >> with DT ids. >> + /* >> + * Populate modalias from compatible property if available, >> + * otherwise use native ACPI information >> + */ >> + if ((!adev->data.of_compatible) || >> + acpi_of_modalias(adev, spi->modalias, sizeof(spi->modalias))) > Same comment as in patch 2. Thanks for the feedback, Andy. The check on of_compatible is redundant, because its repeated in acpi_of_modalias(), so I'll remove it here (and in patch 2) to reduce this to one line. v4 on the way. >> + strlcpy(spi->modalias, acpi_device_hid(adev), >> + sizeof(spi->modalias)); > Could this be one line? I couldn't see a way to reduce this to one line without exceeding 80 chars or adding another line somewhere else, so I'll leave this one as it is if that's ok.