Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1619883ybk; Sun, 10 May 2020 23:35:04 -0700 (PDT) X-Google-Smtp-Source: APiQypL4oCPP47i6ow3Hn0KsyAL5HEAYWfTuMlcVB1A4deSoo32mTu8kpH3JoGpGi6geYDBS+5O+ X-Received: by 2002:a17:906:49c7:: with SMTP id w7mr12340857ejv.29.1589178903946; Sun, 10 May 2020 23:35:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589178903; cv=none; d=google.com; s=arc-20160816; b=xV34SV6eCiAZL32A6gmGHuVvX5phs9rowkjWBzU+KZMRIjQ9Bfq5OwD5tiGznBNGjs COO8vxYDUBRlfE7xFPmfz64FBnP93LDKYvLX0Zr1ppNXkKtQuy3Bhyt40gdp9pj+/NMc edJ/tmbG8cCyqXmv5ucZqtwFsDLck1EsoNsUCP9Yy3vlnksU0wwZ/yXIymxDIMRWyFby emoRYRB4Tar9AEXm6wxAObe58O+SzoXl2WLcBMKw9EZ86NvkhW9fsq7ml3Taeuoy6eUG MMLxbGlvNpM95nq3POsNdufNoQVan6AzCee/WEBCRfGei87Ddj7738xn5CdMdD5pjnBu q8Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=hCEVC0gRewVC322A2S0hzDgvW8/Jx6403Y+SpDxKgSY=; b=hXwvubUxWyolvN/Dot4EVKuN73uxSfb/3uTivctXn653/5HANzBm3fjFWZQnPOSrHz 4K9C6k9S6VMt9LAGPabz2lm2eBtm3oqQmwXKiuLcq5lv1y7rVlKMr541t0hjJ3TgOX61 N8rs4b/qnhBNwKTLyotACCLmR+4ey9Tx6HZcI7nrKXtP4YPgTwh/vo4tojHNlULMgj0V RQ/6rA4aEbUNB++Z74PSMJfNsDZvdd2VxYpz0kOlKM2Fo0ihW3kol2rl45lWIXDpkZZx Sot7txm1LwSUISyyg1q2v/SN1dAl4f+hQ5I8ZKBrX5Vwal06cJA6zZDcA+UtZs2NU68J CI7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="a9kvfO/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j19si5237906edp.118.2020.05.10.23.34.34; Sun, 10 May 2020 23:35:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="a9kvfO/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726280AbgEKGcc (ORCPT + 99 others); Mon, 11 May 2020 02:32:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:42610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725993AbgEKGcc (ORCPT ); Mon, 11 May 2020 02:32:32 -0400 Received: from localhost (unknown [122.167.117.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0955E207DD; Mon, 11 May 2020 06:32:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589178751; bh=2NLujalkFrwrN4wsSJO1B+cIhyLExOYM1THy3Lqg6TQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=a9kvfO/zExXGRVKlys3c28Ud+Gcpe6GQArrRMKHo+8aF3KgiZwYiTw3JHPwS91sdU /n4Prhvsm5Vu1boMsRGzV5YPloyF2FAz6GwTfZy3Yr2WMWVtPEiBsVx7JTVdNodGMb xy8lMkgIfXSZP0gZGSOhrjfeqeHH58gJJDZmWohQ= Date: Mon, 11 May 2020 12:02:27 +0530 From: Vinod Koul To: Bard Liao Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, rander.wang@linux.intel.com, ranjani.sridharan@linux.intel.com, hui.wang@canonical.com, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, slawomir.blauciak@intel.com, mengdong.lin@intel.com, bard.liao@intel.com Subject: Re: [PATCH 3/3] soundwire: bus_type: add sdw_master_device support Message-ID: <20200511063227.GS1375924@vkoul-mobl> References: <20200429185145.12891-1-yung-chuan.liao@linux.intel.com> <20200429185145.12891-4-yung-chuan.liao@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429185145.12891-4-yung-chuan.liao@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30-04-20, 02:51, Bard Liao wrote: > @@ -24,9 +24,14 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent, > struct sdw_master_prop *prop = NULL; > int ret; > > - if (!bus->dev) { > - pr_err("SoundWire bus has no device\n"); > - return -ENODEV; This check is removed and not moved into sdw_master_device_add() either, can you add here or in patch 1 and keep checking the parent device please > +int sdw_master_device_add(struct sdw_bus *bus, struct device *parent, > + struct fwnode_handle *fwnode) > +{ > + struct sdw_master_device *md; > + int ret; > + > + if (!bus) > + return -EINVAL; > + > + /* > + * Unlike traditional devices, there's no allocation here since the > + * sdw_master_device is embedded in the bus structure. > + */ Looking at this and empty sdw_master_device_release() above, makes me wonder if it is a wise move? Should we rather allocate the sdw_master_device() and then free that up in sdw_master_device_release() or it is really overkill given that this is called when we remove the sdw_bus instance as well... > + md = &bus->md; > + md->dev.bus = &sdw_bus_type; > + md->dev.type = &sdw_master_type; > + md->dev.parent = parent; > + md->dev.of_node = parent->of_node; > + md->dev.fwnode = fwnode; > + md->dev.dma_mask = parent->dma_mask; > + > + dev_set_name(&md->dev, "sdw-master-%d", bus->link_id); This give nice sdw-master-0. In DT this comes from reg property. I dont seem to recall if the ACPI/Disco spec treats link_id as unique across the system, can you check that please, if not we would need to update this. -- ~Vinod