Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8968129ybi; Tue, 23 Jul 2019 19:07:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2a1i9Lje6LnfUHv6C9Zmks/68Ly8x2gidM3VUJeS7kpOj51xYHgPm1uyQZ1GXyY+yf5Wn X-Received: by 2002:a17:902:ff05:: with SMTP id f5mr80785645plj.116.1563934034233; Tue, 23 Jul 2019 19:07:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563934034; cv=none; d=google.com; s=arc-20160816; b=ceT8ZwLWUg3lGjm6LdwX6wTJ0VWwXlMS6u9IRLXHVsDB3p0i+zsDn3EpMAFEJD3A9B dY6dHpAUQ+W9W7ZhEYymO3FztEdVF7e8g5OQRuk0mrlmHewaB2iknCDZmrYS7tGnXbMj mumMlyzDg8EeQ0oZ9gCmati64gfTVdckiIilDHafD0nPXXa23YxP/QPumY6Jev91ELdo mGMsYi14lQAfewzm4YMzlAYCU2p65w6GYmZfv27ghPZTOxlQ/VCwVse+7QeZtYG2C2oY hXXrMRiad6DGQK5SSeteslRT0L6pf0yYXET58dzLB5DVYBeMPQQAsrbxNQDq8l06Urco 0zAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=2LM8ziNL3CjgvMJTgYt5n9A1u1GBpSBnH6t18zKFSsY=; b=wZJxXSFLJ7xb+l+zUO03lfh+vFcTmbCC2EP5upPWNTo7kK4BJisBB8Qxn57v4OYelN nGcPooF0e86IAISHD1yLkSU+INTYTpAqJBzgZCwWT6GZ78tkfaiKsts0OBxzkBNJr9Kz 5+0OJf9HykSFSeK/E/4u6dnZ+mAHyV0Yb++8qsgzndOQdYnXBcRzNEok2Q5PT88Sq41g d+GWrueArqmSm0SppFMOAdNN/MsPrq98AXcIsunpLupWX5y7uw5boEsNQlqFW+CUBavp j++iHoSXgCQ6EJcgzAjkU9NnXO+JiuGZo8OkvnfCBhnUERxVnfjwDN5c9xYsWfy4+XEQ bAyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="dxwu/bjd"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u71si14262878pgd.279.2019.07.23.19.06.58; Tue, 23 Jul 2019 19:07:14 -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=@gmail.com header.s=20161025 header.b="dxwu/bjd"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391466AbfGWSYp (ORCPT + 99 others); Tue, 23 Jul 2019 14:24:45 -0400 Received: from mail-ua1-f66.google.com ([209.85.222.66]:46216 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391458AbfGWSYo (ORCPT ); Tue, 23 Jul 2019 14:24:44 -0400 Received: by mail-ua1-f66.google.com with SMTP id o19so17343826uap.13 for ; Tue, 23 Jul 2019 11:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2LM8ziNL3CjgvMJTgYt5n9A1u1GBpSBnH6t18zKFSsY=; b=dxwu/bjdyI5X0wkqDq4wvOZ2cgg85jGFAhDCjX4xY961JAzWPrWz8jRCox4IeAiTQe htUEExMwEN2xa6pU0eeuHLmFtROYIvA+KY46RqTVDKL0DMNG8f/ZrZYx4kQFKSROfM9D anTaec2xnlEoQZ3jLHkriu6aeuYEmnWZypEGlnHDGCGddHoYWW43+wqBeZC51eebDMuK nnY2IXNtXVImBNX1JSwDacrvAIdkb+37L6l7QRTlm2nKDmiDqAx2vSwVoBWNQclf938l 9YGv8FSVg2QH/MbGx3RLtS2tYQtMwJ2+5LC1okLfHry+M2pSh3ccGC53S5pzUUEaXkYt eRaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2LM8ziNL3CjgvMJTgYt5n9A1u1GBpSBnH6t18zKFSsY=; b=BVsAfE20AfGQ1AK6w1TO/vLQZcZb5RM+xdgI6nJmlmn41Yj7VzPdsjg/jCAR1O0x/D ftYbKc/fEp/WGsXEV05YD7pjOCXJsUPcKAfNWL8jkKiOxL+g/18YqDurtlbDP4FpHcwk IJjxTDI5LXqJuBfn63bbNCJM1AwEnMiZrRE0hlxgED0EEwBdQfdA8g5dfVWnACRTtZV8 pg70SSOJYytS6/tp2vOfLUEIJo8uQQl/m0HVxnTpGkOPq4urgc97mhJFOAwcuY2xYuxa mGM8QKj+yIh9y3eiu5ny+lOn6vhFRCqEMoq+hFueU3cpV58HERaQid14vh9Nnw0TZPfm Ek0g== X-Gm-Message-State: APjAAAUrTLO1hpyOM/yaO75A3LRrg24/Y43/mmsLDkfT5drSybj/5maW TujbVfhehKX5rrA/1zAiCmq/mnvVaHfjfL1uz58= X-Received: by 2002:ab0:6798:: with SMTP id v24mr20659759uar.43.1563906283854; Tue, 23 Jul 2019 11:24:43 -0700 (PDT) MIME-Version: 1.0 References: <20190723124608.24617-1-hslester96@gmail.com> In-Reply-To: <20190723124608.24617-1-hslester96@gmail.com> From: Oded Gabbay Date: Tue, 23 Jul 2019 21:24:18 +0300 Message-ID: Subject: Re: [PATCH v2] habanalabs: Use dev_get_drvdata To: Chuhong Yuan Cc: Arnd Bergmann , Greg Kroah-Hartman , "Linux-Kernel@Vger. Kernel. Org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 23, 2019 at 3:46 PM Chuhong Yuan wrote: > > Instead of using to_pci_dev + pci_get_drvdata, > use dev_get_drvdata to make code simpler. > > Signed-off-by: Chuhong Yuan > --- > Changes in v2: > - Split v1 into different subsystems > > drivers/misc/habanalabs/habanalabs_drv.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/misc/habanalabs/habanalabs_drv.c b/drivers/misc/habanalabs/habanalabs_drv.c > index 6f6dbe93f1df..678f61646ca9 100644 > --- a/drivers/misc/habanalabs/habanalabs_drv.c > +++ b/drivers/misc/habanalabs/habanalabs_drv.c > @@ -295,8 +295,7 @@ void destroy_hdev(struct hl_device *hdev) > > static int hl_pmops_suspend(struct device *dev) > { > - struct pci_dev *pdev = to_pci_dev(dev); > - struct hl_device *hdev = pci_get_drvdata(pdev); > + struct hl_device *hdev = dev_get_drvdata(dev); > > pr_debug("Going to suspend PCI device\n"); > > @@ -310,8 +309,7 @@ static int hl_pmops_suspend(struct device *dev) > > static int hl_pmops_resume(struct device *dev) > { > - struct pci_dev *pdev = to_pci_dev(dev); > - struct hl_device *hdev = pci_get_drvdata(pdev); > + struct hl_device *hdev = dev_get_drvdata(dev); > > pr_debug("Going to resume PCI device\n"); > > -- > 2.20.1 > This patch is: Reviewed-by: Oded Gabbay And pushed to -next Thanks, Oded