Re: [RFC 5/7] staging: fbtft: don't require platform data

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

 




Den 02.03.2015 12:31, skrev Dan Carpenter:
On Mon, Mar 02, 2015 at 11:54:27AM +0100, Noralf Trønnes wrote:
Add dummy platform data when it's not present.

Signed-off-by: Noralf Trønnes <noralf@xxxxxxxxxxx>
---
  drivers/staging/fbtft/fbtft-core.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index ac4287f..59c17c1 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -719,10 +719,8 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
  	if (!bpp)
  		bpp = 16;
- if (!pdata) {
-		dev_err(dev, "platform data is missing\n");
-		return NULL;
-	}
+	if (!pdata)
+		pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
This is weird.  pdata is zeroed out so the info is a bit useless.  We
don't use it outside this function.  Later in the function, then should
we do?

-	par->pdata = dev->platform_data;
+	par->pdata = pdata;

You're right. I missed that.

thanks,
Noralf.

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel





[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux