]> git.karo-electronics.de Git - linux-beck.git/commitdiff
greybus: audio_codec: Don't be tricky with the driver model
authorGreg Kroah-Hartman <gregkh@google.com>
Wed, 20 Jan 2016 22:41:40 +0000 (14:41 -0800)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 21 Jan 2016 00:35:24 +0000 (16:35 -0800)
With the recent changes by Johan to the driver model of the greybus
code, the audio_codec no longer should need to provide a "dummy" driver
when registering the codec.  In fact, having it there causes the greybus
core to crash when inserting the module.  Removing it all fixes the
crash.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/audio_codec.c

index 79f2baf607f46138019b077ad643439c0c1cf525..5c02b6534ab26f2d203d01bae5aa7ad854928abc 100644 (file)
@@ -571,13 +571,6 @@ static void gbaudio_free_codec(struct device *dev,
  * This is the basic hook get things initialized and registered w/ gb
  */
 
-/*
- * GB codec module driver ops
- */
-struct device_driver gb_codec_driver = {
-       .owner = THIS_MODULE,
-};
-
 /* XXX
  * since BE DAI path is not yet properly closed from above layer,
  * dsp dai.mi2s_dai_data.status_mask is still set to STATUS_PORT_STARTED
@@ -625,7 +618,6 @@ static void gb_audio_cleanup(struct gbaudio_codec_info *gb)
 static int gbaudio_codec_probe(struct gb_connection *connection)
 {
        int ret, i;
-       char *driver_name;
        struct gbaudio_codec_info *gbcodec;
        struct gb_audio_topology *topology;
        struct gb_audio_manager_module_descriptor desc;
@@ -669,13 +661,6 @@ static int gbaudio_codec_probe(struct gb_connection *connection)
        for (i = 0; i < gbcodec->num_dais; i++)
                gbcodec->dais[i].ops = &gbcodec_dai_ops;
 
-       /* FIXME */
-       driver_name = devm_kzalloc(dev, NAME_SIZE, GFP_KERNEL);
-       strlcpy(driver_name, gbcodec->name, NAME_SIZE);
-       gb_codec_driver.name = strsep(&driver_name, ".");
-       dev_dbg(dev, "driver.name:%s\n", gb_codec_driver.name);
-       dev->driver = &gb_codec_driver;
-
        /* register codec */
        ret = snd_soc_register_codec(dev, &soc_codec_dev_gbcodec,
                                     gbcodec->dais, 1);