[05/12] ALSA: hdac: Move 'to_hda_ext_device' helper to core
diff mbox

Message ID 1472451806-10605-6-git-send-email-subhransu.s.prusty@intel.com
State New
Headers show

Commit Message

Subhransu S. Prusty Aug. 29, 2016, 6:23 a.m. UTC
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/hda/ext/hdac_codec.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Subhransu S. Prusty Aug. 29, 2016, 1:06 p.m. UTC | #1
On Mon, Aug 29, 2016 at 10:44:38AM +0200, Takashi Iwai wrote:
> On Mon, 29 Aug 2016 08:23:19 +0200,
> Subhransu S. Prusty wrote:
> > 
> > Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> > ---
> >  sound/hda/ext/hdac_codec.h | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/sound/hda/ext/hdac_codec.h b/sound/hda/ext/hdac_codec.h
> > index 7f47a7e..9159139 100644
> > --- a/sound/hda/ext/hdac_codec.h
> > +++ b/sound/hda/ext/hdac_codec.h
> > @@ -46,6 +46,13 @@ struct hdac_codec_widget {
> >  	void *params;	/* Widget specific parameters */
> >  };
> >  
> > +static inline struct hdac_ext_device *to_hda_ext_device(struct device *dev)
> > +{
> > +	struct hdac_device *hdac = dev_to_hdac_dev(dev);
> > +
> > +	return to_ehdac_device(hdac);
> > +}
> > +
> >  int snd_hdac_parse_widgets(struct hdac_device *hdac);
> >  int snd_hdac_codec_init(struct hdac_device *hdac);
> >  void snd_hdac_codec_cleanup(struct hdac_device *hdac);
> 
> "Move" is to move from point A to B, but you're only adding a new one
> here...

to_hda_ext_device was defined in hdac_hdmi.c. As ASoC hda codec framework
will use this, so moved this to core. The next patch removes this helper
from hdac_hdmi.c. As I didn't want intermix two different modules in the
same patch, so submitted as separate patches. May be I will rename the
commit message to "copy ... " instead of "move". What do you suggest?

Regards,
Subhransu
> 
> 
> Takashi
Subhransu S. Prusty Aug. 29, 2016, 1:20 p.m. UTC | #2
On Mon, Aug 29, 2016 at 03:21:22PM +0200, Takashi Iwai wrote:
> On Mon, 29 Aug 2016 15:06:23 +0200,
> Subhransu S. Prusty wrote:
> > 
> > On Mon, Aug 29, 2016 at 10:44:38AM +0200, Takashi Iwai wrote:
> > > On Mon, 29 Aug 2016 08:23:19 +0200,
> > > Subhransu S. Prusty wrote:
> > > > 
> > > > Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> > > > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> > > > ---
> > > >  sound/hda/ext/hdac_codec.h | 7 +++++++
> > > >  1 file changed, 7 insertions(+)
> > > > 
> > > > diff --git a/sound/hda/ext/hdac_codec.h b/sound/hda/ext/hdac_codec.h
> > > > index 7f47a7e..9159139 100644
> > > > --- a/sound/hda/ext/hdac_codec.h
> > > > +++ b/sound/hda/ext/hdac_codec.h
> > > > @@ -46,6 +46,13 @@ struct hdac_codec_widget {
> > > >  	void *params;	/* Widget specific parameters */
> > > >  };
> > > >  
> > > > +static inline struct hdac_ext_device *to_hda_ext_device(struct device *dev)
> > > > +{
> > > > +	struct hdac_device *hdac = dev_to_hdac_dev(dev);
> > > > +
> > > > +	return to_ehdac_device(hdac);
> > > > +}
> > > > +
> > > >  int snd_hdac_parse_widgets(struct hdac_device *hdac);
> > > >  int snd_hdac_codec_init(struct hdac_device *hdac);
> > > >  void snd_hdac_codec_cleanup(struct hdac_device *hdac);
> > > 
> > > "Move" is to move from point A to B, but you're only adding a new one
> > > here...
> > 
> > to_hda_ext_device was defined in hdac_hdmi.c. As ASoC hda codec framework
> > will use this, so moved this to core. The next patch removes this helper
> > from hdac_hdmi.c. As I didn't want intermix two different modules in the
> > same patch, so submitted as separate patches. May be I will rename the
> > commit message to "copy ... " instead of "move". What do you suggest?
> 
> Well, at this moment, hdac_hdmi.c is the only user of this helper, so
> I don't see any merit to split the move.  It's just factoring out the
> helper to external.

Ok, will merge these two patches and submit a single patch for the move.

Regards,
Subhransu
Takashi Iwai Aug. 29, 2016, 1:21 p.m. UTC | #3
On Mon, 29 Aug 2016 15:06:23 +0200,
Subhransu S. Prusty wrote:
> 
> On Mon, Aug 29, 2016 at 10:44:38AM +0200, Takashi Iwai wrote:
> > On Mon, 29 Aug 2016 08:23:19 +0200,
> > Subhransu S. Prusty wrote:
> > > 
> > > Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> > > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> > > ---
> > >  sound/hda/ext/hdac_codec.h | 7 +++++++
> > >  1 file changed, 7 insertions(+)
> > > 
> > > diff --git a/sound/hda/ext/hdac_codec.h b/sound/hda/ext/hdac_codec.h
> > > index 7f47a7e..9159139 100644
> > > --- a/sound/hda/ext/hdac_codec.h
> > > +++ b/sound/hda/ext/hdac_codec.h
> > > @@ -46,6 +46,13 @@ struct hdac_codec_widget {
> > >  	void *params;	/* Widget specific parameters */
> > >  };
> > >  
> > > +static inline struct hdac_ext_device *to_hda_ext_device(struct device *dev)
> > > +{
> > > +	struct hdac_device *hdac = dev_to_hdac_dev(dev);
> > > +
> > > +	return to_ehdac_device(hdac);
> > > +}
> > > +
> > >  int snd_hdac_parse_widgets(struct hdac_device *hdac);
> > >  int snd_hdac_codec_init(struct hdac_device *hdac);
> > >  void snd_hdac_codec_cleanup(struct hdac_device *hdac);
> > 
> > "Move" is to move from point A to B, but you're only adding a new one
> > here...
> 
> to_hda_ext_device was defined in hdac_hdmi.c. As ASoC hda codec framework
> will use this, so moved this to core. The next patch removes this helper
> from hdac_hdmi.c. As I didn't want intermix two different modules in the
> same patch, so submitted as separate patches. May be I will rename the
> commit message to "copy ... " instead of "move". What do you suggest?

Well, at this moment, hdac_hdmi.c is the only user of this helper, so
I don't see any merit to split the move.  It's just factoring out the
helper to external.


Takashi

Patch
diff mbox

diff --git a/sound/hda/ext/hdac_codec.h b/sound/hda/ext/hdac_codec.h
index 7f47a7e..9159139 100644
--- a/sound/hda/ext/hdac_codec.h
+++ b/sound/hda/ext/hdac_codec.h
@@ -46,6 +46,13 @@  struct hdac_codec_widget {
 	void *params;	/* Widget specific parameters */
 };
 
+static inline struct hdac_ext_device *to_hda_ext_device(struct device *dev)
+{
+	struct hdac_device *hdac = dev_to_hdac_dev(dev);
+
+	return to_ehdac_device(hdac);
+}
+
 int snd_hdac_parse_widgets(struct hdac_device *hdac);
 int snd_hdac_codec_init(struct hdac_device *hdac);
 void snd_hdac_codec_cleanup(struct hdac_device *hdac);