Re: [PATCH 1/1] spi: fsl-dspi: Fixes warning due to devm_kzalloc on unbound device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2015-05-25 16:12 GMT+02:00 Mark Brown <broonie@xxxxxxxxxx>:
> 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@xxxxxxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux