Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3164823ybt; Sat, 4 Jul 2020 08:08:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwj0jJVimmwcsbWMWJBEvpbtOCJn3+XYOlKWvRDWkTMUl1L1ayZ2MWjHxiBEidSoqJIhEuQ X-Received: by 2002:a17:906:7283:: with SMTP id b3mr38024851ejl.163.1593875335262; Sat, 04 Jul 2020 08:08:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593875335; cv=none; d=google.com; s=arc-20160816; b=v7LrUbGOUA83msuuG/x1SD8MQxghJv8z/QR1FZzEhYCTfOwrba86DbDjOlHANB+dU5 pgx97bk+bBdlMCS/ebCccrqlhHIeNQukKtCE2qSo4uvjg831swpXoQulMsgTaVXNNETn Z45yo6vGSqXR0kBNdJ0j//fsjA3cQrzO6G1B9dBMEsApOUDd72/Kc1Fm4O1EPpp4IIIO x392lZBRFEfBexliwHo5ZKXmkmjWtTYWhf6Pj+Jjem9B5Az9U/4AvK7vetAAsLrR6RFi cOuR1g/HbHtgpwN3I3Yyhv5ObewKoYUE7Gs9Ug/SxTiAXTIdLLauVPwv0l651SQ8FpbT hfAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1wb73vYv/CqphlWd96x1H+DWcYa52t0ykdauU1Ecrr0=; b=qiLoz9itJRN9Q/xTqPDEYqwKeIvtAgq7y3KiPVXDreH8eDcL2/x/pWKvMprDJ9KgHm PVMiG0Sbj52q35dOyhRboGsjNrIe6L/54Z5X4ddLyF5FVnO+rS74bnCulwsu/5OMTERv GZoNBTbU8rIejhdJIUwQrwgpUiC936gD8ww+UI/asniJ+c+0DXtdJxvcIR5PFHV3Eu/O dRhJBauGNn10cLGCjwm1K1g42jpDb/U6J06azvCEhiGIbKmTlT2SO0TzHqsd8WSyCTIk /eKEpI/AeIwxIZtweQ05TokN49AwuVbkTT+dLHGI7WDSfwHvDw2vdyEuqXNbn/wiCzKT zJ5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W0EBfx8P; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f18si9853851edw.95.2020.07.04.08.08.32; Sat, 04 Jul 2020 08:08:55 -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=@linaro.org header.s=google header.b=W0EBfx8P; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727017AbgGDPI2 (ORCPT + 99 others); Sat, 4 Jul 2020 11:08:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726669AbgGDPI1 (ORCPT ); Sat, 4 Jul 2020 11:08:27 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CBE0C08C5DE for ; Sat, 4 Jul 2020 08:08:27 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id d4so16376500pgk.4 for ; Sat, 04 Jul 2020 08:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1wb73vYv/CqphlWd96x1H+DWcYa52t0ykdauU1Ecrr0=; b=W0EBfx8Pf5lO9/EW1AxErbvpgFNAoHuht9cBcRaFY75qO5qtPAmN3H24wz6X2l270h 1YIh96uz9fR1lmFiMcCkxMo3BPIZ7es01PnvfWIYxB3ekvoRuEFPA0ah4xvNwZB8i0ff cVjMkJzY8mfpAkexCVMmQlYorYV7eshdyWdWANOvw658wjwe0wtlwOytbJY/zxJP8X6t 58m+l51fPEhxRaSnt5RQ+tojLHTnKE15XkJmKk0Q3DkRtdUs9i+U81OLLaPy8EfTlbff 6cmNcIZxaGhGEtpXck61oOv1ktqmgWuy1eGw70Zhp6YX1l2FIKcqta6dBtHvi3GIsjOr cX3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1wb73vYv/CqphlWd96x1H+DWcYa52t0ykdauU1Ecrr0=; b=iAiW0lcUUGjXi7egZ28yVW12fljGraaMJQmGt3CZo3JO+lmMG1kvIY5nXRxYODaMFg XCrafks/ralHCTxdITB1iVrV3rXHF6GAjlsdgPJ/gcN5I6KCrD3KMoYCwRldFk1g0nvq gIClYogjdxy7RG3jJTN2voYdYC1WQeRN/gItJ8fO+H9SPA7u5qsMhdTqY8rMHzXP0UcZ Ec/h+FIjpp6K9IXW5QM/HV5fvQP/CV81J7X76gME8+8p3TCFojFqQBA5NHm62EFHzJYb Wj+KitvGFp4NwIKJRxE+Yv7XIRvvdikgN4p0aLj9mIFH5Ehk8Lt5JSKRxjtOZZYXgtGh OWDQ== X-Gm-Message-State: AOAM530LkAQeXl9JBphBFS4w/86FbTRtcJ8+H3ScFMnfh21OKwMZ68U3 R2ID5phhNjbIgpKvbdE0kL7b X-Received: by 2002:a63:b74f:: with SMTP id w15mr34637057pgt.314.1593875306877; Sat, 04 Jul 2020 08:08:26 -0700 (PDT) Received: from Mani-XPS-13-9360 ([2409:4072:680:29c6:d74:dc5c:e13f:c458]) by smtp.gmail.com with ESMTPSA id x7sm14946484pfq.197.2020.07.04.08.08.22 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 Jul 2020 08:08:26 -0700 (PDT) Date: Sat, 4 Jul 2020 20:38:19 +0530 From: Manivannan Sadhasivam To: Bhaumik Bhatt Cc: linux-arm-msm@vger.kernel.org, hemantk@codeaurora.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 5/9] bus: mhi: core: Use generic name field for an MHI device Message-ID: <20200704150819.GE3066@Mani-XPS-13-9360> References: <1593448782-8385-1-git-send-email-bbhatt@codeaurora.org> <1593448782-8385-6-git-send-email-bbhatt@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1593448782-8385-6-git-send-email-bbhatt@codeaurora.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 09:39:38AM -0700, Bhaumik Bhatt wrote: > An MHI device is not necessarily associated with only channels as we can > have one associated with the controller itself. Hence, the chan_name > field within the mhi_device structure should instead be replaced with a > generic name to accurately reflect any type of MHI device. > > Signed-off-by: Bhaumik Bhatt > Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Thanks, Mani > --- > drivers/bus/mhi/core/init.c | 5 +++-- > drivers/bus/mhi/core/main.c | 6 +++--- > include/linux/mhi.h | 8 ++++---- > 3 files changed, 10 insertions(+), 9 deletions(-) > > diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c > index e43a190..e2011ec 100644 > --- a/drivers/bus/mhi/core/init.c > +++ b/drivers/bus/mhi/core/init.c > @@ -904,6 +904,7 @@ int mhi_register_controller(struct mhi_controller *mhi_cntrl, > mhi_dev->dev_type = MHI_DEVICE_CONTROLLER; > mhi_dev->mhi_cntrl = mhi_cntrl; > dev_set_name(&mhi_dev->dev, "%s", dev_name(mhi_cntrl->cntrl_dev)); > + mhi_dev->name = dev_name(mhi_cntrl->cntrl_dev); > > /* Init wakeup source */ > device_init_wakeup(&mhi_dev->dev, true); > @@ -1249,7 +1250,7 @@ static int mhi_uevent(struct device *dev, struct kobj_uevent_env *env) > struct mhi_device *mhi_dev = to_mhi_device(dev); > > return add_uevent_var(env, "MODALIAS=" MHI_DEVICE_MODALIAS_FMT, > - mhi_dev->chan_name); > + mhi_dev->name); > } > > static int mhi_match(struct device *dev, struct device_driver *drv) > @@ -1266,7 +1267,7 @@ static int mhi_match(struct device *dev, struct device_driver *drv) > return 0; > > for (id = mhi_drv->id_table; id->chan[0]; id++) > - if (!strcmp(mhi_dev->chan_name, id->chan)) { > + if (!strcmp(mhi_dev->name, id->chan)) { > mhi_dev->id = id; > return 1; > } > diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c > index 8d6ec34..3af0ce6 100644 > --- a/drivers/bus/mhi/core/main.c > +++ b/drivers/bus/mhi/core/main.c > @@ -249,7 +249,7 @@ int mhi_destroy_device(struct device *dev, void *data) > put_device(&mhi_dev->dl_chan->mhi_dev->dev); > > dev_dbg(&mhi_cntrl->mhi_dev->dev, "destroy device for chan:%s\n", > - mhi_dev->chan_name); > + mhi_dev->name); > > /* Notify the client and remove the device from MHI bus */ > device_del(dev); > @@ -327,10 +327,10 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl) > } > > /* Channel name is same for both UL and DL */ > - mhi_dev->chan_name = mhi_chan->name; > + mhi_dev->name = mhi_chan->name; > dev_set_name(&mhi_dev->dev, "%s_%s", > dev_name(mhi_cntrl->cntrl_dev), > - mhi_dev->chan_name); > + mhi_dev->name); > > /* Init wakeup source if available */ > if (mhi_dev->dl_chan && mhi_dev->dl_chan->wake_capable) > diff --git a/include/linux/mhi.h b/include/linux/mhi.h > index b008914..7ed785e 100644 > --- a/include/linux/mhi.h > +++ b/include/linux/mhi.h > @@ -436,10 +436,10 @@ struct mhi_controller { > }; > > /** > - * struct mhi_device - Structure representing a MHI device which binds > - * to channels > + * struct mhi_device - Structure representing an MHI device which binds > + * to channels or is associated with controllers > * @id: Pointer to MHI device ID struct > - * @chan_name: Name of the channel to which the device binds > + * @name: Name of the associated MHI device > * @mhi_cntrl: Controller the device belongs to > * @ul_chan: UL channel for the device > * @dl_chan: DL channel for the device > @@ -451,7 +451,7 @@ struct mhi_controller { > */ > struct mhi_device { > const struct mhi_device_id *id; > - const char *chan_name; > + const char *name; > struct mhi_controller *mhi_cntrl; > struct mhi_chan *ul_chan; > struct mhi_chan *dl_chan; > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project >