[alsa-devel] [PATCH 1/3] ALSA: hda - Make azx_attach_pcm_stream static
It is only used in hda_controller.c now.
Signed-off-by: Dylan Reid dgreid@chromium.org --- sound/pci/hda/hda_controller.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index 6156d0a..97993e1 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c @@ -971,8 +971,8 @@ static void azx_pcm_free(struct snd_pcm *pcm)
#define MAX_PREALLOC_SIZE (32 * 1024 * 1024)
-int azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec, - struct hda_pcm *cpcm) +static int azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec, + struct hda_pcm *cpcm) { struct azx *chip = bus->private_data; struct snd_pcm *pcm;
Using readl, writel, etc. resulted in some architectures, such as s390, expanding the member names into zpci_writel. Obviously not the intended result.
Fixes s390 build breakage introduced by "4083081 - ALSA: hda - Allow different ops to read/write registers"
Signed-off-by: Dylan Reid dgreid@chromium.org --- sound/pci/hda/hda_intel.c | 12 ++++++------ sound/pci/hda/hda_priv.h | 36 ++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index b26eff3..149c00b 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1537,12 +1537,12 @@ static void pcm_mmap_prepare(struct snd_pcm_substream *substream, }
static const struct hda_controller_ops pci_hda_ops = { - .writel = pci_azx_writel, - .readl = pci_azx_readl, - .writew = pci_azx_writew, - .readw = pci_azx_readw, - .writeb = pci_azx_writeb, - .readb = pci_azx_readb, + .reg_writel = pci_azx_writel, + .reg_readl = pci_azx_readl, + .reg_writew = pci_azx_writew, + .reg_readw = pci_azx_readw, + .reg_writeb = pci_azx_writeb, + .reg_readb = pci_azx_readb, .disable_msi_reset_irq = disable_msi_reset_irq, .dma_alloc_pages = dma_alloc_pages, .dma_free_pages = dma_free_pages, diff --git a/sound/pci/hda/hda_priv.h b/sound/pci/hda/hda_priv.h index bf3cb33..198fa82 100644 --- a/sound/pci/hda/hda_priv.h +++ b/sound/pci/hda/hda_priv.h @@ -290,12 +290,12 @@ struct azx; /* Functions to read/write to hda registers. */ struct hda_controller_ops { /* Register Access */ - void (*writel)(u32 value, u32 *addr); - u32 (*readl)(u32 *addr); - void (*writew)(u16 value, u16 *addr); - u16 (*readw)(u16 *addr); - void (*writeb)(u8 value, u8 *addr); - u8 (*readb)(u8 *addr); + void (*reg_writel)(u32 value, u32 *addr); + u32 (*reg_readl)(u32 *addr); + void (*reg_writew)(u16 value, u16 *addr); + u16 (*reg_readw)(u16 *addr); + void (*reg_writeb)(u8 value, u8 *addr); + u8 (*reg_readb)(u8 *addr); /* Disable msi if supported, PCI only */ int (*disable_msi_reset_irq)(struct azx *); /* Allocation ops */ @@ -435,29 +435,29 @@ struct azx { */
#define azx_writel(chip, reg, value) \ - ((chip)->ops->writel(value, (chip)->remap_addr + ICH6_REG_##reg)) + ((chip)->ops->reg_writel(value, (chip)->remap_addr + ICH6_REG_##reg)) #define azx_readl(chip, reg) \ - ((chip)->ops->readl((chip)->remap_addr + ICH6_REG_##reg)) + ((chip)->ops->reg_readl((chip)->remap_addr + ICH6_REG_##reg)) #define azx_writew(chip, reg, value) \ - ((chip)->ops->writew(value, (chip)->remap_addr + ICH6_REG_##reg)) + ((chip)->ops->reg_writew(value, (chip)->remap_addr + ICH6_REG_##reg)) #define azx_readw(chip, reg) \ - ((chip)->ops->readw((chip)->remap_addr + ICH6_REG_##reg)) + ((chip)->ops->reg_readw((chip)->remap_addr + ICH6_REG_##reg)) #define azx_writeb(chip, reg, value) \ - ((chip)->ops->writeb(value, (chip)->remap_addr + ICH6_REG_##reg)) + ((chip)->ops->reg_writeb(value, (chip)->remap_addr + ICH6_REG_##reg)) #define azx_readb(chip, reg) \ - ((chip)->ops->readb((chip)->remap_addr + ICH6_REG_##reg)) + ((chip)->ops->reg_readb((chip)->remap_addr + ICH6_REG_##reg))
#define azx_sd_writel(chip, dev, reg, value) \ - ((chip)->ops->writel(value, (dev)->sd_addr + ICH6_REG_##reg)) + ((chip)->ops->reg_writel(value, (dev)->sd_addr + ICH6_REG_##reg)) #define azx_sd_readl(chip, dev, reg) \ - ((chip)->ops->readl((dev)->sd_addr + ICH6_REG_##reg)) + ((chip)->ops->reg_readl((dev)->sd_addr + ICH6_REG_##reg)) #define azx_sd_writew(chip, dev, reg, value) \ - ((chip)->ops->writew(value, (dev)->sd_addr + ICH6_REG_##reg)) + ((chip)->ops->reg_writew(value, (dev)->sd_addr + ICH6_REG_##reg)) #define azx_sd_readw(chip, dev, reg) \ - ((chip)->ops->readw((dev)->sd_addr + ICH6_REG_##reg)) + ((chip)->ops->reg_readw((dev)->sd_addr + ICH6_REG_##reg)) #define azx_sd_writeb(chip, dev, reg, value) \ - ((chip)->ops->writeb(value, (dev)->sd_addr + ICH6_REG_##reg)) + ((chip)->ops->reg_writeb(value, (dev)->sd_addr + ICH6_REG_##reg)) #define azx_sd_readb(chip, dev, reg) \ - ((chip)->ops->readb((dev)->sd_addr + ICH6_REG_##reg)) + ((chip)->ops->reg_readb((dev)->sd_addr + ICH6_REG_##reg))
#endif /* __SOUND_HDA_PRIV_H */
The ops to read and write registers should take pointers labeled as __iomem. Thanks to the sparse bot for catching this.
Signed-off-by: Dylan Reid dgreid@chromium.org --- sound/pci/hda/hda_intel.c | 12 ++++++------ sound/pci/hda/hda_priv.h | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 149c00b..77ca894 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1431,32 +1431,32 @@ static void azx_firmware_cb(const struct firmware *fw, void *context) */
/* PCI register access. */ -static void pci_azx_writel(u32 value, u32 *addr) +static void pci_azx_writel(u32 value, u32 __iomem *addr) { writel(value, addr); }
-static u32 pci_azx_readl(u32 *addr) +static u32 pci_azx_readl(u32 __iomem *addr) { return readl(addr); }
-static void pci_azx_writew(u16 value, u16 *addr) +static void pci_azx_writew(u16 value, u16 __iomem *addr) { writew(value, addr); }
-static u16 pci_azx_readw(u16 *addr) +static u16 pci_azx_readw(u16 __iomem *addr) { return readw(addr); }
-static void pci_azx_writeb(u8 value, u8 *addr) +static void pci_azx_writeb(u8 value, u8 __iomem *addr) { writeb(value, addr); }
-static u8 pci_azx_readb(u8 *addr) +static u8 pci_azx_readb(u8 __iomem *addr) { return readb(addr); } diff --git a/sound/pci/hda/hda_priv.h b/sound/pci/hda/hda_priv.h index 198fa82..ba38b81 100644 --- a/sound/pci/hda/hda_priv.h +++ b/sound/pci/hda/hda_priv.h @@ -290,12 +290,12 @@ struct azx; /* Functions to read/write to hda registers. */ struct hda_controller_ops { /* Register Access */ - void (*reg_writel)(u32 value, u32 *addr); - u32 (*reg_readl)(u32 *addr); - void (*reg_writew)(u16 value, u16 *addr); - u16 (*reg_readw)(u16 *addr); - void (*reg_writeb)(u8 value, u8 *addr); - u8 (*reg_readb)(u8 *addr); + void (*reg_writel)(u32 value, u32 __iomem *addr); + u32 (*reg_readl)(u32 __iomem *addr); + void (*reg_writew)(u16 value, u16 __iomem *addr); + u16 (*reg_readw)(u16 __iomem *addr); + void (*reg_writeb)(u8 value, u8 __iomem *addr); + u8 (*reg_readb)(u8 __iomem *addr); /* Disable msi if supported, PCI only */ int (*disable_msi_reset_irq)(struct azx *); /* Allocation ops */
At Sun, 2 Mar 2014 20:43:59 -0800, Dylan Reid wrote:
It is only used in hda_controller.c now.
Signed-off-by: Dylan Reid dgreid@chromium.org
Thanks, applied all three patches.
Takashi
sound/pci/hda/hda_controller.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index 6156d0a..97993e1 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c @@ -971,8 +971,8 @@ static void azx_pcm_free(struct snd_pcm *pcm)
#define MAX_PREALLOC_SIZE (32 * 1024 * 1024)
-int azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
struct hda_pcm *cpcm)
+static int azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
struct hda_pcm *cpcm)
{ struct azx *chip = bus->private_data; struct snd_pcm *pcm; -- 1.8.1.3.605.g02339dd
participants (2)
-
Dylan Reid
-
Takashi Iwai