Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

auxbus: make to_auxiliary_drv accept and return a constant pointer

In the quest to make struct device constant, start by making
to_auxiliary_drv() return a constant pointer so that drivers that call
this can be fixed up before the driver core changes.

As the return type previously was not constant, also fix up all callers
that were assuming that the pointer was not going to be a constant one
in order to not break the build.

Cc: Dave Ertman <david.m.ertman@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: Bingbu Cao <bingbu.cao@intel.com>
Cc: Tianshu Qiu <tian.shu.qiu@intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Tariq Toukan <tariqt@nvidia.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: Daniel Baluta <daniel.baluta@nxp.com>
Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: linux-media@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: intel-wired-lan@lists.osuosl.org
Cc: linux-rdma@vger.kernel.org
Cc: sound-open-firmware@alsa-project.org
Cc: linux-sound@vger.kernel.org
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> # drivers/media/pci/intel/ipu6
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Martin Habets <habetsm.xilinx@gmail.com>
Link: https://lore.kernel.org/r/20240611130103.3262749-7-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+13 -13
+4 -4
drivers/base/auxiliary.c
··· 180 180 static int auxiliary_match(struct device *dev, struct device_driver *drv) 181 181 { 182 182 struct auxiliary_device *auxdev = to_auxiliary_dev(dev); 183 - struct auxiliary_driver *auxdrv = to_auxiliary_drv(drv); 183 + const struct auxiliary_driver *auxdrv = to_auxiliary_drv(drv); 184 184 185 185 return !!auxiliary_match_id(auxdrv->id_table, auxdev); 186 186 } ··· 203 203 204 204 static int auxiliary_bus_probe(struct device *dev) 205 205 { 206 - struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver); 206 + const struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver); 207 207 struct auxiliary_device *auxdev = to_auxiliary_dev(dev); 208 208 int ret; 209 209 ··· 222 222 223 223 static void auxiliary_bus_remove(struct device *dev) 224 224 { 225 - struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver); 225 + const struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver); 226 226 struct auxiliary_device *auxdev = to_auxiliary_dev(dev); 227 227 228 228 if (auxdrv->remove) ··· 232 232 233 233 static void auxiliary_bus_shutdown(struct device *dev) 234 234 { 235 - struct auxiliary_driver *auxdrv = NULL; 235 + const struct auxiliary_driver *auxdrv = NULL; 236 236 struct auxiliary_device *auxdev; 237 237 238 238 if (dev->driver) {
+1 -1
drivers/media/pci/intel/ipu6/ipu6-bus.h
··· 21 21 22 22 struct ipu6_bus_device { 23 23 struct auxiliary_device auxdev; 24 - struct auxiliary_driver *auxdrv; 24 + const struct auxiliary_driver *auxdrv; 25 25 const struct ipu6_auxdrv_data *auxdrv_data; 26 26 struct list_head list; 27 27 void *pdata;
+2 -2
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
··· 239 239 240 240 adev = &aux_priv->aux_dev; 241 241 if (adev->dev.driver) { 242 - struct auxiliary_driver *adrv; 242 + const struct auxiliary_driver *adrv; 243 243 pm_message_t pm = {}; 244 244 245 245 adrv = to_auxiliary_drv(adev->dev.driver); ··· 277 277 278 278 adev = &aux_priv->aux_dev; 279 279 if (adev->dev.driver) { 280 - struct auxiliary_driver *adrv; 280 + const struct auxiliary_driver *adrv; 281 281 282 282 adrv = to_auxiliary_drv(adev->dev.driver); 283 283 edev->en_state = bp->state;
+1 -1
drivers/net/ethernet/intel/ice/ice_ptp.c
··· 2784 2784 ice_ptp_aux_dev_to_owner_pf(struct auxiliary_device *aux_dev) 2785 2785 { 2786 2786 struct ice_ptp_port_owner *ports_owner; 2787 - struct auxiliary_driver *aux_drv; 2787 + const struct auxiliary_driver *aux_drv; 2788 2788 struct ice_ptp *owner_ptp; 2789 2789 2790 2790 if (!aux_dev->dev.driver)
+2 -2
drivers/net/ethernet/mellanox/mlx5/core/dev.c
··· 349 349 { 350 350 struct mlx5_priv *priv = &dev->priv; 351 351 struct auxiliary_device *adev; 352 - struct auxiliary_driver *adrv; 352 + const struct auxiliary_driver *adrv; 353 353 int ret = 0, i; 354 354 355 355 devl_assert_locked(priv_to_devlink(dev)); ··· 406 406 { 407 407 struct mlx5_priv *priv = &dev->priv; 408 408 struct auxiliary_device *adev; 409 - struct auxiliary_driver *adrv; 409 + const struct auxiliary_driver *adrv; 410 410 pm_message_t pm = {}; 411 411 int i; 412 412
+1 -1
include/linux/auxiliary_bus.h
··· 203 203 return container_of(dev, struct auxiliary_device, dev); 204 204 } 205 205 206 - static inline struct auxiliary_driver *to_auxiliary_drv(struct device_driver *drv) 206 + static inline const struct auxiliary_driver *to_auxiliary_drv(const struct device_driver *drv) 207 207 { 208 208 return container_of(drv, struct auxiliary_driver, driver); 209 209 }
+2 -2
sound/soc/sof/sof-client.c
··· 357 357 358 358 int sof_suspend_clients(struct snd_sof_dev *sdev, pm_message_t state) 359 359 { 360 - struct auxiliary_driver *adrv; 360 + const struct auxiliary_driver *adrv; 361 361 struct sof_client_dev *cdev; 362 362 363 363 mutex_lock(&sdev->ipc_client_mutex); ··· 380 380 381 381 int sof_resume_clients(struct snd_sof_dev *sdev) 382 382 { 383 - struct auxiliary_driver *adrv; 383 + const struct auxiliary_driver *adrv; 384 384 struct sof_client_dev *cdev; 385 385 386 386 mutex_lock(&sdev->ipc_client_mutex);