Skip to content

Commit ef2086a

Browse files
committed
auxdisplay: ht16k33: Add default to switch-cases
Currently the compiler (GCC) is able to figure out that there is no other choices possible than those that are already listed in the switch-cases. However, if we want to move some code to the callback, compiler will start complaining that no default is defined. Make sure we have all switch-cases equiped with default. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Tested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent 4ce026d commit ef2086a

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

drivers/auxdisplay/ht16k33.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -677,11 +677,6 @@ static int ht16k33_seg_probe(struct device *dev, struct ht16k33_priv *priv,
677677
return err;
678678

679679
switch (priv->type) {
680-
case DISP_MATRIX:
681-
/* not handled here */
682-
err = -EINVAL;
683-
break;
684-
685680
case DISP_QUAD_7SEG:
686681
INIT_DELAYED_WORK(&priv->work, ht16k33_seg7_update);
687682
seg->map.seg7 = initial_map_seg7;
@@ -695,6 +690,9 @@ static int ht16k33_seg_probe(struct device *dev, struct ht16k33_priv *priv,
695690
seg->map_size = sizeof(seg->map.seg14);
696691
err = device_create_file(dev, &dev_attr_map_seg14);
697692
break;
693+
694+
default:
695+
return -EINVAL;
698696
}
699697
if (err)
700698
return err;
@@ -772,6 +770,9 @@ static int ht16k33_probe(struct i2c_client *client)
772770
/* Segment Display */
773771
err = ht16k33_seg_probe(dev, priv, dft_brightness);
774772
break;
773+
774+
default:
775+
return -EINVAL;
775776
}
776777
return err;
777778
}
@@ -796,6 +797,9 @@ static void ht16k33_remove(struct i2c_client *client)
796797
device_remove_file(&client->dev, &dev_attr_map_seg7);
797798
device_remove_file(&client->dev, &dev_attr_map_seg14);
798799
break;
800+
801+
default:
802+
break;
799803
}
800804
}
801805

0 commit comments

Comments
 (0)