mtd: maps: physmap: Fix coding style issues reported by checkpatch
Fix the following coding style issues: - != NULL and == NULL test replaced by ! (or nothing) - split over 80 chars lines - add missing braces in multi-line if() {} else {} statements Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Родитель
7abe5309de
Коммит
cb946bf6aa
|
@ -38,7 +38,7 @@ static int physmap_flash_remove(struct platform_device *dev)
|
||||||
int i, err;
|
int i, err;
|
||||||
|
|
||||||
info = platform_get_drvdata(dev);
|
info = platform_get_drvdata(dev);
|
||||||
if (info == NULL)
|
if (!info)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
physmap_data = dev_get_platdata(&dev->dev);
|
physmap_data = dev_get_platdata(&dev->dev);
|
||||||
|
@ -53,7 +53,7 @@ static int physmap_flash_remove(struct platform_device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < info->nmaps; i++) {
|
for (i = 0; i < info->nmaps; i++) {
|
||||||
if (info->mtds[i] != NULL)
|
if (info->mtds[i])
|
||||||
map_destroy(info->mtds[i]);
|
map_destroy(info->mtds[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,10 +90,12 @@ static void physmap_set_vpp(struct map_info *map, int state)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char * const rom_probe_types[] = {
|
static const char * const rom_probe_types[] = {
|
||||||
"cfi_probe", "jedec_probe", "qinfo_probe", "map_rom", NULL };
|
"cfi_probe", "jedec_probe", "qinfo_probe", "map_rom", NULL
|
||||||
|
};
|
||||||
|
|
||||||
static const char * const part_probe_types[] = {
|
static const char * const part_probe_types[] = {
|
||||||
"cmdlinepart", "RedBoot", "afs", NULL };
|
"cmdlinepart", "RedBoot", "afs", NULL
|
||||||
|
};
|
||||||
|
|
||||||
static int physmap_flash_probe(struct platform_device *dev)
|
static int physmap_flash_probe(struct platform_device *dev)
|
||||||
{
|
{
|
||||||
|
@ -105,11 +107,10 @@ static int physmap_flash_probe(struct platform_device *dev)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
physmap_data = dev_get_platdata(&dev->dev);
|
physmap_data = dev_get_platdata(&dev->dev);
|
||||||
if (physmap_data == NULL)
|
if (!physmap_data)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
info = devm_kzalloc(&dev->dev, sizeof(struct physmap_flash_info),
|
info = devm_kzalloc(&dev->dev, sizeof(*info), GFP_KERNEL);
|
||||||
GFP_KERNEL);
|
|
||||||
if (!info)
|
if (!info)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -163,13 +164,16 @@ static int physmap_flash_probe(struct platform_device *dev)
|
||||||
simple_map_init(&info->maps[i]);
|
simple_map_init(&info->maps[i]);
|
||||||
|
|
||||||
probe_type = rom_probe_types;
|
probe_type = rom_probe_types;
|
||||||
if (physmap_data->probe_type == NULL) {
|
if (!physmap_data->probe_type) {
|
||||||
for (; info->mtds[i] == NULL && *probe_type != NULL; probe_type++)
|
for (; !info->mtds[i] && *probe_type; probe_type++)
|
||||||
info->mtds[i] = do_map_probe(*probe_type, &info->maps[i]);
|
info->mtds[i] = do_map_probe(*probe_type,
|
||||||
} else
|
&info->maps[i]);
|
||||||
info->mtds[i] = do_map_probe(physmap_data->probe_type, &info->maps[i]);
|
} else {
|
||||||
|
info->mtds[i] = do_map_probe(physmap_data->probe_type,
|
||||||
|
&info->maps[i]);
|
||||||
|
}
|
||||||
|
|
||||||
if (info->mtds[i] == NULL) {
|
if (!info->mtds[i]) {
|
||||||
dev_err(&dev->dev, "map_probe failed\n");
|
dev_err(&dev->dev, "map_probe failed\n");
|
||||||
err = -ENXIO;
|
err = -ENXIO;
|
||||||
goto err_out;
|
goto err_out;
|
||||||
|
@ -185,7 +189,7 @@ static int physmap_flash_probe(struct platform_device *dev)
|
||||||
*/
|
*/
|
||||||
info->cmtd = mtd_concat_create(info->mtds, info->nmaps,
|
info->cmtd = mtd_concat_create(info->mtds, info->nmaps,
|
||||||
dev_name(&dev->dev));
|
dev_name(&dev->dev));
|
||||||
if (info->cmtd == NULL)
|
if (!info->cmtd)
|
||||||
err = -ENXIO;
|
err = -ENXIO;
|
||||||
}
|
}
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -231,7 +235,6 @@ static struct platform_driver physmap_flash_driver = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_PHYSMAP_COMPAT
|
#ifdef CONFIG_MTD_PHYSMAP_COMPAT
|
||||||
static struct physmap_flash_data physmap_flash_data = {
|
static struct physmap_flash_data physmap_flash_data = {
|
||||||
.width = CONFIG_MTD_PHYSMAP_BANKWIDTH,
|
.width = CONFIG_MTD_PHYSMAP_BANKWIDTH,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче