Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8791563ybi; Tue, 23 Jul 2019 15:20:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzb/KZzLEiQsThwp2Bx1Xf2bTqenG6azLUWZS0lxobV/nKopCDcLXvIpyOxXo2ODcv+Hx0r X-Received: by 2002:aa7:9591:: with SMTP id z17mr8044338pfj.215.1563920428599; Tue, 23 Jul 2019 15:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563920428; cv=none; d=google.com; s=arc-20160816; b=bjRBbRodIsZQf39FWlgf8cfF11PkFTCAs2S+omDVvm6jNUU3aQDgEgYjNZXnZYcnuc pNUvs5NvEVxo+2U6JYRQpGIMfGg25xhjKMXf/nlR5D6cTlXY7BPLtsHVXtQG0HJFGsp3 laGP+UOXSdNeMrw5okv53gn69Drv3HdEaNC8I4MkBNuV3BaNeNW/RzXHvohuuedBAEsc rxsyuhNon0vNoy3AlpwkXqe8VFM2fmq+zinqDnvmvtMeVozjcy7IoDRHHJ0kXplt7Wt5 inLePW/k5iCkdhXTB1pTKCi0iYWB9saFfxpVR1+VqD5odyHCYznsJjG1fdbopYIyDHQP pazQ== 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=DGvbd2q6eGtnWqAZsNzO8Yn4NZ3NS3NJ9Bz/BH58Y+c=; b=L9d43xQGo1aLdqLLf84kWuupvl0ZWYBwGECzM0K2t63VnH2JpHMKSHkOSMMRLu1okO 5uNaujiaav0g8tmnN1taTIs+BdXZDIps+eqc4Dgoq1/jsacpsK/GgGOQVdarKrqLAIwa dzeTR0JlwJtmmbFqnvGvKVLD/2gRUeGV4Pxr6s1YK6gNW3V8NV7yj6vKmyNf8crywG0z WNyAEbjCEcP5GcLVO3B+hLJIeD4kRPgLkUPuVLfYOnYTjEgyX9xFhJwVg5dMFLtOWS8G MzWggFd1n4VzK9MS3u+JRwxKVV+N3P8KDIdJIUvzoFEOYIYitM4ss5Khwbj6eVcSXNZZ aQkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YQXvudmh; 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 s1si13753722pgr.112.2019.07.23.15.20.12; Tue, 23 Jul 2019 15:20:28 -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=YQXvudmh; 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 S2387685AbfGWLt6 (ORCPT + 99 others); Tue, 23 Jul 2019 07:49:58 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40597 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729103AbfGWLt6 (ORCPT ); Tue, 23 Jul 2019 07:49:58 -0400 Received: by mail-pg1-f195.google.com with SMTP id w10so19319566pgj.7; Tue, 23 Jul 2019 04:49:57 -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=DGvbd2q6eGtnWqAZsNzO8Yn4NZ3NS3NJ9Bz/BH58Y+c=; b=YQXvudmhXOHyhL2x/1WiQQqxEMf+Cr9awQOk0uSKa0PW3zkpfkEvG+ukhVkjCv7u6S PG15yQbkRc97wV1/bJwd8xfn9s5dGb25jWrX8Qci3QVQJkWE1T0UtR/HWKk6JHzkt18z gDbmxDaPCSuqzAhpT67rYjNetdTR0QL4itRE1Dx8iSW+GL5i89gIEzaqdjH0XQY38aFB w2cEmQyQSHOo20dyVuoVNO7UDs3LfHFs/eshwn7a3Hrtj14KyblIVMlf9kcFAMNxRdLc We+Pm1wokR3Md1bg7Gk2IZJ2Pe7jkhdfhhY5WUssXvc43deigQ1zcszBT9SXbg779A3g QTJQ== 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=DGvbd2q6eGtnWqAZsNzO8Yn4NZ3NS3NJ9Bz/BH58Y+c=; b=lkKMAf571eEa8rdXFzZto2q/9+PJGgVoyZtNom5FhbACt/QNK8/2Z8UpSrU1i1GzOo 6kUaRwbUn4fffZHTUu5NJYfvoQQWBTeTjDCmaqN7WE4rpli8oCbEAulgf/LidzPplHJ/ 25+lHT9NuphPwh62JaaSH2OKsw68dJErEMEpUanr9lm7my2XH82BYr3CzcA6sLOhG3VW frjg9Ay0CMiFfz8O/vWhRUtojCzaXvyI4qo086eLdk8xvEShby/cr3KlJpRHobCdZnnv BXlYNe59NPkm6+CwDIhYhBytDbxX7hewaqFGapVdUTTmNhNLvuhVSupkTALfpug3doXW lbYw== X-Gm-Message-State: APjAAAXc0C/oAIZIQ2aqed+N5vgJ6TRtTpdUotv3STTjeHRhXFv70180 f0xv5KZtjdG6AaCiIH8PpIU= X-Received: by 2002:a17:90a:26e4:: with SMTP id m91mr82196367pje.93.1563882597619; Tue, 23 Jul 2019 04:49:57 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id s5sm16985795pfm.97.2019.07.23.04.49.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 04:49:57 -0700 (PDT) From: Chuhong Yuan Cc: "David S . Miller" , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] ide: Use dev_get_drvdata where possible Date: Tue, 23 Jul 2019 19:49:52 +0800 Message-Id: <20190723114952.18483-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/ide/siimage.c | 3 +-- drivers/ide/via82cxxx.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/ide/siimage.c b/drivers/ide/siimage.c index 57eea5a9047f..c4b20f350b84 100644 --- a/drivers/ide/siimage.c +++ b/drivers/ide/siimage.c @@ -648,8 +648,7 @@ static void sil_quirkproc(ide_drive_t *drive) static void init_iops_siimage(ide_hwif_t *hwif) { - struct pci_dev *dev = to_pci_dev(hwif->dev); - struct ide_host *host = pci_get_drvdata(dev); + struct ide_host *host = dev_get_drvdata(hwif->dev); hwif->hwif_data = NULL; diff --git a/drivers/ide/via82cxxx.c b/drivers/ide/via82cxxx.c index 977cb00398b0..63a3aca506fc 100644 --- a/drivers/ide/via82cxxx.c +++ b/drivers/ide/via82cxxx.c @@ -175,8 +175,7 @@ static void via_set_speed(ide_hwif_t *hwif, u8 dn, struct ide_timing *timing) static void via_set_drive(ide_hwif_t *hwif, ide_drive_t *drive) { ide_drive_t *peer = ide_get_pair_dev(drive); - struct pci_dev *dev = to_pci_dev(hwif->dev); - struct ide_host *host = pci_get_drvdata(dev); + struct ide_host *host = dev_get_drvdata(hwif->dev); struct via82cxxx_dev *vdev = host->host_priv; struct ide_timing t, p; unsigned int T, UT; -- 2.20.1