linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Fabrice Gasnier <fabrice.gasnier@st.com>,
	Stable@vger.kernel.org,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 4.19 78/81] iio: adc: stm32-dfsdm: fix device used to request dma
Date: Tue, 26 May 2020 20:53:53 +0200	[thread overview]
Message-ID: <20200526183935.711435313@linuxfoundation.org> (raw)
In-Reply-To: <20200526183923.108515292@linuxfoundation.org>

From: Fabrice Gasnier <fabrice.gasnier@st.com>

[ Upstream commit b455d06e6fb3c035711e8aab1ca18082ccb15d87 ]

DMA channel request should use device struct from platform device struct.
Currently it's using iio device struct. But at this stage when probing,
device struct isn't yet registered (e.g. device_register is done in
iio_device_register). Since commit 71723a96b8b1 ("dmaengine: Create
symlinks between DMA channels and slaves"), a warning message is printed
as the links in sysfs can't be created, due to device isn't yet registered:
- Cannot create DMA slave symlink
- Cannot create DMA dma:rx symlink

Fix this by using device struct from platform device to request dma chan.

Fixes: eca949800d2d ("IIO: ADC: add stm32 DFSDM support for PDM microphone")

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/iio/adc/stm32-dfsdm-adc.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
index 516d7d22d9f4..1c492a7f4587 100644
--- a/drivers/iio/adc/stm32-dfsdm-adc.c
+++ b/drivers/iio/adc/stm32-dfsdm-adc.c
@@ -45,7 +45,7 @@ enum sd_converter_type {
 
 struct stm32_dfsdm_dev_data {
 	int type;
-	int (*init)(struct iio_dev *indio_dev);
+	int (*init)(struct device *dev, struct iio_dev *indio_dev);
 	unsigned int num_channels;
 	const struct regmap_config *regmap_cfg;
 };
@@ -923,7 +923,8 @@ static void stm32_dfsdm_dma_release(struct iio_dev *indio_dev)
 	}
 }
 
-static int stm32_dfsdm_dma_request(struct iio_dev *indio_dev)
+static int stm32_dfsdm_dma_request(struct device *dev,
+				   struct iio_dev *indio_dev)
 {
 	struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
 	struct dma_slave_config config = {
@@ -933,7 +934,7 @@ static int stm32_dfsdm_dma_request(struct iio_dev *indio_dev)
 	};
 	int ret;
 
-	adc->dma_chan = dma_request_chan(&indio_dev->dev, "rx");
+	adc->dma_chan = dma_request_chan(dev, "rx");
 	if (IS_ERR(adc->dma_chan)) {
 		int ret = PTR_ERR(adc->dma_chan);
 
@@ -997,7 +998,7 @@ static int stm32_dfsdm_adc_chan_init_one(struct iio_dev *indio_dev,
 					  &adc->dfsdm->ch_list[ch->channel]);
 }
 
-static int stm32_dfsdm_audio_init(struct iio_dev *indio_dev)
+static int stm32_dfsdm_audio_init(struct device *dev, struct iio_dev *indio_dev)
 {
 	struct iio_chan_spec *ch;
 	struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
@@ -1027,10 +1028,10 @@ static int stm32_dfsdm_audio_init(struct iio_dev *indio_dev)
 	indio_dev->num_channels = 1;
 	indio_dev->channels = ch;
 
-	return stm32_dfsdm_dma_request(indio_dev);
+	return stm32_dfsdm_dma_request(dev, indio_dev);
 }
 
-static int stm32_dfsdm_adc_init(struct iio_dev *indio_dev)
+static int stm32_dfsdm_adc_init(struct device *dev, struct iio_dev *indio_dev)
 {
 	struct iio_chan_spec *ch;
 	struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
@@ -1174,7 +1175,7 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev)
 		adc->dfsdm->fl_list[adc->fl_id].sync_mode = val;
 
 	adc->dev_data = dev_data;
-	ret = dev_data->init(iio);
+	ret = dev_data->init(dev, iio);
 	if (ret < 0)
 		return ret;
 
-- 
2.25.1




  parent reply	other threads:[~2020-05-26 19:05 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 18:52 [PATCH 4.19 00/81] 4.19.125-rc1 review Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 01/81] x86/uaccess, ubsan: Fix UBSAN vs. SMAP Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 02/81] ubsan: build ubsan.c more conservatively Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 03/81] i2c: dev: Fix the race between the release of i2c_dev and cdev Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 04/81] KVM: SVM: Fix potential memory leak in svm_cpu_init() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 05/81] riscv: set max_pfn to the PFN of the last page Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 06/81] ima: Set file->f_mode instead of file->f_flags in ima_calc_file_hash() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 07/81] evm: Check also if *tfm is an error pointer in init_desc() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 08/81] ima: Fix return value of ima_write_policy() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 09/81] mtd: spinand: Propagate ECC information to the MTD structure Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 10/81] fix multiplication overflow in copy_fdtable() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 11/81] ubifs: remove broken lazytime support Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 12/81] iommu/amd: Fix over-read of ACPI UID from IVRS table Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 13/81] i2c: mux: demux-pinctrl: Fix an error handling path in i2c_demux_pinctrl_probe() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 14/81] ubi: Fix seq_file usage in detailed_erase_block_info debugfs file Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 15/81] gcc-common.h: Update for GCC 10 Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 16/81] HID: multitouch: add eGalaxTouch P80H84 support Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 17/81] HID: alps: Add AUI1657 device ID Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 18/81] HID: alps: ALPS_1657 is too specific; use U1_UNICORN_LEGACY instead Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 19/81] scsi: qla2xxx: Fix hang when issuing nvme disconnect-all in NPIV Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 20/81] scsi: qla2xxx: Delete all sessions before unregister local nvme port Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 21/81] configfs: fix config_item refcnt leak in configfs_rmdir() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 22/81] vhost/vsock: fix packet delivery order to monitoring devices Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 23/81] aquantia: Fix the media type of AQC100 ethernet controller in the driver Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 4.19 24/81] component: Silence bind error on -EPROBE_DEFER Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 25/81] scsi: ibmvscsi: Fix WARN_ON during event pool release Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 26/81] HID: i2c-hid: reset Synaptics SYNA2393 on resume Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 27/81] x86/apic: Move TSC deadline timer debug printk Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 28/81] gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 29/81] HID: quirks: Add HID_QUIRK_NO_INIT_REPORTS quirk for Dell K12A keyboard-dock Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 30/81] ceph: fix double unlock in handle_cap_export() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 31/81] stmmac: fix pointer check after utilization in stmmac_interrupt Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 32/81] USB: core: Fix misleading driver bug report Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 33/81] platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 34/81] ARM: futex: Address build warning Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 35/81] padata: Replace delayed timer with immediate workqueue in padata_reorder Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 36/81] padata: initialize pd->cpu with effective cpumask Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 37/81] padata: purge get_cpu and reorder_via_wq from padata_do_serial Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 38/81] ALSA: iec1712: Initialize STDSP24 properly when using the model=staudio option Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 39/81] ALSA: pcm: fix incorrect hw_base increase Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 40/81] ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Xtreme Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 41/81] ALSA: hda/realtek - Add more fixup entries for Clevo machines Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 42/81] drm/etnaviv: fix perfmon domain interation Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 43/81] apparmor: Fix use-after-free in aa_audit_rule_init Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 44/81] apparmor: fix potential label refcnt leak in aa_change_profile Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 45/81] apparmor: Fix aa_label refcnt leak in policy_update Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 46/81] dmaengine: tegra210-adma: Fix an error handling path in tegra_adma_probe() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 47/81] dmaengine: owl: Use correct lock in owl_dma_get_pchan() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 48/81] drm/i915/gvt: Init DPLL/DDI vreg for virtual display instead of inheritance Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 49/81] powerpc: Remove STRICT_KERNEL_RWX incompatibility with RELOCATABLE Greg Kroah-Hartman
2020-05-27 13:28   ` Pavel Machek
2020-05-27 14:32     ` Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 50/81] powerpc/64s: Disable STRICT_KERNEL_RWX Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 51/81] nfit: Add Hyper-V NVDIMM DSM command set to white list Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 52/81] libnvdimm/btt: Remove unnecessary code in btt_freelist_init Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 53/81] libnvdimm/btt: Fix LBA masking during free list population Greg Kroah-Hartman
2020-05-27 13:33   ` Pavel Machek
2020-05-26 18:53 ` [PATCH 4.19 54/81] staging: most: core: replace strcpy() by strscpy() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 55/81] thunderbolt: Drop duplicated get_switch_at_route() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 56/81] media: fdp1: Fix R-Car M3-N naming in debug message Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 57/81] Revert "net/ibmvnic: Fix EOI when running in XIVE mode" Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 58/81] net: bcmgenet: code movement Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 59/81] net: bcmgenet: abort suspend on error Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 60/81] cxgb4: free mac_hlist properly Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 61/81] cxgb4/cxgb4vf: Fix mac_hlist initialization and free Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 62/81] tty: serial: qcom_geni_serial: Fix wrap around of TX buffer Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 63/81] brcmfmac: abort and release host after error Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 64/81] Revert "gfs2: Dont demote a glock until its revokes are written" Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 65/81] staging: iio: ad2s1210: Fix SPI reading Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 66/81] staging: greybus: Fix uninitialized scalar variable Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 67/81] iio: sca3000: Remove an erroneous get_device() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 68/81] iio: dac: vf610: Fix an error handling path in vf610_dac_probe() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 69/81] misc: rtsx: Add short delay after exit from ASPM Greg Kroah-Hartman
2020-05-29 16:26   ` Pavel Machek
2020-05-26 18:53 ` [PATCH 4.19 70/81] mei: release me_cl object reference Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 71/81] ipack: tpci200: fix error return code in tpci200_register() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 72/81] rapidio: fix an error in get_user_pages_fast() error handling Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 73/81] rxrpc: Fix a memory leak in rxkad_verify_response() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 74/81] x86/unwind/orc: Fix unwind_get_return_address_ptr() for inactive tasks Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 75/81] iio: adc: stm32-adc: Use dma_request_chan() instead dma_request_slave_channel() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 76/81] iio: adc: stm32-adc: fix device used to request dma Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 77/81] iio: adc: stm32-dfsdm: Use dma_request_chan() instead dma_request_slave_channel() Greg Kroah-Hartman
2020-05-26 18:53 ` Greg Kroah-Hartman [this message]
2020-05-26 18:53 ` [PATCH 4.19 79/81] rxrpc: Trace discarded ACKs Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 80/81] rxrpc: Fix ack discard Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 4.19 81/81] make user_access_begin() do access_ok() Greg Kroah-Hartman
2020-05-27  8:30 ` [PATCH 4.19 00/81] 4.19.125-rc1 review Naresh Kamboju
2020-05-27  8:33 ` Jon Hunter
2020-05-27 10:29 ` Chris Paterson
2020-05-27 11:48   ` Greg Kroah-Hartman
2020-05-27 14:02 ` Guenter Roeck
2020-05-27 15:28   ` Greg Kroah-Hartman
2020-05-27 16:38 ` shuah

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=20200526183935.711435313@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=fabrice.gasnier@st.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).