Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4555683ybv; Mon, 17 Feb 2020 01:17:53 -0800 (PST) X-Google-Smtp-Source: APXvYqzUQhJZjrcoQDFZx9mMi20u+acoeKRc0x1hDgBRpvsEAFrhoKb9NOJgu59uDp6lCo3kT0RS X-Received: by 2002:a9d:4110:: with SMTP id o16mr11590706ote.101.1581931073241; Mon, 17 Feb 2020 01:17:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581931073; cv=none; d=google.com; s=arc-20160816; b=ctQJpe+V1RAdOuEiAvh6X50eRt9lXWhzg3MSWluWfXXPsJCSRmE1nLsC2uPCiRunLE yaEsffDH+6EwssWTxjY2qKllBz1krT0iXjncOMeB8T3EfX1mfsILYGoi/FyjkYNpl06q 0NIaLaXUJHru8l/KQ5M1IsVoWtbcNj39R3DGBxYFB8oZIdkH1PFyAmqyJ5UdSFS2zqxk 4GrBQvWDsDcaCX7sXHRFEnSLhEin9zL9/JA2GGHS9KFOjoNH/GFIcRM2TkzGqIDi7KlP M4nplkiQHQt35e6wwa057Vx4xnlEn7s46H8YBHNhXOsJZWceYbEwjoSGzRw9hwMLLrXQ lE4Q== 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; bh=9/x2qSuoRFyCbV4k4K9IWLfjQFoX9Ud1M7WtXOWH1gc=; b=yv9txmOaHz/Zx1PgHO/vymHU9HJX8Y3P+eTfM37jVSLtVeRSIzszcl5shii1neDLZr b9foYjKUP/ryhdH/odkBd9tsziaBegEABn2UeDD7rl8BQm1c6nDa9hgURyS2n7olsJGU ErvsMfXXjNYTs1KK8CG/SqOxvIf/QmaEXTL3Jgcdr2St7K3qIoapS8/GJRDVac04wSjH rqnEAW44TcCwA02om0MKxWz1Hi2du4dgXk3k7G5T/l6nSl4g4/01wPS3piIvZitFEay8 4d6+HpGZX5JmzX5mL8BaerBh5rTb4bm2pAjONHWof6C80xhF8RhreK0tuN4NjcnD/md2 cutQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si6436877otk.171.2020.02.17.01.17.41; Mon, 17 Feb 2020 01:17:53 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728780AbgBQJQr (ORCPT + 99 others); Mon, 17 Feb 2020 04:16:47 -0500 Received: from mga14.intel.com ([192.55.52.115]:37103 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728650AbgBQJQr (ORCPT ); Mon, 17 Feb 2020 04:16:47 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Feb 2020 01:16:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,451,1574150400"; d="scan'208";a="348459901" Received: from kuha.fi.intel.com ([10.237.72.53]) by fmsmga001.fm.intel.com with SMTP; 17 Feb 2020 01:16:44 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Mon, 17 Feb 2020 11:16:43 +0200 Date: Mon, 17 Feb 2020 11:16:43 +0200 From: Heikki Krogerus To: Chunfeng Yun Cc: Greg Kroah-Hartman , Benson Leung , Prashant Malani , Mika Westerberg , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH 4/9] usb: roles: Leave the private driver data pointer to the drivers Message-ID: <20200217091643.GC28776@kuha.fi.intel.com> References: <20200213132428.53374-1-heikki.krogerus@linux.intel.com> <20200213132428.53374-5-heikki.krogerus@linux.intel.com> <1581758398.3473.3.camel@mhfsdcap03> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1581758398.3473.3.camel@mhfsdcap03> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 15, 2020 at 05:19:58PM +0800, Chunfeng Yun wrote: > On Thu, 2020-02-13 at 16:24 +0300, Heikki Krogerus wrote: > > Adding usb_role_switch_get/set_drvdata() functions that the > > switch drivers can use for setting and getting private data > > pointer that is associated with the switch. > > > > Signed-off-by: Heikki Krogerus > > --- > > drivers/usb/roles/class.c | 22 ++++++++++++++++++++++ > > include/linux/usb/role.h | 16 ++++++++++++++++ > > 2 files changed, 38 insertions(+) > > > > diff --git a/drivers/usb/roles/class.c b/drivers/usb/roles/class.c > > index 63a00ff26655..f3132d231599 100644 > > --- a/drivers/usb/roles/class.c > > +++ b/drivers/usb/roles/class.c > > @@ -329,6 +329,7 @@ usb_role_switch_register(struct device *parent, > > sw->dev.fwnode = desc->fwnode; > > sw->dev.class = role_class; > > sw->dev.type = &usb_role_dev_type; > > + sw->dev.driver_data = desc->driver_data; > How about use dev_set_drvdata()? will keep align with > usb_role_switch_set/get_drvdata(), Yes, makes sense. I'll change that. Thanks, -- heikki