Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4955223imm; Tue, 19 Jun 2018 02:37:52 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIDZ53819PSm1X6vfZ4RRVdkKzqKmIe/ULU2p5MC9FcVl9k57w7oGvSxDkwQ42N0wPLDwn2 X-Received: by 2002:a63:6d0:: with SMTP id 199-v6mr13987027pgg.338.1529401072509; Tue, 19 Jun 2018 02:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529401072; cv=none; d=google.com; s=arc-20160816; b=K2ITJByJZSWCQc2xGXMrPxiE+dL4Z6zWyufM2G0SdnvcACbmIdNAzMGv3EYWiA5Ftg LiGXs0DHir++zodMZGW6FDOrsnHusbFVUawX7Ez8WcxqX666yFgBdlguXE3rtYPwlX8w zbW8dJxewzQDgxAhXE6kiGbtPcOrbNapPd23ou58QTPPw+0zYiqkWRYOAR4COjxDKWgG mrrb9EK2OmdnMNUhuyJQ8OpiJmZrA8deCfEviUfisf1wgQWBT8OELPbE606H5YM8eK6M NlHiXhOKvpBeMwsmiwfiBCwdXXcLVkLUcP1jDZcpLnqsuKK722HFuY26KCMAp6CotWc1 idXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=OYMo7MCQtGyXmV0pwddzKECwIVlKRcAfzgV2DyV2iLM=; b=IF0mY1DnP1WIKohptDcmDy67ZRrtIRrZnNuCAQ6jJxl84IJU6h522y+oBZ8pVAxRCg wDqDOMdUNwnpGaDUh2UHUpIVawrmh+mDtb2+QVQOIaJVTjAU/Q3mh36SQEMzaEx8lH/n HsiPWWtRi5Dn1KPCAWQ3j94kY5xQPA0suhAqwRFB8UJgurVHPNsZ7GewDdBm7bSwwGuL u2iOtRF0uX2P9ZanLdCPuBclKDY4Ul7Esg0DsSHB/sMEpbuPMIXqVkJN/CqwMaXS3iXf eLkrZNqJxb07r6Z58IOwiA3HtU14p2l/2NJjWfLojbCTjDrmizBeOti0WThDzRpyuoQO oOIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KK8NfTb7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9-v6si13638866pgq.131.2018.06.19.02.37.38; Tue, 19 Jun 2018 02:37:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KK8NfTb7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965768AbeFSJgq (ORCPT + 99 others); Tue, 19 Jun 2018 05:36:46 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36048 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965682AbeFSJgo (ORCPT ); Tue, 19 Jun 2018 05:36:44 -0400 Received: by mail-wr0-f194.google.com with SMTP id f16-v6so19815932wrm.3 for ; Tue, 19 Jun 2018 02:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=OYMo7MCQtGyXmV0pwddzKECwIVlKRcAfzgV2DyV2iLM=; b=KK8NfTb7/Ax01mhCxyZCvz48R7wL+s3lRE8KBocyhZ7U4dERQ+qCa/0HgRn+bAvoWU KNNZtsVIOBZ5LLAoaBkGHBvglsBAFXfA69RobIweDkUbJa7Pls63awgaO94Go7BUQlp+ XJxuHkrriteYZWpn5wrvb2MzXGFnyJTZnPh6c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OYMo7MCQtGyXmV0pwddzKECwIVlKRcAfzgV2DyV2iLM=; b=a2l5Ogp9g+Q+ip+cJDgEspF2CSeCeBBzkRQt1rzf6aqzISpThiyVt39eb2TwzZoyYN x+dRXmafP6SyvvTckam42O0O9xa51R1AM41WUBePeNPYdrfDYhDuzrOJJxLklAhEfqZl CJ2yFk/3jAjUrkMriTtzROb/qBODCNPgbcG1+WHKI6vnlOls2xpa6eve6srlW6/20QSb 48DO14z6Y/YSOlmL0brLmHFskH7vKOwOd9MqzMPpCIL/RT8YzomZ/0qFTOz4tETpUJCg K9fQBHYZZxyTHJm6tqJcCVSo9GXi1ZeHDTK0kF9xvDKAslKNshnh6J69LVzsUWHueAIF WcIQ== X-Gm-Message-State: APt69E2mu9fyKuDGJrCKLavA4uLnEjl8LjE5xwmJSj1+BiVcuWn59wS5 RbG2uR2Cvo0GsryaSmTXlXgNHsNFjwY= X-Received: by 2002:a5d:4306:: with SMTP id h6-v6mr13774389wrq.58.1529401003426; Tue, 19 Jun 2018 02:36:43 -0700 (PDT) Received: from [192.168.1.180] (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.googlemail.com with ESMTPSA id k36-v6sm33734423wrc.20.2018.06.19.02.36.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 02:36:42 -0700 (PDT) Subject: Re: [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF To: Rob Herring , Niklas Cassel Cc: Mark Brown , Frank Rowand , Andy Gross , Patrick Lai , Banajit Goswami , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , linux-arm-msm , Linux-ALSA , "linux-kernel@vger.kernel.org" References: <20180614111138.8923-1-niklas.cassel@linaro.org> <20180614111138.8923-6-niklas.cassel@linaro.org> <20180618110642.GA6928@sirena.org.uk> <20180618123932.GA28476@centauri.lan> <20180618200848.GA32482@centauri.lan> From: Srinivas Kandagatla Message-ID: Date: Tue, 19 Jun 2018 10:36:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/06/18 21:53, Rob Herring wrote: > On Mon, Jun 18, 2018 at 2:08 PM, Niklas Cassel wrote: >> On Mon, Jun 18, 2018 at 08:48:32AM -0600, Rob Herring wrote: >>> On Mon, Jun 18, 2018 at 6:39 AM, Niklas Cassel wrote: >>>> On Mon, Jun 18, 2018 at 12:06:42PM +0100, Mark Brown wrote: >>>>> On Thu, Jun 14, 2018 at 01:11:36PM +0200, Niklas Cassel wrote: >>>>>> of_platform_device_destroy is only defined when building >>>>>> with CONFIG_OF=y. Add a depends on OF. >>>>> >>>>> Is it sensible that of_platform_device_destroy() is only defined when >>>>> building with CONFIG_OF=y? >>>> >>>> I'm redirecting that question to the device tree maintainers. >>>> >>>> There are a few of_* functions in include/linux/of_platform.h >>>> that are only defined when CONFIG_OF=y: >>>> >>>> of_platform_device_create() >>>> of_platform_device_destroy() >>>> of_platform_bus_probe() >>>> of_device_alloc() >>>> >>>> Rob, Frank, do you want me to create static inline dummy versions of these? >>> >>> No, because generally you should not be using these functions >>> directly. Yes, there are some users, but if you look at the tree, >>> there are few or isolated (PowerPC) users. Using >>> of_platform_populate/of_platform_depopulate is preferred. >> >> of_platform_device_destroy() is also used by sound/soc/qcom/qdsp6/* >> which is why I suggested this patch: >> https://marc.info/?l=alsa-devel&m=152932497413567 >> that adds "depends on OF" for SND_SOC_QDSP6 in sound/soc/qcom/Kconfig. >> >> Or do you think that a better solution would be to modify >> sound/soc/qcom/qdsp6/* so that it instead uses >> of_platform_populate()/of_platform_depopulate()? > > Yes, that is preferred. However, that won't work here because the > child nodes don't have compatible strings. Maybe we should add them as > this all just went in. That would also allow DT based module > autoloading to work (which I don't think would currently). Really, as > is, of_platform_device_create isn't needed here and you could just use > platform_device_register_simple instead. The child driver would have > to get the DT node pointer from the parent device instead. > compatible was the reason why I started using of_platform_device_{create,destroy} apis. As you said we could also do it with simple platform device too. I think adding compatible seems to be better option here along with of_platform_populate()/of_platform_depopulate(), I will try this! thanks, srini > But if you want to add empty functions for just > of_platform_device_{create,destroy}, I guess that is fine. > > Rob >