Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9719644ybi; Wed, 24 Jul 2019 08:49:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaaJ1VJsBoRCUaTvhZXwRS0fDG1A+3eaYrnCW+eSKdE1xOvYf25MolyxCt8SDnDnEnvj0s X-Received: by 2002:a17:902:8b88:: with SMTP id ay8mr83765387plb.139.1563983343293; Wed, 24 Jul 2019 08:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563983343; cv=none; d=google.com; s=arc-20160816; b=ZgxoQBHYJ7mD2cmRuZbeNemdovp7WjNnQ3JcwUi+vrFZezDf1dJBowXeg9+n5Ezy5a hhCR8JYZ7KgoLggIQVMb6XWWlu+/pXQUgYwUkuyATw9hIT+arRnjFln8Cep9Bwh8iR8a DSCpW9WgxmpKzoOBuISbIMCDIY4k1IowSEZXXincpO5dxmIcwBTYwxhaXakN4QGUXe/q 74mXdTTNBZ81BvfpN/708Xv5lj0ykm6FH1HaSjOyA+5O/aX3SRpS8CRX3L4Xc0ffdvD6 lUdV8fhX60nR/5ByOUUShKPlvYCWiOH2Eyw+fp8quT0qFSXwhxSR6r0//pEzU9LyArbY Z/aQ== 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=4kkTN4o8gPv18UXfrNrZcVCeVXmsSsSWboY29+wX+V8=; b=HncoQipPHUZ1cz2En16wBZbGaess9bqErbNAVW6lLeQsm6ab/wo/hgKykz8kSYZF/7 v5rIANW9WOlrq0bC9YA7TGk3Das9JEG8moWa05y48/8LkW1GDCMOq+NKaPf1HdWUeCG0 sVM6ang+vgJ2/0QYH1+A7P0Il5iJGO+icWrU3pluCLQd0ZadM4DOZM0OQzBLz5J4Y8/g iFOufovRlfrY5uFvL02nPA0MjajxdaVfYrqMh6qyg7FMRKkFRSLYVrcuiEE5w/HHJdyO oh1RBwG9LVxaygUqMJapMloCBfnS/76Gl6Pf03JbEnNee2+VK6GC2HtWGqCm+RmSsxFv WpHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=JJ6yebjm; 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 c1si13542031pgw.444.2019.07.24.08.48.48; Wed, 24 Jul 2019 08:49:03 -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=JJ6yebjm; 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 S1728277AbfGXMXO (ORCPT + 99 others); Wed, 24 Jul 2019 08:23:14 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:37935 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbfGXMXO (ORCPT ); Wed, 24 Jul 2019 08:23:14 -0400 Received: by mail-pf1-f196.google.com with SMTP id y15so20883291pfn.5 for ; Wed, 24 Jul 2019 05:23:13 -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=4kkTN4o8gPv18UXfrNrZcVCeVXmsSsSWboY29+wX+V8=; b=JJ6yebjmJokjhDI20Vieo630GcwLCU7ZRiF3g5jF9s4ZR9/ul1OA+3LjBpMkbKxKTA IUZXR7Fsfwi6Sur49qmnNX5WYaT9SYpn7Bv5kZuLA3aNqmCAEABgICibEpbaAjDreFVQ U8Ij6eaieHbBgliqa6zPYOB0ii+1Yk6VXDLgxZekciUg0wD/TyGLxpmmVCjp5lIbOu3P oIB8exxyNWqxJo+tM9eAxbmD4TBVxuyirNjPpV+h6Uh5V8mWefsS3HpsE/G5+HAETgXi G9bU97WjVOz1tSQLD9/eiA8AbSwLXFCjXckqTvQZjxC9mA/0bt3tRQgJ91UImD2wraKl yf3A== 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=4kkTN4o8gPv18UXfrNrZcVCeVXmsSsSWboY29+wX+V8=; b=mxx9IhV/u08IA6cIlE3C9TS0OQuZy9P5takcMlsB6oXDjdgyj6O9usIl7i38vym6R8 AOaP3NtVmSf2AiMAH1Cd0rLT5RNogUJxARZWlQZOAHelO2uRQvpduf4Pk97kt5/P4zRe G/VYEX9O45KD5queQ/N885wbtkiMs3cPP3Ui9v+b+7b3JzMAQ6gqQVbpbLXPav58tYY2 JpiSJRkVXMGG94qU7+wH4gJUDc3N0z5tTSmxF1+mPVWMtE53ViKj104Uxdqml4GTgP95 DsBZ98SfH4g6VqEuYy7a5tnQF+ostjDQwhjmQJY/JO9eypgZKE2JTDwLsG34Sci4knO7 z/yg== X-Gm-Message-State: APjAAAU5Mda6OH56IdPHJgirgBylKFnaZRxx/tMJbBkT8+FY0riMS3IO dXIZAyorkzmsw+cE1Bxis+w= X-Received: by 2002:a65:6284:: with SMTP id f4mr23444983pgv.416.1563970993410; Wed, 24 Jul 2019 05:23:13 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id br18sm38834953pjb.20.2019.07.24.05.23.11 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 05:23:12 -0700 (PDT) From: Chuhong Yuan Cc: Dominik Brodowski , linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] pcmcia: Use dev_get_drvdata where possible Date: Wed, 24 Jul 2019 20:23:08 +0800 Message-Id: <20190724122308.21747-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/pcmcia/yenta_socket.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 810761ab8e9d..49b1c6a1bdbe 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -173,8 +173,7 @@ static void exca_writew(struct yenta_socket *socket, unsigned reg, u16 val) static ssize_t show_yenta_registers(struct device *yentadev, struct device_attribute *attr, char *buf) { - struct pci_dev *dev = to_pci_dev(yentadev); - struct yenta_socket *socket = pci_get_drvdata(dev); + struct yenta_socket *socket = dev_get_drvdata(yentadev); int offset = 0, i; offset = snprintf(buf, PAGE_SIZE, "CB registers:"); -- 2.20.1