Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10828102ybi; Thu, 25 Jul 2019 05:51:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzOGEBFoJE/8M82y91diOrzFtxiogeIlQZ+UHdhW1tHGg4bazc84cL3HRaovi7MnVD4eda X-Received: by 2002:a5d:8b52:: with SMTP id c18mr16932323iot.89.1564059079978; Thu, 25 Jul 2019 05:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564059079; cv=none; d=google.com; s=arc-20160816; b=OJNL/8Jk5dCM2+gmncAzu/eVCCjFOdHIIEek0+J0Ty1/5lJxX6FX7ogYYlbcAJvSND FnjkIMGYFnh4sz3aJX9zO5ieaX5HtgdyBgMl7ImLUcq2VN4AhoQ0Mb1xGwEy+rWsn9GF F44VRAWnPmka1TP0+GGtPSFP2p0/iFnuLk3MU41yHGRkJlhqmyueMhuxyPTM/5uMd3dj tNXBoQyeq5Yl+GcwnpjPsdJoLVIVu8nbyhDPsiIaqt1OFDdHWnZMewlFGleDZ25XOgDa ub2c16fPY9FU4MSVWvLFwYNKZBNzmMwb0oykh5EZ2gVGro5+AVr1gED7FlS44u1AW+z2 9lBQ== 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; bh=gCNfEjfN4gI+L5+Qe45XM5lLDNBSUwN/lG/nkldDbeo=; b=wpzu7+QIfq576pvt3v+vJuoS4ndDCQ1WlNdY6DCcPC9LrRVMcId4zuVA21J+0fniy4 2Vc1idBPS+7qN78aPWOiS/25qlxaa8VUU4siVBUrWVcA3690Tn8qSOXG9r1TheBw9odK QcthkuBleySNuTbUjEMgAWbTz9p3UsUW0ByuIck4xodrU9bAj6/1kF9/VAPUdC/hvc9+ CCvIWNe9wnv3qLOqFl3qoE793Pc3xCEc7jz9yi3Q+e1J7NfInTav1bwUg4MOrCBN44Qz IJzoZy8Sko3KYSWATq9FoMB7YNR6kAeR37rJEdypwLm1Nkzx9ON4Hud0S3YXxWrRXrA1 JtQg== 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 w3si62923008iot.79.2019.07.25.05.51.07; Thu, 25 Jul 2019 05:51:19 -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; 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 S2390314AbfGYJQr (ORCPT + 99 others); Thu, 25 Jul 2019 05:16:47 -0400 Received: from mga01.intel.com ([192.55.52.88]:23947 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390290AbfGYJQr (ORCPT ); Thu, 25 Jul 2019 05:16:47 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 02:16:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,306,1559545200"; d="scan'208";a="369585957" Received: from eunjooki-mobl.ger.corp.intel.com (HELO kekkonen.fi.intel.com) ([10.249.33.131]) by fmsmga006.fm.intel.com with ESMTP; 25 Jul 2019 02:16:44 -0700 Received: by kekkonen.fi.intel.com (Postfix, from userid 1000) id E6B6222086; Thu, 25 Jul 2019 12:14:06 +0300 (EEST) Date: Thu, 25 Jul 2019 12:14:06 +0300 From: Sakari Ailus To: Chuhong Yuan Cc: "Cao, Bingbu" , "Zhi, Yong" , Mauro Carvalho Chehab , Akihiro Tsukada , "linux-media@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] media: pci: Use dev_get_drvdata where possible Message-ID: <20190725091406.GB2335@kekkonen.localdomain> References: <20190723115014.18537-1-hslester96@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 24, 2019 at 09:23:41AM +0800, Chuhong Yuan wrote: > On Tue, Jul 23, 2019 at 10:39 PM Cao, Bingbu wrote: > > > > > > > > ________________________ > > BRs, > > Bingbu Cao > > > > > > -----Original Message----- > > From: Chuhong Yuan > > Sent: Tuesday, July 23, 2019 7:50 PM > > Cc: Zhi, Yong ; Sakari Ailus ; Cao, Bingbu ; Mauro Carvalho Chehab ; Akihiro Tsukada ; linux-media@vger.kernel.org; linux-kernel@vger.kernel.org; Chuhong Yuan > > Subject: [PATCH] media: pci: Use dev_get_drvdata where possible > > > > Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. > > > > Signed-off-by: Chuhong Yuan > > --- > > drivers/media/pci/intel/ipu3/ipu3-cio2.c | 3 +-- > > drivers/media/pci/pt1/pt1.c | 6 ++---- > > drivers/media/pci/pt3/pt3.c | 6 ++---- > > 3 files changed, 5 insertions(+), 10 deletions(-) > > > > diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c > > index c1d133e17e4b..50a34bcd4d14 100644 > > --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c > > +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c > > @@ -2000,8 +2000,7 @@ static int __maybe_unused cio2_suspend(struct device *dev) > > > > static int __maybe_unused cio2_resume(struct device *dev) { > > - struct pci_dev *pci_dev = to_pci_dev(dev); > > - struct cio2_device *cio2 = pci_get_drvdata(pci_dev); > > + struct cio2_device *cio2 = dev_get_drvdata(dev); > > > > Thanks for your patch. > > I think using pci_get_drvdata() here mainly make a pair with the pci_set_drvdata() in probe. > > Thanks for your reply. > I will change pci_set_drvdata() to dev_set_drvdata() in the next > version to keep their consistency. Sorry guys; I like this one better. These pci_*() functions are just wrappers around the dev_*() equivalents; you can use the one you like at any given occasion. In this case the pci prefixed one is more convenient. -- Kind regards, Sakari Ailus sakari.ailus@linux.intel.com