public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
To: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Bart Van Assche <bvanassche@acm.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Wang <peter.wang@mediatek.com>,
	Bean Huo <beanhuo@micron.com>, Can Guo <can.guo@oss.qualcomm.com>,
	Archana Patni <archana.patni@intel.com>,
	Markus Schneider-Pargmann <msp@baylibre.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] ufs: Rework pci_device_id initialization
Date: Tue,  5 May 2026 10:25:43 +0200	[thread overview]
Message-ID: <cover.1777968942.git.u.kleine-koenig@baylibre.com> (raw)

Hello,

the patches in this series adapt the pci_device_id arrays of two ufs
drivers. These are preparing a change for making struct
pci_device_id::driver_data an anonymous union (similar to
https://lore.kernel.org/all/cover.1776579304.git.u.kleine-koenig@baylibre.com/).
This requires named initializers for .driver_data. But even without that
this is a nice cleanup making the array better readable and consistent.

The benefit for the union is that it allows to do:

-	{ PCI_VDEVICE(REDHAT, 0x0013), .driver_data = (kernel_ulong_t)&ufs_qemu_hba_vops },
+	{ PCI_VDEVICE(REDHAT, 0x0013), .driver_data_ptr = &ufs_qemu_hba_vops },

and

-	hba->vops = (struct ufs_hba_variant_ops *)id->driver_data;
+	hba->vops = id->driver_data_ptr;

. This involves less casting and thus makes usage of driver_data a bit
more type safe. And this will make it obvious that the ufshcd-pci driver
lacks a few consts.

Best regards
Uwe

Uwe Kleine-König (The Capable Hub) (2):
  ufs: tc-dwc-g210-pci: Simplify initialization of pci_device_id array
  ufs: ufshcd-pci: Use PCI_VDEVICE and named initializers for pci array

 drivers/ufs/host/tc-dwc-g210-pci.c |  4 ++--
 drivers/ufs/host/ufshcd-pci.c      | 29 ++++++++++++++---------------
 2 files changed, 16 insertions(+), 17 deletions(-)


base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
-- 
2.47.3


             reply	other threads:[~2026-05-05  8:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05  8:25 Uwe Kleine-König (The Capable Hub) [this message]
2026-05-05  8:28 ` [PATCH 1/2] ufs: tc-dwc-g210-pci: Simplify initialization of pci_device_id array Uwe Kleine-König (The Capable Hub)
2026-05-05  8:28 ` [PATCH 2/2] ufs: ufshcd-pci: Use PCI_VDEVICE and named initializers for pci array Uwe Kleine-König (The Capable Hub)
2026-05-05  9:25   ` Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1777968942.git.u.kleine-koenig@baylibre.com \
    --to=u.kleine-koenig@baylibre.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=adrian.hunter@intel.com \
    --cc=archana.patni@intel.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=can.guo@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=msp@baylibre.com \
    --cc=peter.wang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox