diff for duplicates of <20190115044704.GA20989@nishad> diff --git a/a/1.txt b/N1/1.txt index 3f27595..8489928 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -62,7 +62,7 @@ index f6f30f5bf15a..8f27bd8da17d 100644 static void reset(struct fbtft_par *par) { -- if (par->gpio.reset = -1) +- if (par->gpio.reset == -1) + if (!par->gpio.reset) return; @@ -113,17 +113,17 @@ index f6f30f5bf15a..8f27bd8da17d 100644 "Missing info about 'rw' gpio. Aborting.\n"); return -EINVAL; @@ -139,22 +139,22 @@ request_gpios_match(struct fbtft_par *par, const struct fbtft_gpio *gpio) - if (strcasecmp(gpio->name, "wr") = 0) { + if (strcasecmp(gpio->name, "wr") == 0) { /* left ks0108 E pin */ par->EPIN = gpio->gpio; - return GPIOF_OUT_INIT_LOW; + return GPIOD_OUT_LOW; - } else if (strcasecmp(gpio->name, "cs0") = 0) { + } else if (strcasecmp(gpio->name, "cs0") == 0) { /* left ks0108 controller pin */ par->CS0 = gpio->gpio; - return GPIOF_OUT_INIT_HIGH; + return GPIOD_OUT_HIGH; - } else if (strcasecmp(gpio->name, "cs1") = 0) { + } else if (strcasecmp(gpio->name, "cs1") == 0) { /* right ks0108 controller pin */ par->CS1 = gpio->gpio; - return GPIOF_OUT_INIT_HIGH; @@ -132,7 +132,7 @@ index f6f30f5bf15a..8f27bd8da17d 100644 /* if write (rw = 0) e(1->0) perform write */ /* if read (rw = 1) e(0->1) set data on D0-7*/ - else if (strcasecmp(gpio->name, "rw") = 0) { + else if (strcasecmp(gpio->name, "rw") == 0) { par->RW = gpio->gpio; - return GPIOF_OUT_INIT_LOW; + return GPIOD_OUT_LOW; @@ -733,34 +733,34 @@ index a2df02d97a8e..de3f431abc15 100644 - fbtft_par_dbg(DEBUG_REQUEST_GPIOS_MATCH, par, "%s('%s')\n", - __func__, gpio->name); - -- if (strcasecmp(gpio->name, "reset") = 0) { +- if (strcasecmp(gpio->name, "reset") == 0) { - par->gpio.reset = gpio->gpio; - return GPIOF_OUT_INIT_HIGH; -- } else if (strcasecmp(gpio->name, "dc") = 0) { +- } else if (strcasecmp(gpio->name, "dc") == 0) { - par->gpio.dc = gpio->gpio; - return GPIOF_OUT_INIT_LOW; -- } else if (strcasecmp(gpio->name, "cs") = 0) { +- } else if (strcasecmp(gpio->name, "cs") == 0) { - par->gpio.cs = gpio->gpio; - return GPIOF_OUT_INIT_HIGH; -- } else if (strcasecmp(gpio->name, "wr") = 0) { +- } else if (strcasecmp(gpio->name, "wr") == 0) { - par->gpio.wr = gpio->gpio; - return GPIOF_OUT_INIT_HIGH; -- } else if (strcasecmp(gpio->name, "rd") = 0) { +- } else if (strcasecmp(gpio->name, "rd") == 0) { - par->gpio.rd = gpio->gpio; - return GPIOF_OUT_INIT_HIGH; -- } else if (strcasecmp(gpio->name, "latch") = 0) { +- } else if (strcasecmp(gpio->name, "latch") == 0) { - par->gpio.latch = gpio->gpio; - return GPIOF_OUT_INIT_LOW; -- } else if (gpio->name[0] = 'd' && gpio->name[1] = 'b') { +- } else if (gpio->name[0] == 'd' && gpio->name[1] == 'b') { - ret = kstrtouint(&gpio->name[2], 10, &val); -- if (ret = 0 && val < 16) { +- if (ret == 0 && val < 16) { - par->gpio.db[val] = gpio->gpio; - return GPIOF_OUT_INIT_LOW; - } -- } else if (strcasecmp(gpio->name, "led") = 0) { +- } else if (strcasecmp(gpio->name, "led") == 0) { - par->gpio.led[0] = gpio->gpio; - return GPIOF_OUT_INIT_LOW; -- } else if (strcasecmp(gpio->name, "led_") = 0) { +- } else if (strcasecmp(gpio->name, "led_") == 0) { - par->gpio.led[0] = gpio->gpio; - return GPIOF_OUT_INIT_HIGH; - } @@ -786,7 +786,7 @@ index a2df02d97a8e..de3f431abc15 100644 - */ - if (par->fbtftops.request_gpios_match) - flags = par->fbtftops.request_gpios_match(par, gpio); -- if (flags = FBTFT_GPIO_NO_MATCH) +- if (flags == FBTFT_GPIO_NO_MATCH) - flags = fbtft_request_gpios_match(par, gpio); - if (flags != FBTFT_GPIO_NO_MATCH) { - ret = devm_gpio_request_one(par->info->device, @@ -823,9 +823,9 @@ index a2df02d97a8e..de3f431abc15 100644 if (of_find_property(node, name, NULL)) { - gpio = of_get_named_gpio_flags(node, name, index, &of_flags); -- if (gpio = -ENOENT) +- if (gpio == -ENOENT) - return 0; -- if (gpio = -EPROBE_DEFER) +- if (gpio == -EPROBE_DEFER) - return gpio; - if (gpio < 0) { + *gpiop = devm_gpiod_get_index(dev, dev->driver->name, index, @@ -861,8 +861,8 @@ index a2df02d97a8e..de3f431abc15 100644 return ret; @@ -254,9 +153,9 @@ static int fbtft_backlight_update_status(struct backlight_device *bd) - if ((bd->props.power = FB_BLANK_UNBLANK) && - (bd->props.fb_blank = FB_BLANK_UNBLANK)) + if ((bd->props.power == FB_BLANK_UNBLANK) && + (bd->props.fb_blank == FB_BLANK_UNBLANK)) - gpio_set_value(par->gpio.led[0], polarity); + gpiod_set_value(par->gpio.led[0], polarity); else @@ -875,7 +875,7 @@ index a2df02d97a8e..de3f431abc15 100644 struct backlight_device *bd; struct backlight_properties bl_props = { 0, }; -- if (par->gpio.led[0] = -1) { +- if (par->gpio.led[0] == -1) { + if (!par->gpio.led[0]) { fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s(): led pin not set, exiting.\n", __func__); @@ -893,7 +893,7 @@ index a2df02d97a8e..de3f431abc15 100644 static void fbtft_reset(struct fbtft_par *par) { -- if (par->gpio.reset = -1) +- if (par->gpio.reset == -1) + if (!par->gpio.reset) return; fbtft_par_dbg(DEBUG_RESET, par, "%s()\n", __func__); @@ -967,7 +967,7 @@ index a2df02d97a8e..de3f431abc15 100644 @@ -1227,7 +1112,7 @@ static int fbtft_verify_gpios(struct fbtft_par *par) fbtft_par_dbg(DEBUG_VERIFY_GPIOS, par, "%s()\n", __func__); - if (pdata->display.buswidth != 9 && par->startbyte = 0 && + if (pdata->display.buswidth != 9 && par->startbyte == 0 && - par->gpio.dc < 0) { + !par->gpio.dc) { dev_err(par->info->device, @@ -1010,7 +1010,7 @@ index b5051d3d46a6..38cdad6203ea 100644 /* Set data */ #ifndef DO_NOT_OPTIMIZE_FBTFT_WRITE_GPIO - if (data = prev_data) { + if (data == prev_data) { - gpio_set_value(par->gpio.wr, 0); /* used as delay */ + gpiod_set_value(par->gpio.wr, 0); /* used as delay */ } else { @@ -1047,7 +1047,7 @@ index b5051d3d46a6..38cdad6203ea 100644 /* Set data */ #ifndef DO_NOT_OPTIMIZE_FBTFT_WRITE_GPIO - if (data = prev_data) { + if (data == prev_data) { - gpio_set_value(par->gpio.wr, 0); /* used as delay */ + gpiod_set_value(par->gpio.wr, 0); /* used as delay */ } else { @@ -1784,7 +1784,7 @@ index 046f9d355ecb..5f6cd0816d58 100644 /* Set data */ #ifndef DO_NOT_OPTIMIZE_FBTFT_WRITE_GPIO - if (data = prev_data) { + if (data == prev_data) { - gpio_set_value(par->gpio.wr, 0); /* used as delay */ + gpiod_set_value(par->gpio.wr, 0); /* used as delay */ } else { @@ -1861,7 +1861,7 @@ index 046f9d355ecb..5f6cd0816d58 100644 - strncpy(fbtft_device_param_gpios[i].name, p_name, - FBTFT_GPIO_NAME_SIZE - 1); - fbtft_device_param_gpios[i++].gpio = (int)val; -- if (i = MAX_GPIOS) { +- if (i == MAX_GPIOS) { - pr_err("gpios parameter: exceeded max array size: %d\n", - MAX_GPIOS); - return -EINVAL; diff --git a/a/content_digest b/N1/content_digest index d678b0b..bcb5330 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,7 +1,6 @@ - "ref\020181204165105.GA16291@nishad\0" "From\0Nishad Kamdar <nishadkamdar@gmail.com>\0" "Subject\0[PATCH v2] Staging: fbtft: Switch to the gpio descriptor interface\0" - "Date\0Tue, 15 Jan 2019 04:59:09 +0000\0" + "Date\0Tue, 15 Jan 2019 10:17:09 +0530\0" "To\0Greg Kroah-Hartman <gregkh@linuxfoundation.org>\0" "Cc\0Leonardo Br\303\241s <leobras.c@gmail.com>" Tim Cofala <cofala@stud.uni-hannover.de> @@ -85,7 +84,7 @@ " \n" " static void reset(struct fbtft_par *par)\n" " {\n" - "-\tif (par->gpio.reset = -1)\n" + "-\tif (par->gpio.reset == -1)\n" "+\tif (!par->gpio.reset)\n" " \t\treturn;\n" " \n" @@ -136,17 +135,17 @@ " \t\t\t\"Missing info about 'rw' gpio. Aborting.\\n\");\n" " \t\treturn -EINVAL;\n" "@@ -139,22 +139,22 @@ request_gpios_match(struct fbtft_par *par, const struct fbtft_gpio *gpio)\n" - " \tif (strcasecmp(gpio->name, \"wr\") = 0) {\n" + " \tif (strcasecmp(gpio->name, \"wr\") == 0) {\n" " \t\t/* left ks0108 E pin */\n" " \t\tpar->EPIN = gpio->gpio;\n" "-\t\treturn GPIOF_OUT_INIT_LOW;\n" "+\t\treturn GPIOD_OUT_LOW;\n" - " \t} else if (strcasecmp(gpio->name, \"cs0\") = 0) {\n" + " \t} else if (strcasecmp(gpio->name, \"cs0\") == 0) {\n" " \t\t/* left ks0108 controller pin */\n" " \t\tpar->CS0 = gpio->gpio;\n" "-\t\treturn GPIOF_OUT_INIT_HIGH;\n" "+\t\treturn GPIOD_OUT_HIGH;\n" - " \t} else if (strcasecmp(gpio->name, \"cs1\") = 0) {\n" + " \t} else if (strcasecmp(gpio->name, \"cs1\") == 0) {\n" " \t\t/* right ks0108 controller pin */\n" " \t\tpar->CS1 = gpio->gpio;\n" "-\t\treturn GPIOF_OUT_INIT_HIGH;\n" @@ -155,7 +154,7 @@ " \n" " \t/* if write (rw = 0) e(1->0) perform write */\n" " \t/* if read (rw = 1) e(0->1) set data on D0-7*/\n" - " \telse if (strcasecmp(gpio->name, \"rw\") = 0) {\n" + " \telse if (strcasecmp(gpio->name, \"rw\") == 0) {\n" " \t\tpar->RW = gpio->gpio;\n" "-\t\treturn GPIOF_OUT_INIT_LOW;\n" "+\t\treturn GPIOD_OUT_LOW;\n" @@ -756,34 +755,34 @@ "-\tfbtft_par_dbg(DEBUG_REQUEST_GPIOS_MATCH, par, \"%s('%s')\\n\",\n" "-\t\t __func__, gpio->name);\n" "-\n" - "-\tif (strcasecmp(gpio->name, \"reset\") = 0) {\n" + "-\tif (strcasecmp(gpio->name, \"reset\") == 0) {\n" "-\t\tpar->gpio.reset = gpio->gpio;\n" "-\t\treturn GPIOF_OUT_INIT_HIGH;\n" - "-\t} else if (strcasecmp(gpio->name, \"dc\") = 0) {\n" + "-\t} else if (strcasecmp(gpio->name, \"dc\") == 0) {\n" "-\t\tpar->gpio.dc = gpio->gpio;\n" "-\t\treturn GPIOF_OUT_INIT_LOW;\n" - "-\t} else if (strcasecmp(gpio->name, \"cs\") = 0) {\n" + "-\t} else if (strcasecmp(gpio->name, \"cs\") == 0) {\n" "-\t\tpar->gpio.cs = gpio->gpio;\n" "-\t\treturn GPIOF_OUT_INIT_HIGH;\n" - "-\t} else if (strcasecmp(gpio->name, \"wr\") = 0) {\n" + "-\t} else if (strcasecmp(gpio->name, \"wr\") == 0) {\n" "-\t\tpar->gpio.wr = gpio->gpio;\n" "-\t\treturn GPIOF_OUT_INIT_HIGH;\n" - "-\t} else if (strcasecmp(gpio->name, \"rd\") = 0) {\n" + "-\t} else if (strcasecmp(gpio->name, \"rd\") == 0) {\n" "-\t\tpar->gpio.rd = gpio->gpio;\n" "-\t\treturn GPIOF_OUT_INIT_HIGH;\n" - "-\t} else if (strcasecmp(gpio->name, \"latch\") = 0) {\n" + "-\t} else if (strcasecmp(gpio->name, \"latch\") == 0) {\n" "-\t\tpar->gpio.latch = gpio->gpio;\n" "-\t\treturn GPIOF_OUT_INIT_LOW;\n" - "-\t} else if (gpio->name[0] = 'd' && gpio->name[1] = 'b') {\n" + "-\t} else if (gpio->name[0] == 'd' && gpio->name[1] == 'b') {\n" "-\t\tret = kstrtouint(&gpio->name[2], 10, &val);\n" - "-\t\tif (ret = 0 && val < 16) {\n" + "-\t\tif (ret == 0 && val < 16) {\n" "-\t\t\tpar->gpio.db[val] = gpio->gpio;\n" "-\t\t\treturn GPIOF_OUT_INIT_LOW;\n" "-\t\t}\n" - "-\t} else if (strcasecmp(gpio->name, \"led\") = 0) {\n" + "-\t} else if (strcasecmp(gpio->name, \"led\") == 0) {\n" "-\t\tpar->gpio.led[0] = gpio->gpio;\n" "-\t\treturn GPIOF_OUT_INIT_LOW;\n" - "-\t} else if (strcasecmp(gpio->name, \"led_\") = 0) {\n" + "-\t} else if (strcasecmp(gpio->name, \"led_\") == 0) {\n" "-\t\tpar->gpio.led[0] = gpio->gpio;\n" "-\t\treturn GPIOF_OUT_INIT_HIGH;\n" "-\t}\n" @@ -809,7 +808,7 @@ "-\t\t */\n" "-\t\tif (par->fbtftops.request_gpios_match)\n" "-\t\t\tflags = par->fbtftops.request_gpios_match(par, gpio);\n" - "-\t\tif (flags = FBTFT_GPIO_NO_MATCH)\n" + "-\t\tif (flags == FBTFT_GPIO_NO_MATCH)\n" "-\t\t\tflags = fbtft_request_gpios_match(par, gpio);\n" "-\t\tif (flags != FBTFT_GPIO_NO_MATCH) {\n" "-\t\t\tret = devm_gpio_request_one(par->info->device,\n" @@ -846,9 +845,9 @@ " \n" " \tif (of_find_property(node, name, NULL)) {\n" "-\t\tgpio = of_get_named_gpio_flags(node, name, index, &of_flags);\n" - "-\t\tif (gpio = -ENOENT)\n" + "-\t\tif (gpio == -ENOENT)\n" "-\t\t\treturn 0;\n" - "-\t\tif (gpio = -EPROBE_DEFER)\n" + "-\t\tif (gpio == -EPROBE_DEFER)\n" "-\t\t\treturn gpio;\n" "-\t\tif (gpio < 0) {\n" "+\t\t*gpiop = devm_gpiod_get_index(dev, dev->driver->name, index,\n" @@ -884,8 +883,8 @@ " \treturn ret;\n" "@@ -254,9 +153,9 @@ static int fbtft_backlight_update_status(struct backlight_device *bd)\n" " \n" - " \tif ((bd->props.power = FB_BLANK_UNBLANK) &&\n" - " \t (bd->props.fb_blank = FB_BLANK_UNBLANK))\n" + " \tif ((bd->props.power == FB_BLANK_UNBLANK) &&\n" + " \t (bd->props.fb_blank == FB_BLANK_UNBLANK))\n" "-\t\tgpio_set_value(par->gpio.led[0], polarity);\n" "+\t\tgpiod_set_value(par->gpio.led[0], polarity);\n" " \telse\n" @@ -898,7 +897,7 @@ " \tstruct backlight_device *bd;\n" " \tstruct backlight_properties bl_props = { 0, };\n" " \n" - "-\tif (par->gpio.led[0] = -1) {\n" + "-\tif (par->gpio.led[0] == -1) {\n" "+\tif (!par->gpio.led[0]) {\n" " \t\tfbtft_par_dbg(DEBUG_BACKLIGHT, par,\n" " \t\t\t \"%s(): led pin not set, exiting.\\n\", __func__);\n" @@ -916,7 +915,7 @@ " \n" " static void fbtft_reset(struct fbtft_par *par)\n" " {\n" - "-\tif (par->gpio.reset = -1)\n" + "-\tif (par->gpio.reset == -1)\n" "+\tif (!par->gpio.reset)\n" " \t\treturn;\n" " \tfbtft_par_dbg(DEBUG_RESET, par, \"%s()\\n\", __func__);\n" @@ -990,7 +989,7 @@ "@@ -1227,7 +1112,7 @@ static int fbtft_verify_gpios(struct fbtft_par *par)\n" " \tfbtft_par_dbg(DEBUG_VERIFY_GPIOS, par, \"%s()\\n\", __func__);\n" " \n" - " \tif (pdata->display.buswidth != 9 && par->startbyte = 0 &&\n" + " \tif (pdata->display.buswidth != 9 && par->startbyte == 0 &&\n" "-\t par->gpio.dc < 0) {\n" "+\t !par->gpio.dc) {\n" " \t\tdev_err(par->info->device,\n" @@ -1033,7 +1032,7 @@ " \n" " \t\t/* Set data */\n" " #ifndef DO_NOT_OPTIMIZE_FBTFT_WRITE_GPIO\n" - " \t\tif (data = prev_data) {\n" + " \t\tif (data == prev_data) {\n" "-\t\t\tgpio_set_value(par->gpio.wr, 0); /* used as delay */\n" "+\t\t\tgpiod_set_value(par->gpio.wr, 0); /* used as delay */\n" " \t\t} else {\n" @@ -1070,7 +1069,7 @@ " \n" " \t\t/* Set data */\n" " #ifndef DO_NOT_OPTIMIZE_FBTFT_WRITE_GPIO\n" - " \t\tif (data = prev_data) {\n" + " \t\tif (data == prev_data) {\n" "-\t\t\tgpio_set_value(par->gpio.wr, 0); /* used as delay */\n" "+\t\t\tgpiod_set_value(par->gpio.wr, 0); /* used as delay */\n" " \t\t} else {\n" @@ -1807,7 +1806,7 @@ " \n" " \t\t/* Set data */\n" " #ifndef DO_NOT_OPTIMIZE_FBTFT_WRITE_GPIO\n" - " \t\tif (data = prev_data) {\n" + " \t\tif (data == prev_data) {\n" "-\t\t\tgpio_set_value(par->gpio.wr, 0); /* used as delay */\n" "+\t\t\tgpiod_set_value(par->gpio.wr, 0); /* used as delay */\n" " \t\t} else {\n" @@ -1884,7 +1883,7 @@ "-\t\tstrncpy(fbtft_device_param_gpios[i].name, p_name,\n" "-\t\t\tFBTFT_GPIO_NAME_SIZE - 1);\n" "-\t\tfbtft_device_param_gpios[i++].gpio = (int)val;\n" - "-\t\tif (i = MAX_GPIOS) {\n" + "-\t\tif (i == MAX_GPIOS) {\n" "-\t\t\tpr_err(\"gpios parameter: exceeded max array size: %d\\n\",\n" "-\t\t\t MAX_GPIOS);\n" "-\t\t\treturn -EINVAL;\n" @@ -1977,4 +1976,4 @@ "-- \n" 2.17.1 -8b56a13e620f2702fe83894f238e411d9b1c0bcaf40e4248857781a9caaa866f +84032ade0eec75fd36c79c27a4fc891d50cd37086f98b76a016d415a2bbcedab
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.