* [PATCH 1/1] spi: fsl-dspi: Fixes warning due to devm_kzalloc on unbound device @ 2014-12-04 20:09 Mirza Krak [not found] ` <1417723755-5372-1-git-send-email-mirza.krak-3xdUHytR7SMQwY+2splSUA@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Mirza Krak @ 2014-12-04 20:09 UTC (permalink / raw) To: linux-spi-u79uwXL29TY76Z2rM5mHXA; +Cc: Mirza Krak ------------[ cut here ]------------ WARNING: at drivers/base/dd.c:286 driver_probe_device+0x1b4/0x22c() Modules linked in: Backtrace: [<80011644>] (dump_backtrace) from [<800117e0>] (show_stack+0x18/0x1c) r6:0000011e r5:00000009 r4:00000000 r3:00000000 [<800117c8>] (show_stack) from [<805961e8>] (dump_stack+0x20/0x28) [<805961c8>] (dump_stack) from [<80020e48>] (warn_slowpath_common+0x6c/0x8c) [<80020ddc>] (warn_slowpath_common) from [<80020e8c>] (warn_slowpath_null+0x24/0x2c) r8:00000006 r7:7f005b94 r6:8ea1ae34 r5:8ea1ae00 r4:80837290 [<80020e68>] (warn_slowpath_null) from [<802d9078>] (driver_probe_device+0x1b4/0x22c) [<802d8ec4>] (driver_probe_device) from [<802d9184>] (__driver_attach+0x94/0x98) r8:7f00b000 r7:00000000 r6:8ea1ae34 r5:7f005b94 r4:8ea1ae00 r3:00000000 [<802d90f0>] (__driver_attach) from [<802d778c>] (bus_for_each_dev+0x5c/0x90) r6:802d90f0 r5:7f005b94 r4:00000000 r3:8ea120bc [<802d7730>] (bus_for_each_dev) from [<802d8acc>] (driver_attach+0x24/0x28) r6:807c8428 r5:8e335e80 r4:7f005b94 [<802d8aa8>] (driver_attach) from [<802d874c>] (bus_add_driver+0xdc/0x1d8) [<802d8670>] (bus_add_driver) from [<802d9814>] (driver_register+0x80/0xfc) r7:8e307d00 r6:8e307e00 r5:807a93d8 r4:7f005b94 [<802d9794>] (driver_register) from [<8034f410>] (spi_register_driver+0x4c/0x60) r5:807a93d8 r4:807a93d8 [<8034f3c4>] (spi_register_driver) from [<7f00b01c>] (mx4_io_init+0x1c/0x28 [spi_pic]) [<7f00b000>] (mx4_io_init [spi_pic]) from [<8000874c>] (do_one_initcall+0x88/0x1cc) [<800086c4>] (do_one_initcall) from [<800638ac>] (load_module+0x1634/0x1d10) r10:800611c0 r9:7f006174 r8:00000001 r7:8e307d00 r6:00000001 r5:7f006180 r4:8e12bf48 [<80062278>] (load_module) from [<80064068>] (SyS_init_module+0xe0/0xf4) r10:00000000 r9:8e12a000 r8:8000e9e4 r7:00000080 r6:00884008 r5:00884018 r4:0000cb5d [<80063f88>] (SyS_init_module) from [<8000e840>] (ret_fast_syscall+0x0/0x30) r6:7eee4e53 r5:7eee4e53 r4:0000cb5d ---[ end trace 9c516d4cef36cef3 ]--- Inspired by: 10aa5a35e34f ("SPI: fix over-eager devm_xxx() conversion") Signed-off-by: Mirza Krak <mirza.krak-3xdUHytR7SMQwY+2splSUA@public.gmane.org> --- drivers/spi/spi-fsl-dspi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 831ceb4..78509d6 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -342,7 +342,7 @@ static int dspi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) /* Only alloc on first setup */ chip = spi_get_ctldata(spi); if (chip == NULL) { - chip = devm_kzalloc(&spi->dev, sizeof(struct chip_data), + chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); GFP_KERNEL); if (!chip) return -ENOMEM; @@ -382,6 +382,11 @@ static int dspi_setup(struct spi_device *spi) return dspi_setup_transfer(spi, NULL); } +static void dspi_cleanup(struct spi_device *spi) +{ + spi_bitbang_cleanup(spi); +} + static irqreturn_t dspi_interrupt(int irq, void *dev_id) { struct fsl_dspi *dspi = (struct fsl_dspi *)dev_id; @@ -465,6 +470,7 @@ static int dspi_probe(struct platform_device *pdev) dspi->bitbang.setup_transfer = dspi_setup_transfer; dspi->bitbang.txrx_bufs = dspi_txrx_transfer; dspi->bitbang.master->setup = dspi_setup; + dspi->bitbang.master->cleanup = dspi_cleanup; dspi->bitbang.master->dev.of_node = pdev->dev.of_node; master->mode_bits = SPI_CPOL | SPI_CPHA; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 6+ messages in thread
[parent not found: <1417723755-5372-1-git-send-email-mirza.krak-3xdUHytR7SMQwY+2splSUA@public.gmane.org>]
* Re: [PATCH 1/1] spi: fsl-dspi: Fixes warning due to devm_kzalloc on unbound device [not found] ` <1417723755-5372-1-git-send-email-mirza.krak-3xdUHytR7SMQwY+2splSUA@public.gmane.org> @ 2014-12-23 8:57 ` Mirza Krak 2015-05-25 14:10 ` Mark Brown 2015-05-25 14:12 ` Mark Brown 1 sibling, 1 reply; 6+ messages in thread From: Mirza Krak @ 2014-12-23 8:57 UTC (permalink / raw) To: linux-spi-u79uwXL29TY76Z2rM5mHXA Hi! Any feedback on this? Best Regards / Mirza On Thu, 4 Dec 2014 21:09:15 +0100 Mirza Krak <mirza.krak-3xdUHytR7SMQwY+2splSUA@public.gmane.org> wrote: > ------------[ cut here ]------------ > WARNING: at drivers/base/dd.c:286 driver_probe_device+0x1b4/0x22c() > Modules linked in: > Backtrace: > [<80011644>] (dump_backtrace) from [<800117e0>] (show_stack+0x18/0x1c) > r6:0000011e r5:00000009 r4:00000000 r3:00000000 > [<800117c8>] (show_stack) from [<805961e8>] (dump_stack+0x20/0x28) > [<805961c8>] (dump_stack) from [<80020e48>] > (warn_slowpath_common+0x6c/0x8c) > [<80020ddc>] (warn_slowpath_common) from [<80020e8c>] > (warn_slowpath_null+0x24/0x2c) r8:00000006 r7:7f005b94 r6:8ea1ae34 > r5:8ea1ae00 r4:80837290 > [<80020e68>] (warn_slowpath_null) from [<802d9078>] > (driver_probe_device+0x1b4/0x22c) > [<802d8ec4>] (driver_probe_device) from [<802d9184>] > (__driver_attach+0x94/0x98) r8:7f00b000 r7:00000000 r6:8ea1ae34 > r5:7f005b94 r4:8ea1ae00 r3:00000000 > [<802d90f0>] (__driver_attach) from [<802d778c>] > (bus_for_each_dev+0x5c/0x90) r6:802d90f0 r5:7f005b94 r4:00000000 > r3:8ea120bc > [<802d7730>] (bus_for_each_dev) from [<802d8acc>] > (driver_attach+0x24/0x28) r6:807c8428 r5:8e335e80 r4:7f005b94 > [<802d8aa8>] (driver_attach) from [<802d874c>] > (bus_add_driver+0xdc/0x1d8) > [<802d8670>] (bus_add_driver) from [<802d9814>] > (driver_register+0x80/0xfc) r7:8e307d00 r6:8e307e00 r5:807a93d8 > r4:7f005b94 > [<802d9794>] (driver_register) from [<8034f410>] > (spi_register_driver+0x4c/0x60) r5:807a93d8 r4:807a93d8 > [<8034f3c4>] (spi_register_driver) from [<7f00b01c>] > (mx4_io_init+0x1c/0x28 [spi_pic]) > [<7f00b000>] (mx4_io_init [spi_pic]) from [<8000874c>] > (do_one_initcall+0x88/0x1cc) > [<800086c4>] (do_one_initcall) from [<800638ac>] > (load_module+0x1634/0x1d10) r10:800611c0 r9:7f006174 r8:00000001 > r7:8e307d00 r6:00000001 r5:7f006180 r4:8e12bf48 > [<80062278>] (load_module) from [<80064068>] > (SyS_init_module+0xe0/0xf4) r10:00000000 r9:8e12a000 r8:8000e9e4 > r7:00000080 r6:00884008 r5:00884018 r4:0000cb5d > [<80063f88>] (SyS_init_module) from [<8000e840>] > (ret_fast_syscall+0x0/0x30) r6:7eee4e53 r5:7eee4e53 r4:0000cb5d > ---[ end trace 9c516d4cef36cef3 ]--- > > Inspired by: 10aa5a35e34f ("SPI: fix over-eager devm_xxx() > conversion") > > Signed-off-by: Mirza Krak <mirza.krak-3xdUHytR7SMQwY+2splSUA@public.gmane.org> > --- > drivers/spi/spi-fsl-dspi.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c > index 831ceb4..78509d6 100644 > --- a/drivers/spi/spi-fsl-dspi.c > +++ b/drivers/spi/spi-fsl-dspi.c > @@ -342,7 +342,7 @@ static int dspi_setup_transfer(struct spi_device > *spi, struct spi_transfer *t) /* Only alloc on first setup */ > chip = spi_get_ctldata(spi); > if (chip == NULL) { > - chip = devm_kzalloc(&spi->dev, sizeof(struct > chip_data), > + chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); > GFP_KERNEL); > if (!chip) > return -ENOMEM; > @@ -382,6 +382,11 @@ static int dspi_setup(struct spi_device *spi) > return dspi_setup_transfer(spi, NULL); > } > > +static void dspi_cleanup(struct spi_device *spi) > +{ > + spi_bitbang_cleanup(spi); > +} > + > static irqreturn_t dspi_interrupt(int irq, void *dev_id) > { > struct fsl_dspi *dspi = (struct fsl_dspi *)dev_id; > @@ -465,6 +470,7 @@ static int dspi_probe(struct platform_device > *pdev) dspi->bitbang.setup_transfer = dspi_setup_transfer; > dspi->bitbang.txrx_bufs = dspi_txrx_transfer; > dspi->bitbang.master->setup = dspi_setup; > + dspi->bitbang.master->cleanup = dspi_cleanup; > dspi->bitbang.master->dev.of_node = pdev->dev.of_node; > > master->mode_bits = SPI_CPOL | SPI_CPHA; -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] spi: fsl-dspi: Fixes warning due to devm_kzalloc on unbound device 2014-12-23 8:57 ` Mirza Krak @ 2015-05-25 14:10 ` Mark Brown [not found] ` <20150525141002.GY21391-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Mark Brown @ 2015-05-25 14:10 UTC (permalink / raw) To: Mirza Krak; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 257 bytes --] On Tue, Dec 23, 2014 at 09:57:03AM +0100, Mirza Krak wrote: > Hi! > > Any feedback on this? Please don't top post or send content free pings, if you want to submit patches please always send them to the maintainer as covered in SubmittingPatches. [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20150525141002.GY21391-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>]
* Re: [PATCH 1/1] spi: fsl-dspi: Fixes warning due to devm_kzalloc on unbound device [not found] ` <20150525141002.GY21391-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> @ 2015-05-25 15:00 ` Mirza Krak 0 siblings, 0 replies; 6+ messages in thread From: Mirza Krak @ 2015-05-25 15:00 UTC (permalink / raw) To: Mark Brown; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA 2015-05-25 16:10 GMT+02:00 Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>: > On Tue, Dec 23, 2014 at 09:57:03AM +0100, Mirza Krak wrote: >> Hi! >> >> Any feedback on this? > > Please don't top post or send content free pings, if you want to submit > patches please always send them to the maintainer as covered in > SubmittingPatches. Realize my error now. -- Med Vänliga Hälsningar / Best Regards ******************************************************************* Mirza Krak Host Mobility AB mirza.krak-3xdUHytR7SMQwY+2splSUA@public.gmane.org Anders Personsgatan 12, 416 64 Göteborg Sweden http://www.hostmobility.com Direct: +46 31 31 32 704 Phone: +46 31 31 32 700 Fax: +46 31 80 67 51 Mobile: +46 730 28 06 22 ******************************************************************* -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] spi: fsl-dspi: Fixes warning due to devm_kzalloc on unbound device [not found] ` <1417723755-5372-1-git-send-email-mirza.krak-3xdUHytR7SMQwY+2splSUA@public.gmane.org> 2014-12-23 8:57 ` Mirza Krak @ 2015-05-25 14:12 ` Mark Brown [not found] ` <20150525141223.GZ21391-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> 1 sibling, 1 reply; 6+ messages in thread From: Mark Brown @ 2015-05-25 14:12 UTC (permalink / raw) To: Mirza Krak; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 1909 bytes --] On Thu, Dec 04, 2014 at 09:09:15PM +0100, Mirza Krak wrote: > ------------[ cut here ]------------ > WARNING: at drivers/base/dd.c:286 driver_probe_device+0x1b4/0x22c() > Modules linked in: > Backtrace: Please don't paste entire backtraces into commit messages, they're large and make it hard to find the content - if one is useful please paste the relevant portions only. > Inspired by: 10aa5a35e34f ("SPI: fix over-eager devm_xxx() > conversion") > > Signed-off-by: Mirza Krak <mirza.krak-3xdUHytR7SMQwY+2splSUA@public.gmane.org> Your commit message should describe what the problem was and how it is being fixed (ie, describe the change) rather than simply stating that it is fixing an issue unless the change is really obvious. > @@ -342,7 +342,7 @@ static int dspi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) > /* Only alloc on first setup */ > chip = spi_get_ctldata(spi); > if (chip == NULL) { > - chip = devm_kzalloc(&spi->dev, sizeof(struct chip_data), > + chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); > GFP_KERNEL); > if (!chip) > return -ENOMEM; This is good. > @@ -382,6 +382,11 @@ static int dspi_setup(struct spi_device *spi) > return dspi_setup_transfer(spi, NULL); > } > > +static void dspi_cleanup(struct spi_device *spi) > +{ > + spi_bitbang_cleanup(spi); > +} > + > static irqreturn_t dspi_interrupt(int irq, void *dev_id) > { > struct fsl_dspi *dspi = (struct fsl_dspi *)dev_id; > @@ -465,6 +470,7 @@ static int dspi_probe(struct platform_device *pdev) > dspi->bitbang.setup_transfer = dspi_setup_transfer; > dspi->bitbang.txrx_bufs = dspi_txrx_transfer; > dspi->bitbang.master->setup = dspi_setup; > + dspi->bitbang.master->cleanup = dspi_cleanup; > dspi->bitbang.master->dev.of_node = pdev->dev.of_node; Why not just assign spi_bitbang_cleanup() directly? [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20150525141223.GZ21391-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>]
* Re: [PATCH 1/1] spi: fsl-dspi: Fixes warning due to devm_kzalloc on unbound device [not found] ` <20150525141223.GZ21391-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> @ 2015-05-25 15:04 ` Mirza Krak 0 siblings, 0 replies; 6+ messages in thread From: Mirza Krak @ 2015-05-25 15:04 UTC (permalink / raw) To: Mark Brown; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA 2015-05-25 16:12 GMT+02:00 Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>: > On Thu, Dec 04, 2014 at 09:09:15PM +0100, Mirza Krak wrote: > >> ------------[ cut here ]------------ >> WARNING: at drivers/base/dd.c:286 driver_probe_device+0x1b4/0x22c() >> Modules linked in: >> Backtrace: > > Please don't paste entire backtraces into commit messages, they're large > and make it hard to find the content - if one is useful please paste > the relevant portions only. > >> Inspired by: 10aa5a35e34f ("SPI: fix over-eager devm_xxx() >> conversion") >> >> Signed-off-by: Mirza Krak <mirza.krak-3xdUHytR7SMQwY+2splSUA@public.gmane.org> > > Your commit message should describe what the problem was and how it is > being fixed (ie, describe the change) rather than simply stating that it > is fixing an issue unless the change is really obvious. > >> @@ -342,7 +342,7 @@ static int dspi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) >> /* Only alloc on first setup */ >> chip = spi_get_ctldata(spi); >> if (chip == NULL) { >> - chip = devm_kzalloc(&spi->dev, sizeof(struct chip_data), >> + chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); >> GFP_KERNEL); >> if (!chip) >> return -ENOMEM; > > This is good. > >> @@ -382,6 +382,11 @@ static int dspi_setup(struct spi_device *spi) >> return dspi_setup_transfer(spi, NULL); >> } >> >> +static void dspi_cleanup(struct spi_device *spi) >> +{ >> + spi_bitbang_cleanup(spi); >> +} >> + >> static irqreturn_t dspi_interrupt(int irq, void *dev_id) >> { >> struct fsl_dspi *dspi = (struct fsl_dspi *)dev_id; >> @@ -465,6 +470,7 @@ static int dspi_probe(struct platform_device *pdev) >> dspi->bitbang.setup_transfer = dspi_setup_transfer; >> dspi->bitbang.txrx_bufs = dspi_txrx_transfer; >> dspi->bitbang.master->setup = dspi_setup; >> + dspi->bitbang.master->cleanup = dspi_cleanup; >> dspi->bitbang.master->dev.of_node = pdev->dev.of_node; > > Why not just assign spi_bitbang_cleanup() directly? Thank you for reviewing this, but this has been fixed already [1], he probably did not top post :). We can NAK this. [1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/spi/spi-fsl-dspi.c?id=973fbce69ed8e79b5fe3ad19cfecb581a7ef8048 -- Med Vänliga Hälsningar / Best Regards ******************************************************************* Mirza Krak Host Mobility AB mirza.krak-3xdUHytR7SMQwY+2splSUA@public.gmane.org Anders Personsgatan 12, 416 64 Göteborg Sweden http://www.hostmobility.com Direct: +46 31 31 32 704 Phone: +46 31 31 32 700 Fax: +46 31 80 67 51 Mobile: +46 730 28 06 22 ******************************************************************* -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-05-25 15:04 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-12-04 20:09 [PATCH 1/1] spi: fsl-dspi: Fixes warning due to devm_kzalloc on unbound device Mirza Krak [not found] ` <1417723755-5372-1-git-send-email-mirza.krak-3xdUHytR7SMQwY+2splSUA@public.gmane.org> 2014-12-23 8:57 ` Mirza Krak 2015-05-25 14:10 ` Mark Brown [not found] ` <20150525141002.GY21391-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> 2015-05-25 15:00 ` Mirza Krak 2015-05-25 14:12 ` Mark Brown [not found] ` <20150525141223.GZ21391-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> 2015-05-25 15:04 ` Mirza Krak
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).