From: kernel test robot <lkp@intel.com>
To: "Rob Herring (Arm)" <robh@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [robh:for-kernelci 21/21] drivers/spi/spi-stm32-ospi.c:828:60: error: incompatible pointer types passing 'struct resource **' to parameter of type 'struct resource *'; remove &
Date: Thu, 1 May 2025 09:17:16 +0800 [thread overview]
Message-ID: <202505010952.VuIgscLk-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-kernelci
head: 3474fc53f28d0824c7020ddffc8559e8302f7415
commit: 3474fc53f28d0824c7020ddffc8559e8302f7415 [21/21] spi: Use of_reserved_mem_region_to_resource() for "memory-region"
config: hexagon-randconfig-001-20250501 (https://download.01.org/0day-ci/archive/20250501/202505010952.VuIgscLk-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250501/202505010952.VuIgscLk-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505010952.VuIgscLk-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/spi/spi-stm32-ospi.c:828:60: error: incompatible pointer types passing 'struct resource **' to parameter of type 'struct resource *'; remove & [-Werror,-Wincompatible-pointer-types]
828 | ret = of_reserved_mem_region_to_resource(dev->of_node, 0, &res);
| ^~~~
include/linux/of_reserved_mem.h:44:47: note: passing argument to parameter 'res' here
44 | unsigned int idx, struct resource *res);
| ^
>> drivers/spi/spi-stm32-ospi.c:830:33: error: incompatible pointer types passing 'struct resource **' to parameter of type 'const struct resource *'; remove & [-Werror,-Wincompatible-pointer-types]
830 | ospi->mm_size = resource_size(&res);
| ^~~~
include/linux/ioport.h:289:68: note: passing argument to parameter 'res' here
289 | static inline resource_size_t resource_size(const struct resource *res)
| ^
drivers/spi/spi-stm32-ospi.c:831:46: error: incompatible pointer types passing 'struct resource **' to parameter of type 'const struct resource *'; remove & [-Werror,-Wincompatible-pointer-types]
831 | ospi->mm_base = devm_ioremap_resource(dev, &res);
| ^~~~
include/linux/device/devres.h:101:80: note: passing argument to parameter 'res' here
101 | void __iomem *devm_ioremap_resource(struct device *dev, const struct resource *res);
| ^
drivers/spi/spi-stm32-ospi.c:775:23: warning: unused variable 'rmem' [-Wunused-variable]
775 | struct reserved_mem *rmem = NULL;
| ^~~~
drivers/spi/spi-stm32-ospi.c:776:22: warning: unused variable 'node' [-Wunused-variable]
776 | struct device_node *node;
| ^~~~
2 warnings and 3 errors generated.
vim +828 drivers/spi/spi-stm32-ospi.c
769
770 static int stm32_ospi_get_resources(struct platform_device *pdev)
771 {
772 struct device *dev = &pdev->dev;
773 struct stm32_ospi *ospi = platform_get_drvdata(pdev);
774 struct resource *res;
775 struct reserved_mem *rmem = NULL;
776 struct device_node *node;
777 int ret;
778
779 ospi->regs_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
780 if (IS_ERR(ospi->regs_base))
781 return PTR_ERR(ospi->regs_base);
782
783 ospi->regs_phys_base = res->start;
784
785 ospi->clk = devm_clk_get(dev, NULL);
786 if (IS_ERR(ospi->clk))
787 return dev_err_probe(dev, PTR_ERR(ospi->clk),
788 "Can't get clock\n");
789
790 ospi->clk_rate = clk_get_rate(ospi->clk);
791 if (!ospi->clk_rate) {
792 dev_err(dev, "Invalid clock rate\n");
793 return -EINVAL;
794 }
795
796 ospi->irq = platform_get_irq(pdev, 0);
797 if (ospi->irq < 0)
798 return ospi->irq;
799
800 ret = devm_request_irq(dev, ospi->irq, stm32_ospi_irq, 0,
801 dev_name(dev), ospi);
802 if (ret) {
803 dev_err(dev, "Failed to request irq\n");
804 return ret;
805 }
806
807 ospi->rstc = devm_reset_control_array_get_optional_exclusive(dev);
808 if (IS_ERR(ospi->rstc))
809 return dev_err_probe(dev, PTR_ERR(ospi->rstc),
810 "Can't get reset\n");
811
812 ospi->dma_chrx = dma_request_chan(dev, "rx");
813 if (IS_ERR(ospi->dma_chrx)) {
814 ret = PTR_ERR(ospi->dma_chrx);
815 ospi->dma_chrx = NULL;
816 if (ret == -EPROBE_DEFER)
817 goto err_dma;
818 }
819
820 ospi->dma_chtx = dma_request_chan(dev, "tx");
821 if (IS_ERR(ospi->dma_chtx)) {
822 ret = PTR_ERR(ospi->dma_chtx);
823 ospi->dma_chtx = NULL;
824 if (ret == -EPROBE_DEFER)
825 goto err_dma;
826 }
827
> 828 ret = of_reserved_mem_region_to_resource(dev->of_node, 0, &res);
829 if (!ret) {
> 830 ospi->mm_size = resource_size(&res);
831 ospi->mm_base = devm_ioremap_resource(dev, &res);
832 if (!ospi->mm_base) {
833 dev_err(dev, "unable to map memory region: %pR\n", &res);
834 ret = -ENOMEM;
835 goto err_dma;
836 }
837
838 if (ospi->mm_size > STM32_OSPI_MAX_MMAP_SZ) {
839 dev_err(dev, "Memory map size outsize bounds\n");
840 ret = -EINVAL;
841 goto err_dma;
842 }
843 } else {
844 dev_info(dev, "No memory-map region found\n");
845 }
846
847 init_completion(&ospi->data_completion);
848 init_completion(&ospi->match_completion);
849
850 return 0;
851
852 err_dma:
853 dev_info(dev, "Can't get all resources (%d)\n", ret);
854
855 if (ospi->dma_chtx)
856 dma_release_channel(ospi->dma_chtx);
857 if (ospi->dma_chrx)
858 dma_release_channel(ospi->dma_chrx);
859
860 return ret;
861 };
862
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-05-01 1:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202505010952.VuIgscLk-lkp@intel.com \
--to=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=robh@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).