ASoC: rsnd: remove ssiu from ssi.c
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 24 Jan 2014 02:39:40 +0000 (18:39 -0800)
committerMark Brown <broonie@linaro.org>
Mon, 3 Feb 2014 12:41:36 +0000 (12:41 +0000)
Now, SSI_MODE0/1 are controlled under scu.c
ssiu is no longer needed on ssi.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/sh/rcar/rsnd.h
sound/soc/sh/rcar/ssi.c

index 85b926229b819e1de60c9e9678acde5cc64f4a78..e92b1f438f749335d63fab4b7aef3694ec51f7ed 100644 (file)
@@ -280,7 +280,8 @@ struct rsnd_priv {
        /*
         * below value will be filled on rsnd_ssi_probe()
         */
-       void *ssiu;
+       void *ssi;
+       int ssi_nr;
 
        /*
         * below value will be filled on rsnd_dai_probe()
index 0f314db8cb509697e5acdbfa6e0d143bb379e295..dc72439da58d788e9103ed5a5794d32a7fd976dd 100644 (file)
@@ -74,18 +74,13 @@ struct rsnd_ssi {
        unsigned int rate;
 };
 
-struct rsnd_ssiu {
-       int ssi_nr;
-       struct rsnd_ssi *ssi;
-};
-
 #define for_each_rsnd_ssi(pos, priv, i)                                        \
        for (i = 0;                                                     \
             (i < rsnd_ssi_nr(priv)) &&                                 \
-               ((pos) = ((struct rsnd_ssiu *)((priv)->ssiu))->ssi + i); \
+               ((pos) = ((struct rsnd_ssi *)(priv)->ssi + i));         \
             i++)
 
-#define rsnd_ssi_nr(priv) (((struct rsnd_ssiu *)((priv)->ssiu))->ssi_nr)
+#define rsnd_ssi_nr(priv) ((priv)->ssi_nr)
 #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod)
 #define rsnd_dma_to_ssi(dma)  rsnd_mod_to_ssi(rsnd_dma_to_mod(dma))
 #define rsnd_ssi_pio_available(ssi) ((ssi)->info->pio_irq > 0)
@@ -94,8 +89,6 @@ struct rsnd_ssiu {
 #define rsnd_ssi_clk_from_parent(ssi) ((ssi)->parent)
 #define rsnd_ssi_mode_flags(p) ((p)->info->flags)
 #define rsnd_ssi_dai_id(ssi) ((ssi)->info->dai_id)
-#define rsnd_ssi_to_ssiu(ssi)\
-       (((struct rsnd_ssiu *)((ssi) - rsnd_mod_id(&(ssi)->mod))) - 1)
 
 static void rsnd_ssi_status_check(struct rsnd_mod *mod,
                                  u32 bit)
@@ -515,7 +508,7 @@ struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id)
        if (WARN_ON(id < 0 || id >= rsnd_ssi_nr(priv)))
                id = 0;
 
-       return &(((struct rsnd_ssiu *)(priv->ssiu))->ssi + id)->mod;
+       return &((struct rsnd_ssi *)(priv->ssi) + id)->mod;
 }
 
 int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod)
@@ -552,7 +545,6 @@ int rsnd_ssi_probe(struct platform_device *pdev,
        struct device *dev = rsnd_priv_to_dev(priv);
        struct rsnd_mod_ops *ops;
        struct clk *clk;
-       struct rsnd_ssiu *ssiu;
        struct rsnd_ssi *ssi;
        char name[RSND_SSI_NAME_SIZE];
        int i, nr, ret;
@@ -561,16 +553,14 @@ int rsnd_ssi_probe(struct platform_device *pdev,
         *      init SSI
         */
        nr      = info->ssi_info_nr;
-       ssiu    = devm_kzalloc(dev, sizeof(*ssiu) + (sizeof(*ssi) * nr),
-                              GFP_KERNEL);
-       if (!ssiu) {
+       ssi     = devm_kzalloc(dev, sizeof(*ssi) * nr, GFP_KERNEL);
+       if (!ssi) {
                dev_err(dev, "SSI allocate failed\n");
                return -ENOMEM;
        }
 
-       priv->ssiu      = ssiu;
-       ssiu->ssi       = (struct rsnd_ssi *)(ssiu + 1);
-       ssiu->ssi_nr    = nr;
+       priv->ssi       = ssi;
+       priv->ssi_nr    = nr;
 
        for_each_rsnd_ssi(ssi, priv, i) {
                pinfo = &info->ssi_info[i];