Commit 09965a14 authored by Andy Shevchenko's avatar Andy Shevchenko
Browse files

auxdisplay: charlcd: Partially revert "Move hwidth and bwidth to struct hd44780_common"



Commit 2545c1c9 ("auxdisplay: Move hwidth and bwidth to struct
hd44780_common") makes charlcd_alloc() argument-less effectively dropping
the single allocation for the struct charlcd_priv object along with
the driver specific one. Restore that behaviour here.

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent 72e1c440
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -595,18 +595,19 @@ static int charlcd_init(struct charlcd *lcd)
	return 0;
}

struct charlcd *charlcd_alloc(void)
struct charlcd *charlcd_alloc(unsigned int drvdata_size)
{
	struct charlcd_priv *priv;
	struct charlcd *lcd;

	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
	priv = kzalloc(sizeof(*priv) + drvdata_size, GFP_KERNEL);
	if (!priv)
		return NULL;

	priv->esc_seq.len = -1;

	lcd = &priv->lcd;
	lcd->drvdata = priv->drvdata;

	return lcd;
}
+3 −2
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ struct charlcd {
		unsigned long y;
	} addr;

	void *drvdata;
	void *drvdata;			/* Set by charlcd_alloc() */
};

/**
@@ -95,7 +95,8 @@ struct charlcd_ops {
};

void charlcd_backlight(struct charlcd *lcd, enum charlcd_onoff on);
struct charlcd *charlcd_alloc(void);

struct charlcd *charlcd_alloc(unsigned int drvdata_size);
void charlcd_free(struct charlcd *lcd);

int charlcd_register(struct charlcd *lcd);
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ static int hd44780_probe(struct platform_device *pdev)
	if (!hdc)
		return -ENOMEM;

	lcd = charlcd_alloc();
	lcd = charlcd_alloc(0);
	if (!lcd)
		goto fail1;

+1 −1
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ static int lcd2s_i2c_probe(struct i2c_client *i2c)
	if (err < 0)
		return err;

	lcd = charlcd_alloc();
	lcd = charlcd_alloc(0);
	if (!lcd)
		return -ENOMEM;

+1 −1
Original line number Diff line number Diff line
@@ -835,7 +835,7 @@ static void lcd_init(void)
	if (!hdc)
		return;

	charlcd = charlcd_alloc();
	charlcd = charlcd_alloc(0);
	if (!charlcd) {
		kfree(hdc);
		return;