Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8803817ybi; Tue, 23 Jul 2019 15:37:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzB0nu7zyMXuZdIeoihhXN3HxbdBJxlez7hQM1OLRPLzPYPB88Q1kegNdo7pjoCuNZ3JTGo X-Received: by 2002:a62:cd45:: with SMTP id o66mr8149764pfg.112.1563921463542; Tue, 23 Jul 2019 15:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563921463; cv=none; d=google.com; s=arc-20160816; b=H/bq2XGgEXIMR/Cy9xoHhOw62eLj5nokQkzytnXHleEZ4PhBr3XbyQddxBVYisd0s/ KxXvUXeSQ5J97SSc+Omfdn6YagFHdG6hN1sVoBFTNwefcg3NC56P5jtyQwAvk/cv6dm9 WatDEOE1WR7+044uenUv/3QFw+BSaIkMrii84fe02K5JE6gGTE+aCfjRzzdWY8xghs4+ FHWpuARKNyYvmLxutSQWprzVaul6pxY4tAD6YZw0SXpPkjrk3/yn/nsEgvz6PKeK5R1t ojP2y/JrOnciWLzT++QENyJSZrMVHpw/uoSCj1o9ddf8nBpXJ5nJNOk5PonevHf3BORR TRWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=YvPnEK3SdKCAjuBX9biBCB7NVxnEYLiW7bXQBnDMmug=; b=oYCBt8qMz0GnMaeJl7bjvXUEzG33SlxY32p/YnZ9T0+kQ/s1arFmDLjgdw4kWkcXRp E7FkCnxYbq8GICJ9HnWfGsJyndXpF+/4Ce6NX1XOmI4S1e44DyIjKwFP/s7ceh2NheUR n8tlh8aS7HEuTxJpr3kS+d58wXoJocrbLKHfoRfQmHzCiyW4YdvdyxgNmXeAZn+6XNr5 s+NpxRe8D6fhsJQ4VC1Yl9VqemYGBTE+PNpD7oOHkyPPqtGqM2eABA2TkNyE+e0eKDp8 0vkll4MHhuciZQqY0l5gl9K21nJsjZPE5nYchNmRaCsVauHXf481V2zwWi+tU56Ku1La BBqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=aeafSVZv; 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=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 n123si13353393pgn.151.2019.07.23.15.37.25; Tue, 23 Jul 2019 15:37:43 -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=fail header.i=@gmail.com header.s=20161025 header.b=aeafSVZv; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387803AbfGWLvI (ORCPT + 99 others); Tue, 23 Jul 2019 07:51:08 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:35171 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387759AbfGWLvI (ORCPT ); Tue, 23 Jul 2019 07:51:08 -0400 Received: by mail-pf1-f194.google.com with SMTP id u14so19045058pfn.2 for ; Tue, 23 Jul 2019 04:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YvPnEK3SdKCAjuBX9biBCB7NVxnEYLiW7bXQBnDMmug=; b=aeafSVZv6bp61rtpugTLNYFumeoxNXomiqF7jkupIYTNhO2Ot76Zu4sYtmhAq8TWX0 Ye5Krtmc0lE3NeSUmpQPVcZIg6dyY4DTMDrvDQ2UNj9Bp+7Tiy6i73GaA8HjZwx37sl/ cEZaWMzbOF4UEGrFr49gTyvtW+DjAFaV/DgwHviIoEOXnVhMnacbaDiBMpPguGFdzV9n Ape3asxJIyVEhqBnWEzbj4kqV+bGdBW/Cm6yevmNf88qnPDcrFRRfOkDKllRpuUKxjyc nIU6QebT8IrprUcP4UKsZVJXqJ3iyhQxQLxToGJBYqAPLT6TTb6gAV9sg9ZEguIxDVBR m6kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YvPnEK3SdKCAjuBX9biBCB7NVxnEYLiW7bXQBnDMmug=; b=PTNFdW4HJhcTg8ki5YDSwBeXraJgN2o4rnDH7++PitIGybkUNpNF+YzknO0vqLZsml FfI3THM7dym6gv0Vpz8vpcNA3IYW2Q5LuPd3litHF7BWY9vDPbBKNegNj8qAwhtoX0fh qk7cnhMROId2o7Y9HE2nfxuF5bYZ4GVeE6iM1bFjxM0WKZswUuzcd3pq43tBIAAbjvCu 2vm0/2Am3DRoFOqfaDbfMeojzNRuGCpBgN6QdbW0pY7izQpYnNhe4+fwl4eJQ+IeIIik Ix6QC1DiNb1nkMPa5VPIV4W6o05qfYoGh0vhOmv0vnw3BAfqFCPtkbUsdrbF6vUIVsS9 dOyQ== X-Gm-Message-State: APjAAAU2FiIZkP9KsldHMEo0xGc9tCGh3X3RgP2J8S5VlKN266V8kGNa NJCIs4ajfF4yj5UkysbVq+8= X-Received: by 2002:aa7:8c52:: with SMTP id e18mr5592458pfd.233.1563882668054; Tue, 23 Jul 2019 04:51:08 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id z20sm67878647pfk.72.2019.07.23.04.51.06 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 04:51:07 -0700 (PDT) From: Chuhong Yuan Cc: Lee Jones , linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] mfd: timberdale: Use dev_get_drvdata Date: Tue, 23 Jul 2019 19:51:03 +0800 Message-Id: <20190723115103.18647-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/mfd/timberdale.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c index 60c122e9b39f..faecbca6dba3 100644 --- a/drivers/mfd/timberdale.c +++ b/drivers/mfd/timberdale.c @@ -626,8 +626,7 @@ static const struct mfd_cell timberdale_cells_bar2[] = { static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr, char *buf) { - struct pci_dev *pdev = to_pci_dev(dev); - struct timberdale_device *priv = pci_get_drvdata(pdev); + struct timberdale_device *priv = dev_get_drvdata(dev); return sprintf(buf, "%d.%d.%d\n", priv->fw.major, priv->fw.minor, priv->fw.config); -- 2.20.1