Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp287592lqp; Wed, 12 Jun 2024 01:15:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUJSEHaXTW3cYdJaH0hLvWHDBooKsMitPWoRPJQ05OyZF+yFKR7LgoiRNyDhwSvfX77PLknr/Hyu2kwPia4wCGsBX0xbNlI1AidJ0T6qQ== X-Google-Smtp-Source: AGHT+IHPzMAxBW4KOlL3s06425RnppPNF86UbTpQO4HpTeFPw9iJWb44OIo/hm3KWPwH2Ee0g3EF X-Received: by 2002:a05:6102:b02:b0:48d:706f:a884 with SMTP id ada2fe7eead31-48d91de46e8mr1348599137.20.1718180128186; Wed, 12 Jun 2024 01:15:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718180128; cv=pass; d=google.com; s=arc-20160816; b=qdvbhooKh/QqeStFuBwNju6HgA05B6SQXle1wJec+rIpGZOtDLynY5zY3W1Btt8crw h80a70jup1xIx+rzBILfTEorSWc3+2OHSL0q2fYW98rnZkDadNkI34VRfM6xNED+miPv qGh43nmiN1mf8aor6+lhtd3EOPP18DxPqSYGYUCldRj4oE12SFc3e+kvz1kLPC7+tQV6 ZCXdbluMJtuAmgZZuqhDOxRX9EdqabgseVHXCZdBiWHfidWbmnrCzffxyclH9fiForep lX9sgZ/DXJcaTEWxX716GarzH+ig6VZGsYBdIQfePuAnsPsmaOGUx7IQbP0kowcQJ6EX oW8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=wXAjKTvBEAvP+svvitn9yofnK0X/5/4ahwWqCi/xEWA=; fh=KKtdA71iy893X44B6uQZHygU9KYrl9eFzAACLLsdBXg=; b=Niab6wx5zpB0uwbTENgv4MY2CYDVcPp3+bWQ1R4pIg5CxPsZb60WmVeH8WGJbRpaWK 19TNf/poOiqppS/TekLDbe4hLEXhNexxrB3Oi0+VmfMA0353TSV5rVDR+OQYSXUPouFR oBSzcmMmEnG3lLM1xnFq0SifAzGxygvADB/u5e9kYBYN/abBIF8l35ZW2QAewp0P25R4 aZOcuI72swtNB3mg/wmSzRs/0R/zWEl4QRzF7LhQQ/nIQDl+Ma4q4g8aOTwQgL3JQdwB UCrFJy3Tb/n35qyayHJ+Z1ToLsh32w6fe5VPMLBPHTjv8PA1Bb3vHC1EbWWEzYux/sQx bRog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=A2mSFth+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-211157-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211157-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-7954828c8ebsi1154197885a.281.2024.06.12.01.15.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 01:15:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211157-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=A2mSFth+; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-211157-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211157-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CF3431C239DF for ; Wed, 12 Jun 2024 08:15:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D7B216D329; Wed, 12 Jun 2024 08:15:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A2mSFth+" Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C80541FB5; Wed, 12 Jun 2024 08:15:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718180110; cv=none; b=u0i0v7yXJXX6iGCQyBSp+h0Cx5ZjfeSFvf1rUpbadkZ5MN/CWiydZyThDOyM6d3Qg20BswOuQTknFoeNo5MeqM6Nxds4y8B+Nont5LrP0kr4RkjxQ0xWdYgtTn9D9NXkj4yXWyTdOfDC1FJltGONozhVs+qrLth9D6OZS3MPRG4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718180110; c=relaxed/simple; bh=ptjoa9q63pGOGPnQ/n0kmQAoJ+aCRDrxJ5Ou5lbiPV8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HGk7endYihD4kQ32BRhgHs2sT/44diPPDMHy4xgbam7YopSGqAbZhf9L0AFNjGRko3FIsIJUgvdQHrBHxoeAMd50AYg5zeU4Nqd5J/g8QeQkZmCXzVdUnyLqtkJlkCxFlFgO9p0SM+U8pdnHimGUiFGjtCD1JUOF7UsAABo8/YE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A2mSFth+; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a6f09eaf420so417015466b.3; Wed, 12 Jun 2024 01:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718180106; x=1718784906; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=wXAjKTvBEAvP+svvitn9yofnK0X/5/4ahwWqCi/xEWA=; b=A2mSFth+Y5PxE1DZrMUgfZ5nEM+H423GMIfx96Zw53A9zr0ooe5mdXH61Lx/0RWP4T GCakmc3hKZ8opNFEFjkyZ3tLHLUWjDFSDwvUq/zdNlrPCOI6GbQzyOnzADPPizrXFB94 1EP1RS4O1SYdPRiI4wygJKV9WqKta0CFOvzuXBzryLJlXv1MPmgy3/fTCEntkXzG1lyM ag+7yo2a8F26+EBib2cj092IrtFuCl7LvHBNk556hFX5TgjZRHIsCCW0OkYF90LefpwQ f7WjoVUcr+xXbOzHIuoeMRNPXAWSh2MlNU7pVEQoU/rGmV5XZmNSoRinWtz5kUB1nRpa N99Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718180106; x=1718784906; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wXAjKTvBEAvP+svvitn9yofnK0X/5/4ahwWqCi/xEWA=; b=utDviaqCHf96x3jJa7DLRdfPwmcXLzLlrwl1eGwjZtm9IVY5FlfVIL/HKNBa4NjLR/ 9y5Pcq3nKuW190rPXG1myUn4kUQVQVKTy65REmCJePwuCvhs6McqW/Z6G+47r0hyCmnx Kv+ijqqHEHe2T94zv+ydVlEx/GmG3QYeWva715XBLnZEWoXqicCc8hB6eCoIqGKBlpLz yhFeMrkjE8XBTBpMtIqfKZ3Grg3B9ZSVn6dK+6thuIaD2eBzQgIIyzuYrvfIVDBuPCYg 1blebGG5KzvHjXJBbByvyMlUEiBReY0wXMXTzikVKJXe2+AIJn3w47hMIPsUjW7PlsYL R4Iw== X-Forwarded-Encrypted: i=1; AJvYcCXsHUO2ZVvlN0Kt2lYbpDVSeL9T2Q6i6EUlf86armZ5ORPcPc8e6zPzTJNW5e4z8A4ipusW1y6EUIsXrd2gTWeKUSnFZPqSHMbaXHVL4cUXPMsdX2I/cx7Hu+9fi7PTiTr/ICasxNI5Op64x60hdNZJk99xs9gdOlaDmLiM3AZ496ejcZlPsZnVdwAEsWPEZz20I0PFUNp96SH+g9Y= X-Gm-Message-State: AOJu0YxzfGe4oiVceu60ruMHV7UVXM6enojBjxSYDUTwoxYC/UMydJGN 3S+JQOnT/0W5hGp4VMKutP5Bkrw6qlhNpkIQOfnGFKoU7K3ZrJKw X-Received: by 2002:a17:907:f81:b0:a6f:1972:7fd with SMTP id a640c23a62f3a-a6f480272c3mr62515366b.67.1718180105733; Wed, 12 Jun 2024 01:15:05 -0700 (PDT) Received: from localhost ([81.168.73.77]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f212aed2esm8466666f8f.26.2024.06.12.01.15.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 01:15:05 -0700 (PDT) Date: Wed, 12 Jun 2024 09:15:03 +0100 From: Martin Habets To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Dave Ertman , Ira Weiny , "Rafael J. Wysocki" , Sakari Ailus , Bingbu Cao , Tianshu Qiu , Mauro Carvalho Chehab , Michael Chan , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jesse Brandeburg , Tony Nguyen , Saeed Mahameed , Leon Romanovsky , Tariq Toukan , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Daniel Baluta , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , Richard Cochran , linux-media@vger.kernel.org, netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org, sound-open-firmware@alsa-project.org, linux-sound@vger.kernel.org Subject: Re: [PATCH 1/6] auxbus: make to_auxiliary_drv accept and return a constant pointer Message-ID: <20240612081503.GA8955@gmail.com> Mail-Followup-To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Dave Ertman , Ira Weiny , "Rafael J. Wysocki" , Sakari Ailus , Bingbu Cao , Tianshu Qiu , Mauro Carvalho Chehab , Michael Chan , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jesse Brandeburg , Tony Nguyen , Saeed Mahameed , Leon Romanovsky , Tariq Toukan , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Daniel Baluta , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , Richard Cochran , linux-media@vger.kernel.org, netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org, sound-open-firmware@alsa-project.org, linux-sound@vger.kernel.org References: <20240611130103.3262749-7-gregkh@linuxfoundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240611130103.3262749-7-gregkh@linuxfoundation.org> On Tue, Jun 11, 2024 at 03:01:04PM +0200, Greg Kroah-Hartman wrote: > In the quest to make struct device constant, start by making > to_auziliary_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: Greg Kroah-Hartman > Cc: Dave Ertman > Cc: Ira Weiny > Cc: "Rafael J. Wysocki" > Cc: Sakari Ailus > Cc: Bingbu Cao > Cc: Tianshu Qiu > Cc: Mauro Carvalho Chehab > Cc: Michael Chan > Cc: "David S. Miller" > Cc: Eric Dumazet > Cc: Jakub Kicinski > Cc: Paolo Abeni > Cc: Jesse Brandeburg > Cc: Tony Nguyen > Cc: Saeed Mahameed > Cc: Leon Romanovsky > Cc: Tariq Toukan > Cc: Pierre-Louis Bossart > Cc: Liam Girdwood > Cc: Peter Ujfalusi > Cc: Bard Liao > Cc: Ranjani Sridharan > Cc: Daniel Baluta > Cc: Kai Vehmanen > Cc: Mark Brown > Cc: Jaroslav Kysela > Cc: Takashi Iwai > Cc: Richard Cochran > 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 > Signed-off-by: Greg Kroah-Hartman Reviewed-by: Martin Habets > --- > drivers/base/auxiliary.c | 8 ++++---- > drivers/media/pci/intel/ipu6/ipu6-bus.h | 2 +- > drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 4 ++-- > drivers/net/ethernet/intel/ice/ice_ptp.c | 2 +- > drivers/net/ethernet/mellanox/mlx5/core/dev.c | 4 ++-- > include/linux/auxiliary_bus.h | 2 +- > sound/soc/sof/sof-client.c | 4 ++-- > 7 files changed, 13 insertions(+), 13 deletions(-) > > diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c > index d3a2c40c2f12..5832e31bb77b 100644 > --- a/drivers/base/auxiliary.c > +++ b/drivers/base/auxiliary.c > @@ -180,7 +180,7 @@ static const struct auxiliary_device_id *auxiliary_match_id(const struct auxilia > static int auxiliary_match(struct device *dev, struct device_driver *drv) > { > struct auxiliary_device *auxdev = to_auxiliary_dev(dev); > - struct auxiliary_driver *auxdrv = to_auxiliary_drv(drv); > + const struct auxiliary_driver *auxdrv = to_auxiliary_drv(drv); > > return !!auxiliary_match_id(auxdrv->id_table, auxdev); > } > @@ -203,7 +203,7 @@ static const struct dev_pm_ops auxiliary_dev_pm_ops = { > > static int auxiliary_bus_probe(struct device *dev) > { > - struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver); > + const struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver); > struct auxiliary_device *auxdev = to_auxiliary_dev(dev); > int ret; > > @@ -222,7 +222,7 @@ static int auxiliary_bus_probe(struct device *dev) > > static void auxiliary_bus_remove(struct device *dev) > { > - struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver); > + const struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver); > struct auxiliary_device *auxdev = to_auxiliary_dev(dev); > > if (auxdrv->remove) > @@ -232,7 +232,7 @@ static void auxiliary_bus_remove(struct device *dev) > > static void auxiliary_bus_shutdown(struct device *dev) > { > - struct auxiliary_driver *auxdrv = NULL; > + const struct auxiliary_driver *auxdrv = NULL; > struct auxiliary_device *auxdev; > > if (dev->driver) { > diff --git a/drivers/media/pci/intel/ipu6/ipu6-bus.h b/drivers/media/pci/intel/ipu6/ipu6-bus.h > index b26c6aee1621..bb4926dfdf08 100644 > --- a/drivers/media/pci/intel/ipu6/ipu6-bus.h > +++ b/drivers/media/pci/intel/ipu6/ipu6-bus.h > @@ -21,7 +21,7 @@ struct ipu6_buttress_ctrl; > > struct ipu6_bus_device { > struct auxiliary_device auxdev; > - struct auxiliary_driver *auxdrv; > + const struct auxiliary_driver *auxdrv; > const struct ipu6_auxdrv_data *auxdrv_data; > struct list_head list; > void *pdata; > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c > index ba3fa1c2e5d9..b9e7d3e7b15d 100644 > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c > @@ -239,7 +239,7 @@ void bnxt_ulp_stop(struct bnxt *bp) > > adev = &aux_priv->aux_dev; > if (adev->dev.driver) { > - struct auxiliary_driver *adrv; > + const struct auxiliary_driver *adrv; > pm_message_t pm = {}; > > adrv = to_auxiliary_drv(adev->dev.driver); > @@ -277,7 +277,7 @@ void bnxt_ulp_start(struct bnxt *bp, int err) > > adev = &aux_priv->aux_dev; > if (adev->dev.driver) { > - struct auxiliary_driver *adrv; > + const struct auxiliary_driver *adrv; > > adrv = to_auxiliary_drv(adev->dev.driver); > edev->en_state = bp->state; > diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c > index 0f17fc1181d2..7341e7c4ef24 100644 > --- a/drivers/net/ethernet/intel/ice/ice_ptp.c > +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c > @@ -2784,7 +2784,7 @@ static struct ice_pf * > ice_ptp_aux_dev_to_owner_pf(struct auxiliary_device *aux_dev) > { > struct ice_ptp_port_owner *ports_owner; > - struct auxiliary_driver *aux_drv; > + const struct auxiliary_driver *aux_drv; > struct ice_ptp *owner_ptp; > > if (!aux_dev->dev.driver) > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/dev.c b/drivers/net/ethernet/mellanox/mlx5/core/dev.c > index 47e7c2639774..9a79674d27f1 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/dev.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/dev.c > @@ -349,7 +349,7 @@ int mlx5_attach_device(struct mlx5_core_dev *dev) > { > struct mlx5_priv *priv = &dev->priv; > struct auxiliary_device *adev; > - struct auxiliary_driver *adrv; > + const struct auxiliary_driver *adrv; > int ret = 0, i; > > devl_assert_locked(priv_to_devlink(dev)); > @@ -406,7 +406,7 @@ void mlx5_detach_device(struct mlx5_core_dev *dev, bool suspend) > { > struct mlx5_priv *priv = &dev->priv; > struct auxiliary_device *adev; > - struct auxiliary_driver *adrv; > + const struct auxiliary_driver *adrv; > pm_message_t pm = {}; > int i; > > diff --git a/include/linux/auxiliary_bus.h b/include/linux/auxiliary_bus.h > index de21d9d24a95..bdff7b85f2ae 100644 > --- a/include/linux/auxiliary_bus.h > +++ b/include/linux/auxiliary_bus.h > @@ -203,7 +203,7 @@ static inline struct auxiliary_device *to_auxiliary_dev(struct device *dev) > return container_of(dev, struct auxiliary_device, dev); > } > > -static inline struct auxiliary_driver *to_auxiliary_drv(struct device_driver *drv) > +static inline const struct auxiliary_driver *to_auxiliary_drv(const struct device_driver *drv) > { > return container_of(drv, struct auxiliary_driver, driver); > } > diff --git a/sound/soc/sof/sof-client.c b/sound/soc/sof/sof-client.c > index 99f74def4ab6..5d6005a88e79 100644 > --- a/sound/soc/sof/sof-client.c > +++ b/sound/soc/sof/sof-client.c > @@ -357,7 +357,7 @@ EXPORT_SYMBOL_NS_GPL(sof_client_ipc4_find_module, SND_SOC_SOF_CLIENT); > > int sof_suspend_clients(struct snd_sof_dev *sdev, pm_message_t state) > { > - struct auxiliary_driver *adrv; > + const struct auxiliary_driver *adrv; > struct sof_client_dev *cdev; > > mutex_lock(&sdev->ipc_client_mutex); > @@ -380,7 +380,7 @@ EXPORT_SYMBOL_NS_GPL(sof_suspend_clients, SND_SOC_SOF_CLIENT); > > int sof_resume_clients(struct snd_sof_dev *sdev) > { > - struct auxiliary_driver *adrv; > + const struct auxiliary_driver *adrv; > struct sof_client_dev *cdev; > > mutex_lock(&sdev->ipc_client_mutex); > -- > 2.45.2 >