From a1469a3e95f9c1fd5525e0ec37bc4185e5227b48 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 11 Jun 2016 15:50:49 -0600 Subject: [PATCH] Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err() --- Kconfig | 14 +- arch/arm/src/arm/up_elf.c | 14 +- arch/arm/src/arm/up_schedulesigaction.c | 4 +- arch/arm/src/arm/up_sigdeliver.c | 4 +- arch/arm/src/armv6-m/up_elf.c | 16 +- arch/arm/src/armv6-m/up_hardfault.c | 20 +- arch/arm/src/armv6-m/up_schedulesigaction.c | 4 +- arch/arm/src/armv6-m/up_sigdeliver.c | 4 +- arch/arm/src/armv6-m/up_svcall.c | 26 +-- arch/arm/src/armv7-a/arm_addrenv.c | 8 +- arch/arm/src/armv7-a/arm_addrenv_kstack.c | 2 +- arch/arm/src/armv7-a/arm_addrenv_ustack.c | 2 +- arch/arm/src/armv7-a/arm_addrenv_utils.c | 2 +- arch/arm/src/armv7-a/arm_elf.c | 14 +- arch/arm/src/armv7-a/arm_schedulesigaction.c | 4 +- arch/arm/src/armv7-a/arm_sigdeliver.c | 4 +- arch/arm/src/armv7-a/arm_syscall.c | 22 +- arch/arm/src/armv7-a/gic.h | 4 +- arch/arm/src/armv7-m/mpu.h | 2 +- arch/arm/src/armv7-m/up_elf.c | 16 +- arch/arm/src/armv7-m/up_hardfault.c | 28 +-- arch/arm/src/armv7-m/up_memfault.c | 20 +- arch/arm/src/armv7-m/up_ramvec_attach.c | 4 +- arch/arm/src/armv7-m/up_ramvec_initialize.c | 4 +- arch/arm/src/armv7-m/up_schedulesigaction.c | 4 +- arch/arm/src/armv7-m/up_sigdeliver.c | 4 +- arch/arm/src/armv7-m/up_svcall.c | 26 +-- arch/arm/src/armv7-r/arm_elf.c | 14 +- arch/arm/src/armv7-r/arm_schedulesigaction.c | 4 +- arch/arm/src/armv7-r/arm_sigdeliver.c | 4 +- arch/arm/src/armv7-r/arm_syscall.c | 22 +- arch/arm/src/armv7-r/mpu.h | 2 +- arch/arm/src/c5471/c5471_ethernet.c | 34 +-- arch/arm/src/c5471/c5471_watchdog.c | 36 +-- arch/arm/src/calypso/calypso_spi.c | 10 +- arch/arm/src/calypso/calypso_uwire.c | 8 +- arch/arm/src/common/up_createstack.c | 2 +- arch/arm/src/common/up_exit.c | 10 +- arch/arm/src/common/up_vfork.c | 4 +- arch/arm/src/dm320/dm320_framebuffer.c | 4 +- arch/arm/src/efm32/efm32_adc.c | 2 +- arch/arm/src/efm32/efm32_dma.c | 44 ++-- arch/arm/src/efm32/efm32_i2c.c | 8 +- arch/arm/src/efm32/efm32_irq.c | 18 +- arch/arm/src/efm32/efm32_pwm.c | 8 +- arch/arm/src/efm32/efm32_rmu.c | 4 +- arch/arm/src/efm32/efm32_rmu.h | 4 +- arch/arm/src/efm32/efm32_rtc_burtc.c | 18 +- arch/arm/src/efm32/efm32_spi.c | 16 +- arch/arm/src/efm32/efm32_timer.c | 6 +- arch/arm/src/efm32/efm32_usbdev.c | 6 +- arch/arm/src/efm32/efm32_usbhost.c | 30 +-- arch/arm/src/kinetis/kinetis_enet.c | 10 +- arch/arm/src/kinetis/kinetis_irq.c | 18 +- arch/arm/src/kinetis/kinetis_pwm.c | 10 +- arch/arm/src/kinetis/kinetis_sdhc.c | 72 +++--- arch/arm/src/kinetis/kinetis_start.c | 2 +- arch/arm/src/kinetis/kinetis_usbdev.c | 40 ++-- arch/arm/src/kl/kl_irq.c | 8 +- arch/arm/src/kl/kl_pwm.c | 10 +- arch/arm/src/kl/kl_spi.c | 8 +- arch/arm/src/lpc11xx/lpc11_i2c.c | 2 +- arch/arm/src/lpc11xx/lpc11_irq.c | 8 +- arch/arm/src/lpc11xx/lpc11_serial.c | 2 +- arch/arm/src/lpc11xx/lpc11_spi.c | 10 +- arch/arm/src/lpc11xx/lpc11_ssp.c | 16 +- arch/arm/src/lpc11xx/lpc11_timer.c | 24 +- arch/arm/src/lpc17xx/lpc176x_rtc.c | 4 +- arch/arm/src/lpc17xx/lpc17_can.c | 16 +- arch/arm/src/lpc17xx/lpc17_dac.c | 2 +- arch/arm/src/lpc17xx/lpc17_ethernet.c | 40 ++-- arch/arm/src/lpc17xx/lpc17_gpdma.c | 38 ++-- arch/arm/src/lpc17xx/lpc17_i2c.c | 2 +- arch/arm/src/lpc17xx/lpc17_irq.c | 18 +- arch/arm/src/lpc17xx/lpc17_lcd.c | 8 +- arch/arm/src/lpc17xx/lpc17_mcpwm.c | 6 +- arch/arm/src/lpc17xx/lpc17_pwm.c | 6 +- arch/arm/src/lpc17xx/lpc17_sdcard.c | 44 ++-- arch/arm/src/lpc17xx/lpc17_serial.c | 2 +- arch/arm/src/lpc17xx/lpc17_spi.c | 10 +- arch/arm/src/lpc17xx/lpc17_ssp.c | 16 +- arch/arm/src/lpc17xx/lpc17_timer.c | 24 +- arch/arm/src/lpc17xx/lpc17_usbhost.c | 40 ++-- arch/arm/src/lpc214x/lpc214x_serial.c | 2 +- arch/arm/src/lpc2378/lpc23xx_i2c.c | 2 +- arch/arm/src/lpc2378/lpc23xx_serial.c | 2 +- arch/arm/src/lpc2378/lpc23xx_spi.c | 10 +- arch/arm/src/lpc31xx/lpc31_ehci.c | 30 +-- arch/arm/src/lpc31xx/lpc31_serial.c | 2 +- arch/arm/src/lpc43xx/lpc43_dac.c | 2 +- arch/arm/src/lpc43xx/lpc43_ehci.c | 30 +-- arch/arm/src/lpc43xx/lpc43_ethernet.c | 34 +-- arch/arm/src/lpc43xx/lpc43_gpdma.c | 4 +- arch/arm/src/lpc43xx/lpc43_gpio.c | 2 +- arch/arm/src/lpc43xx/lpc43_i2c.c | 2 +- arch/arm/src/lpc43xx/lpc43_irq.c | 18 +- arch/arm/src/lpc43xx/lpc43_serial.c | 2 +- arch/arm/src/lpc43xx/lpc43_spi.c | 10 +- arch/arm/src/lpc43xx/lpc43_spifi.c | 18 +- arch/arm/src/lpc43xx/lpc43_ssp.c | 12 +- arch/arm/src/nuc1xx/nuc_irq.c | 8 +- arch/arm/src/sam34/sam4cm_freerun.c | 4 +- arch/arm/src/sam34/sam4cm_oneshot.c | 4 +- arch/arm/src/sam34/sam4cm_tc.c | 8 +- arch/arm/src/sam34/sam4cm_tc.h | 4 +- arch/arm/src/sam34/sam_dmac.c | 32 +-- arch/arm/src/sam34/sam_hsmci.c | 74 +++---- arch/arm/src/sam34/sam_irq.c | 18 +- arch/arm/src/sam34/sam_rtc.c | 4 +- arch/arm/src/sam34/sam_rtt.c | 6 +- arch/arm/src/sam34/sam_spi.c | 24 +- arch/arm/src/sam34/sam_tc.c | 6 +- arch/arm/src/sam34/sam_twi.c | 8 +- arch/arm/src/sam34/sam_wdt.c | 6 +- arch/arm/src/sama5/sam_adc.c | 10 +- arch/arm/src/sama5/sam_can.c | 20 +- arch/arm/src/sama5/sam_dmac.c | 48 ++-- arch/arm/src/sama5/sam_ehci.c | 32 +-- arch/arm/src/sama5/sam_emaca.c | 14 +- arch/arm/src/sama5/sam_emacb.c | 22 +- arch/arm/src/sama5/sam_freerun.c | 4 +- arch/arm/src/sama5/sam_hsmci.c | 56 ++--- arch/arm/src/sama5/sam_lcd.c | 10 +- arch/arm/src/sama5/sam_memories.c | 6 +- arch/arm/src/sama5/sam_nand.c | 66 +++--- arch/arm/src/sama5/sam_ohci.c | 4 +- arch/arm/src/sama5/sam_oneshot.c | 4 +- arch/arm/src/sama5/sam_pck.c | 6 +- arch/arm/src/sama5/sam_pmecc.c | 12 +- arch/arm/src/sama5/sam_pwm.c | 10 +- arch/arm/src/sama5/sam_rtc.c | 4 +- arch/arm/src/sama5/sam_spi.c | 24 +- arch/arm/src/sama5/sam_ssc.c | 52 ++--- arch/arm/src/sama5/sam_tc.c | 8 +- arch/arm/src/sama5/sam_tc.h | 4 +- arch/arm/src/sama5/sam_trng.c | 4 +- arch/arm/src/sama5/sam_tsd.c | 12 +- arch/arm/src/sama5/sam_twi.c | 12 +- arch/arm/src/sama5/sam_udphs.c | 2 +- arch/arm/src/sama5/sam_wdt.c | 8 +- arch/arm/src/sama5/sam_xdmac.c | 54 ++--- arch/arm/src/samdl/sam_dmac.c | 20 +- arch/arm/src/samdl/sam_irq.c | 8 +- arch/arm/src/samdl/sam_spi.c | 14 +- arch/arm/src/samv7/sam_emac.c | 24 +- arch/arm/src/samv7/sam_freerun.c | 4 +- arch/arm/src/samv7/sam_hsmci.c | 60 ++--- arch/arm/src/samv7/sam_irq.c | 18 +- arch/arm/src/samv7/sam_mcan.c | 32 +-- arch/arm/src/samv7/sam_oneshot.c | 4 +- arch/arm/src/samv7/sam_pck.c | 4 +- arch/arm/src/samv7/sam_qspi.c | 22 +- arch/arm/src/samv7/sam_rswdt.c | 8 +- arch/arm/src/samv7/sam_spi.c | 24 +- arch/arm/src/samv7/sam_spi_slave.c | 8 +- arch/arm/src/samv7/sam_ssc.c | 52 ++--- arch/arm/src/samv7/sam_tc.c | 6 +- arch/arm/src/samv7/sam_tc.h | 4 +- arch/arm/src/samv7/sam_trng.c | 4 +- arch/arm/src/samv7/sam_twihs.c | 12 +- arch/arm/src/samv7/sam_usbdevhs.c | 2 +- arch/arm/src/samv7/sam_wdt.c | 8 +- arch/arm/src/samv7/sam_xdmac.c | 48 ++-- arch/arm/src/stm32/stm32_adc.c | 16 +- arch/arm/src/stm32/stm32_can.c | 6 +- arch/arm/src/stm32/stm32_dac.c | 12 +- arch/arm/src/stm32/stm32_dma2d.c | 64 +++--- arch/arm/src/stm32/stm32_eth.c | 34 +-- arch/arm/src/stm32/stm32_i2c.c | 10 +- arch/arm/src/stm32/stm32_i2c_alt.c | 28 +-- arch/arm/src/stm32/stm32_irq.c | 18 +- arch/arm/src/stm32/stm32_iwdg.c | 10 +- arch/arm/src/stm32/stm32_ltdc.c | 74 +++---- arch/arm/src/stm32/stm32_otgfsdev.c | 6 +- arch/arm/src/stm32/stm32_otgfshost.c | 30 +-- arch/arm/src/stm32/stm32_otghsdev.c | 6 +- arch/arm/src/stm32/stm32_otghshost.c | 30 +-- arch/arm/src/stm32/stm32_procfs_ccm.c | 10 +- arch/arm/src/stm32/stm32_pwm.c | 18 +- arch/arm/src/stm32/stm32_qencoder.c | 6 +- arch/arm/src/stm32/stm32_rtcc.c | 4 +- arch/arm/src/stm32/stm32_sdio.c | 44 ++-- arch/arm/src/stm32/stm32_spi.c | 6 +- arch/arm/src/stm32/stm32_wwdg.c | 8 +- arch/arm/src/stm32/stm32f10xxx_dma.c | 12 +- arch/arm/src/stm32/stm32f20xxx_dma.c | 20 +- arch/arm/src/stm32/stm32f30xxx_i2c.c | 10 +- arch/arm/src/stm32/stm32f40xxx_dma.c | 20 +- arch/arm/src/stm32/stm32f40xxx_rtcc.c | 4 +- arch/arm/src/stm32f7/stm32_dma.c | 20 +- arch/arm/src/stm32f7/stm32_ethernet.c | 24 +- arch/arm/src/stm32f7/stm32_irq.c | 18 +- arch/arm/src/stm32f7/stm32_procfs_dtcm.c | 10 +- arch/arm/src/stm32l4/stm32l4_can.c | 6 +- arch/arm/src/stm32l4/stm32l4_i2c.c | 10 +- arch/arm/src/stm32l4/stm32l4_irq.c | 18 +- arch/arm/src/stm32l4/stm32l4_qspi.c | 18 +- arch/arm/src/stm32l4/stm32l4_rtcc.c | 4 +- arch/arm/src/stm32l4/stm32l4_spi.c | 6 +- arch/arm/src/stm32l4/stm32l4x6xx_dma.c | 14 +- arch/arm/src/tiva/lm3s_ethernet.c | 2 +- arch/arm/src/tiva/tiva_adclib.c | 4 +- arch/arm/src/tiva/tiva_adclow.c | 10 +- arch/arm/src/tiva/tiva_gpio.h | 4 +- arch/arm/src/tiva/tiva_i2c.c | 16 +- arch/arm/src/tiva/tiva_irq.c | 18 +- arch/arm/src/tiva/tiva_ssi.c | 20 +- arch/arm/src/tiva/tiva_timer.h | 4 +- arch/arm/src/tiva/tiva_timerlow32.c | 6 +- arch/arm/src/tiva/tm4c_ethernet.c | 26 +-- arch/avr/src/avr/up_createstack.c | 2 +- arch/avr/src/avr/up_schedulesigaction.c | 4 +- arch/avr/src/avr/up_sigdeliver.c | 4 +- arch/avr/src/avr/up_spi.c | 10 +- arch/avr/src/avr32/up_createstack.c | 2 +- arch/avr/src/avr32/up_schedulesigaction.c | 4 +- arch/avr/src/avr32/up_sigdeliver.c | 4 +- arch/avr/src/common/up_exit.c | 10 +- arch/hc/src/common/up_createstack.c | 2 +- arch/hc/src/common/up_exit.c | 10 +- arch/hc/src/m9s12/m9s12_ethernet.c | 2 +- arch/mips/src/common/up_createstack.c | 2 +- arch/mips/src/common/up_exit.c | 10 +- arch/mips/src/mips32/up_schedulesigaction.c | 4 +- arch/mips/src/mips32/up_sigdeliver.c | 2 +- arch/mips/src/mips32/up_swint0.c | 22 +- arch/mips/src/mips32/up_vfork.c | 4 +- arch/mips/src/pic32mx/pic32mx-ethernet.c | 36 +-- arch/mips/src/pic32mx/pic32mx-spi.c | 14 +- arch/mips/src/pic32mx/pic32mx-usbdev.c | 40 ++-- arch/mips/src/pic32mz/pic32mz-ethernet.c | 38 ++-- arch/mips/src/pic32mz/pic32mz-spi.c | 16 +- arch/rgmp/src/x86/com.c | 18 +- arch/sh/src/common/up_createstack.c | 2 +- arch/sh/src/common/up_exit.c | 10 +- arch/sh/src/m16c/m16c_schedulesigaction.c | 4 +- arch/sh/src/m16c/m16c_serial.c | 10 +- arch/sh/src/m16c/m16c_sigdeliver.c | 4 +- arch/sh/src/sh1/sh1_irq.c | 4 +- arch/sh/src/sh1/sh1_schedulesigaction.c | 4 +- arch/sh/src/sh1/sh1_sigdeliver.c | 4 +- arch/sim/src/board_lcd.c | 8 +- arch/sim/src/up_blocktask.c | 6 +- arch/sim/src/up_deviceimage.c | 6 +- arch/sim/src/up_elf.c | 2 +- arch/sim/src/up_exit.c | 6 +- arch/sim/src/up_framebuffer.c | 36 +-- arch/sim/src/up_releasepending.c | 6 +- arch/sim/src/up_reprioritizertr.c | 6 +- arch/sim/src/up_smpsignal.c | 2 +- arch/sim/src/up_spiflash.c | 4 +- arch/sim/src/up_touchscreen.c | 4 +- arch/sim/src/up_unblocktask.c | 6 +- arch/x86/src/common/up_elf.c | 2 +- arch/x86/src/common/up_exit.c | 10 +- arch/x86/src/i486/up_createstack.c | 2 +- arch/x86/src/i486/up_schedulesigaction.c | 4 +- arch/x86/src/i486/up_sigdeliver.c | 4 +- arch/x86/src/qemu/qemu_vga.c | 4 +- arch/z16/src/common/up_blocktask.c | 2 +- arch/z16/src/common/up_createstack.c | 2 +- arch/z16/src/common/up_schedulesigaction.c | 4 +- arch/z16/src/common/up_sigdeliver.c | 4 +- arch/z16/src/common/up_unblocktask.c | 2 +- arch/z16/src/z16f/z16f_espi.c | 6 +- arch/z80/src/common/up_blocktask.c | 2 +- arch/z80/src/common/up_createstack.c | 2 +- arch/z80/src/common/up_unblocktask.c | 2 +- arch/z80/src/ez80/ez80_emac.c | 50 ++--- arch/z80/src/ez80/ez80_i2c.c | 18 +- arch/z80/src/ez80/ez80_schedulesigaction.c | 2 +- arch/z80/src/ez80/ez80_sigdeliver.c | 4 +- arch/z80/src/z180/z180_mmu.c | 6 +- arch/z80/src/z180/z180_schedulesigaction.c | 2 +- arch/z80/src/z180/z180_sigdeliver.c | 4 +- arch/z80/src/z8/z8_i2c.c | 2 +- arch/z80/src/z8/z8_schedulesigaction.c | 2 +- arch/z80/src/z8/z8_sigdeliver.c | 4 +- arch/z80/src/z80/z80_schedulesigaction.c | 2 +- arch/z80/src/z80/z80_sigdeliver.c | 4 +- audio/audio.c | 4 +- audio/pcm_decode.c | 48 ++-- binfmt/binfmt_copyargv.c | 4 +- binfmt/binfmt_dumpmodule.c | 22 +- binfmt/binfmt_exec.c | 14 +- binfmt/binfmt_execmodule.c | 16 +- binfmt/binfmt_loadmodule.c | 4 +- binfmt/binfmt_unloadmodule.c | 6 +- binfmt/builtin.c | 8 +- binfmt/elf.c | 94 ++++---- binfmt/libelf/libelf_addrenv.c | 8 +- binfmt/libelf/libelf_bind.c | 22 +- binfmt/libelf/libelf_ctors.c | 6 +- binfmt/libelf/libelf_dtors.c | 6 +- binfmt/libelf/libelf_init.c | 12 +- binfmt/libelf/libelf_iobuffer.c | 4 +- binfmt/libelf/libelf_load.c | 16 +- binfmt/libelf/libelf_read.c | 6 +- binfmt/libelf/libelf_sections.c | 18 +- binfmt/libelf/libelf_symbols.c | 18 +- binfmt/libelf/libelf_verify.c | 6 +- binfmt/libnxflat/libnxflat_addrenv.c | 12 +- binfmt/libnxflat/libnxflat_bind.c | 22 +- binfmt/libnxflat/libnxflat_init.c | 6 +- binfmt/libnxflat/libnxflat_load.c | 10 +- binfmt/libnxflat/libnxflat_read.c | 6 +- binfmt/libnxflat/libnxflat_verify.c | 4 +- binfmt/nxflat.c | 52 ++--- binfmt/pcode.c | 26 +-- configs/arduino-due/src/sam_autoleds.c | 4 +- configs/arduino-due/src/sam_mmcsd.c | 4 +- configs/arduino-due/src/sam_touchscreen.c | 6 +- configs/arduino-due/src/sam_userleds.c | 4 +- .../cc3200-launchpad/src/cc3200_autoleds.c | 4 +- configs/cloudctrl/src/stm32_adc.c | 4 +- configs/cloudctrl/src/stm32_autoleds.c | 4 +- configs/cloudctrl/src/stm32_spi.c | 8 +- configs/cloudctrl/src/stm32_usb.c | 4 +- configs/cloudctrl/src/stm32_userleds.c | 4 +- configs/cloudctrl/src/stm32_w25.c | 10 +- configs/compal_e99/src/ssd1783.c | 6 +- configs/demo9s12ne64/src/m9s12_leds.c | 4 +- configs/demo9s12ne64/src/m9s12_spi.c | 4 +- configs/dk-tm4c129x/src/tm4c_bringup.c | 8 +- configs/dk-tm4c129x/src/tm4c_ssi.c | 8 +- configs/dk-tm4c129x/src/tm4c_timer.c | 2 +- configs/dk-tm4c129x/src/tm4c_userleds.c | 4 +- configs/ea3131/src/lpc31_leds.c | 4 +- configs/ea3131/src/lpc31_spi.c | 6 +- configs/ea3131/src/lpc31_usbhost.c | 8 +- configs/ea3152/src/lpc31_leds.c | 4 +- configs/ea3152/src/lpc31_spi.c | 6 +- configs/eagle100/src/lm_leds.c | 6 +- configs/eagle100/src/lm_ssi.c | 8 +- configs/efm32-g8xx-stk/src/efm32_autoleds.c | 4 +- configs/efm32-g8xx-stk/src/efm32_userleds.c | 4 +- configs/efm32gg-stk3700/src/efm32_autoleds.c | 4 +- configs/efm32gg-stk3700/src/efm32_userleds.c | 4 +- configs/ekk-lm3s9b96/src/lm_leds.c | 6 +- configs/ekk-lm3s9b96/src/lm_ssi.c | 8 +- configs/fire-stm32v2/src/stm32_appinit.c | 4 +- configs/fire-stm32v2/src/stm32_autoleds.c | 4 +- configs/fire-stm32v2/src/stm32_mmcsd.c | 4 +- configs/fire-stm32v2/src/stm32_spi.c | 8 +- configs/fire-stm32v2/src/stm32_userleds.c | 4 +- configs/fire-stm32v2/src/stm32_w25.c | 10 +- configs/freedom-kl25z/src/kl_adxl345.c | 8 +- configs/freedom-kl25z/src/kl_appinit.c | 2 +- configs/freedom-kl25z/src/kl_led.c | 4 +- configs/freedom-kl25z/src/kl_pwm.c | 4 +- configs/freedom-kl25z/src/kl_spi.c | 4 +- configs/freedom-kl25z/src/kl_wifi.c | 6 +- configs/freedom-kl26z/src/kl_led.c | 4 +- configs/freedom-kl26z/src/kl_pwm.c | 4 +- configs/freedom-kl26z/src/kl_spi.c | 4 +- configs/hymini-stm32v/src/stm32_leds.c | 4 +- configs/hymini-stm32v/src/stm32_r61505u.c | 46 ++-- configs/hymini-stm32v/src/stm32_spi.c | 10 +- configs/hymini-stm32v/src/stm32_ssd1289.c | 46 ++-- configs/hymini-stm32v/src/stm32_ts.c | 4 +- configs/kwikstik-k40/src/k40_lcd.c | 4 +- configs/kwikstik-k40/src/k40_leds.c | 4 +- configs/kwikstik-k40/src/k40_spi.c | 10 +- .../launchxl-tms57004/src/tms570_autoleds.c | 4 +- configs/lincoln60/src/lpc17_leds.c | 4 +- configs/lm3s6432-s2e/src/lm_leds.c | 6 +- configs/lm3s6432-s2e/src/lm_ssi.c | 8 +- configs/lm3s6965-ek/src/lm_leds.c | 6 +- configs/lm3s6965-ek/src/lm_oled.c | 4 +- configs/lm3s6965-ek/src/lm_ssi.c | 8 +- configs/lm3s8962-ek/src/lm_leds.c | 6 +- configs/lm3s8962-ek/src/lm_oled.c | 4 +- configs/lm3s8962-ek/src/lm_ssi.c | 8 +- configs/lm4f120-launchpad/src/lm4f_autoleds.c | 6 +- configs/lm4f120-launchpad/src/lm4f_ssi.c | 8 +- configs/lpc4330-xplorer/src/lpc43_appinit.c | 8 +- configs/lpc4330-xplorer/src/lpc43_autoleds.c | 4 +- configs/lpc4330-xplorer/src/lpc43_userleds.c | 4 +- configs/lpc4337-ws/src/lpc43_adc.c | 4 +- configs/lpc4337-ws/src/lpc43_appinit.c | 4 +- configs/lpc4357-evb/src/lpc43_appinit.c | 8 +- configs/lpc4357-evb/src/lpc43_autoleds.c | 4 +- configs/lpc4357-evb/src/lpc43_userleds.c | 4 +- configs/lpc4370-link2/src/lpc43_adc.c | 4 +- configs/lpc4370-link2/src/lpc43_appinit.c | 4 +- configs/lpc4370-link2/src/lpc43_autoleds.c | 4 +- configs/lpc4370-link2/src/lpc43_userleds.c | 4 +- configs/lpcxpresso-lpc1115/src/lpc11_adc.c | 4 +- configs/lpcxpresso-lpc1115/src/lpc11_dac.c | 4 +- configs/lpcxpresso-lpc1115/src/lpc11_leds.c | 4 +- configs/lpcxpresso-lpc1115/src/lpc11_pwm.c | 12 +- configs/lpcxpresso-lpc1115/src/lpc11_ssp.c | 14 +- configs/lpcxpresso-lpc1768/src/lpc17_adc.c | 4 +- configs/lpcxpresso-lpc1768/src/lpc17_dac.c | 4 +- configs/lpcxpresso-lpc1768/src/lpc17_leds.c | 4 +- configs/lpcxpresso-lpc1768/src/lpc17_oled.c | 4 +- configs/lpcxpresso-lpc1768/src/lpc17_pwm.c | 12 +- configs/lpcxpresso-lpc1768/src/lpc17_ssp.c | 14 +- configs/maple/src/stm32_lcd.c | 22 +- configs/maple/src/stm32_leds.c | 4 +- configs/maple/src/stm32_spi.c | 6 +- configs/mbed/src/lpc17_adc.c | 4 +- configs/mbed/src/lpc17_dac.c | 4 +- configs/mbed/src/lpc17_hidkbd.c | 2 +- configs/mbed/src/lpc17_leds.c | 4 +- configs/mbed/src/lpc17_pwm.c | 12 +- configs/mcu123-lpc214x/src/lpc2148_spi1.c | 20 +- configs/mikroe-stm32f4/src/stm32_mio283qt2.c | 6 +- configs/mikroe-stm32f4/src/stm32_mio283qt9a.c | 6 +- configs/mikroe-stm32f4/src/stm32_pwm.c | 4 +- configs/mikroe-stm32f4/src/stm32_qencoder.c | 2 +- configs/mikroe-stm32f4/src/stm32_spi.c | 8 +- .../mikroe-stm32f4/src/stm32_touchscreen.c | 16 +- configs/mikroe-stm32f4/src/stm32_usb.c | 4 +- configs/mikroe-stm32f4/src/stm32_vs1053.c | 2 +- configs/mirtoo/README.txt | 6 +- configs/mirtoo/src/pic32_appinit.c | 10 +- configs/mirtoo/src/pic32_leds.c | 4 +- configs/mirtoo/src/pic32_spi2.c | 6 +- configs/moteino-mega/src/avr_leds.c | 4 +- configs/ne64badge/src/m9s12_buttons.c | 4 +- configs/ne64badge/src/m9s12_leds.c | 4 +- configs/ne64badge/src/m9s12_spi.c | 4 +- configs/nucleo-144/src/stm32_appinitialize.c | 4 +- configs/nucleo-144/src/stm32_autoleds.c | 4 +- configs/nucleo-144/src/stm32_sdio.c | 4 +- configs/nucleo-144/src/stm32_spi.c | 16 +- configs/nucleo-144/src/stm32_userleds.c | 4 +- configs/nucleo-f303re/src/stm32_adc.c | 4 +- configs/nucleo-f303re/src/stm32_autoleds.c | 4 +- configs/nucleo-f303re/src/stm32_can.c | 8 +- configs/nucleo-f303re/src/stm32_pwm.c | 8 +- configs/nucleo-f303re/src/stm32_spi.c | 10 +- configs/nucleo-f303re/src/stm32_ssd1351.c | 8 +- configs/nucleo-f303re/src/stm32_userleds.c | 4 +- configs/nucleo-f4x1re/src/stm32_adc.c | 4 +- configs/nucleo-f4x1re/src/stm32_ajoystick.c | 14 +- configs/nucleo-f4x1re/src/stm32_autoleds.c | 4 +- configs/nucleo-f4x1re/src/stm32_spi.c | 12 +- configs/nucleo-f4x1re/src/stm32_userleds.c | 4 +- configs/nucleo-f4x1re/src/stm32_wireless.c | 6 +- configs/nucleo-l476rg/src/stm32_adc.c | 4 +- configs/nucleo-l476rg/src/stm32_ajoystick.c | 14 +- configs/nucleo-l476rg/src/stm32_appinit.c | 4 +- configs/nucleo-l476rg/src/stm32_autoleds.c | 4 +- configs/nucleo-l476rg/src/stm32_spi.c | 12 +- configs/nucleo-l476rg/src/stm32_userleds.c | 4 +- configs/nucleo-l476rg/src/stm32_wireless.c | 6 +- configs/nutiny-nuc120/src/nuc_led.c | 4 +- configs/olimex-lpc-h3131/src/lpc31_leds.c | 4 +- configs/olimex-lpc-h3131/src/lpc31_mmcsd.c | 4 +- configs/olimex-lpc-h3131/src/lpc31_spi.c | 6 +- configs/olimex-lpc-h3131/src/lpc31_usbhost.c | 10 +- configs/olimex-lpc1766stk/src/lpc17_can.c | 8 +- configs/olimex-lpc1766stk/src/lpc17_hidkbd.c | 2 +- .../olimex-lpc1766stk/src/lpc17_hidmouse.c | 10 +- configs/olimex-lpc1766stk/src/lpc17_lcd.c | 4 +- configs/olimex-lpc1766stk/src/lpc17_leds.c | 4 +- configs/olimex-lpc1766stk/src/lpc17_ssp.c | 12 +- configs/olimex-stm32-h405/src/stm32_adc.c | 4 +- .../olimex-stm32-h405/src/stm32_autoleds.c | 4 +- configs/olimex-stm32-h405/src/stm32_can.c | 8 +- .../olimex-stm32-h405/src/stm32_userleds.c | 4 +- configs/olimex-stm32-h407/src/stm32_adc.c | 4 +- .../olimex-stm32-h407/src/stm32_autoleds.c | 4 +- configs/olimex-stm32-h407/src/stm32_can.c | 8 +- configs/olimex-stm32-h407/src/stm32_sdio.c | 4 +- configs/olimex-stm32-h407/src/stm32_usb.c | 6 +- .../olimex-stm32-h407/src/stm32_userleds.c | 4 +- configs/olimex-stm32-p107/src/stm32_can.c | 8 +- configs/olimex-stm32-p107/src/stm32_spi.c | 6 +- configs/olimex-stm32-p207/src/stm32_adc.c | 4 +- .../olimex-stm32-p207/src/stm32_autoleds.c | 4 +- configs/olimex-stm32-p207/src/stm32_can.c | 8 +- configs/olimex-stm32-p207/src/stm32_usb.c | 6 +- .../olimex-stm32-p207/src/stm32_userleds.c | 4 +- configs/olimexino-stm32/src/stm32_can.c | 8 +- configs/olimexino-stm32/src/stm32_leds.c | 4 +- configs/olimexino-stm32/src/stm32_spi.c | 10 +- configs/open1788/src/lpc17_autoleds.c | 4 +- configs/open1788/src/lpc17_ssp.c | 16 +- configs/open1788/src/lpc17_touchscreen.c | 6 +- configs/open1788/src/lpc17_userleds.c | 4 +- .../pcblogic-pic32mx/src/pic32mx_lcd1602.c | 4 +- configs/pcduino-a10/src/a1x_leds.c | 4 +- configs/pic32mx-starterkit/src/pic32mx_leds.c | 4 +- configs/pic32mx-starterkit/src/pic32mx_spi.c | 20 +- configs/pic32mx7mmb/src/pic32_leds.c | 4 +- configs/pic32mx7mmb/src/pic32_mio283qt2.c | 6 +- configs/pic32mx7mmb/src/pic32_spi.c | 20 +- configs/pic32mx7mmb/src/pic32_touchscreen.c | 10 +- .../pic32mz-starterkit/src/pic32mz_autoleds.c | 4 +- configs/pic32mz-starterkit/src/pic32mz_spi.c | 28 +-- .../pic32mz-starterkit/src/pic32mz_userleds.c | 4 +- configs/sabre-6quad/src/imx_autoleds.c | 4 +- configs/sabre-6quad/src/imx_bringup.c | 2 +- configs/sam3u-ek/src/sam_lcd.c | 22 +- configs/sam3u-ek/src/sam_leds.c | 4 +- configs/sam3u-ek/src/sam_spi.c | 4 +- configs/sam3u-ek/src/sam_touchscreen.c | 6 +- configs/sam4e-ek/src/sam_ads7843e.c | 6 +- configs/sam4e-ek/src/sam_at25.c | 10 +- configs/sam4e-ek/src/sam_ethernet.c | 20 +- configs/sam4e-ek/src/sam_hsmci.c | 4 +- configs/sam4e-ek/src/sam_ili9325.c | 6 +- configs/sam4e-ek/src/sam_ili9341.c | 6 +- configs/sam4e-ek/src/sam_leds.c | 4 +- configs/sam4e-ek/src/sam_spi.c | 4 +- configs/sam4l-xplained/src/sam_autoleds.c | 4 +- configs/sam4l-xplained/src/sam_mmcsd.c | 4 +- configs/sam4l-xplained/src/sam_slcd.c | 4 +- configs/sam4l-xplained/src/sam_spi.c | 4 +- .../sam4l-xplained/src/sam_ug2832hsweg04.c | 8 +- configs/sam4l-xplained/src/sam_userleds.c | 4 +- configs/sam4s-xplained-pro/src/sam_autoleds.c | 4 +- configs/sam4s-xplained-pro/src/sam_hsmci.c | 6 +- configs/sam4s-xplained-pro/src/sam_tc.c | 20 +- configs/sam4s-xplained-pro/src/sam_userleds.c | 4 +- configs/sam4s-xplained-pro/src/sam_wdt.c | 16 +- configs/sam4s-xplained/src/sam_autoleds.c | 4 +- configs/sam4s-xplained/src/sam_userleds.c | 4 +- configs/sama5d2-xult/src/sam_autoleds.c | 4 +- configs/sama5d2-xult/src/sam_bringup.c | 2 +- configs/sama5d2-xult/src/sam_userleds.c | 4 +- configs/sama5d3-xplained/src/sam_adc.c | 4 +- configs/sama5d3-xplained/src/sam_ajoystick.c | 14 +- configs/sama5d3-xplained/src/sam_at25.c | 10 +- configs/sama5d3-xplained/src/sam_autoleds.c | 4 +- configs/sama5d3-xplained/src/sam_can.c | 8 +- configs/sama5d3-xplained/src/sam_ethernet.c | 28 +-- configs/sama5d3-xplained/src/sam_hsmci.c | 8 +- configs/sama5d3-xplained/src/sam_i2schar.c | 4 +- configs/sama5d3-xplained/src/sam_nandflash.c | 8 +- configs/sama5d3-xplained/src/sam_pwm.c | 4 +- configs/sama5d3-xplained/src/sam_spi.c | 4 +- configs/sama5d3-xplained/src/sam_usb.c | 26 +-- configs/sama5d3-xplained/src/sam_userleds.c | 4 +- configs/sama5d3x-ek/src/sam_adc.c | 4 +- configs/sama5d3x-ek/src/sam_at24.c | 10 +- configs/sama5d3x-ek/src/sam_at25.c | 10 +- configs/sama5d3x-ek/src/sam_autoleds.c | 4 +- configs/sama5d3x-ek/src/sam_can.c | 8 +- configs/sama5d3x-ek/src/sam_ethernet.c | 28 +-- configs/sama5d3x-ek/src/sam_hsmci.c | 8 +- configs/sama5d3x-ek/src/sam_i2schar.c | 4 +- configs/sama5d3x-ek/src/sam_nandflash.c | 8 +- configs/sama5d3x-ek/src/sam_ov2640.c | 12 +- configs/sama5d3x-ek/src/sam_pwm.c | 4 +- configs/sama5d3x-ek/src/sam_spi.c | 4 +- configs/sama5d3x-ek/src/sam_touchscreen.c | 6 +- configs/sama5d3x-ek/src/sam_usb.c | 24 +- configs/sama5d3x-ek/src/sam_userleds.c | 4 +- configs/sama5d3x-ek/src/sam_wm8904.c | 14 +- configs/sama5d4-ek/src/sam_adc.c | 4 +- configs/sama5d4-ek/src/sam_at25.c | 14 +- configs/sama5d4-ek/src/sam_audio_null.c | 8 +- configs/sama5d4-ek/src/sam_autoleds.c | 4 +- configs/sama5d4-ek/src/sam_automount.c | 6 +- configs/sama5d4-ek/src/sam_bringup.c | 6 +- configs/sama5d4-ek/src/sam_ethernet.c | 28 +-- configs/sama5d4-ek/src/sam_hsmci.c | 8 +- configs/sama5d4-ek/src/sam_maxtouch.c | 6 +- configs/sama5d4-ek/src/sam_nandflash.c | 8 +- configs/sama5d4-ek/src/sam_pmic.c | 2 +- configs/sama5d4-ek/src/sam_pwm.c | 4 +- configs/sama5d4-ek/src/sam_spi.c | 4 +- configs/sama5d4-ek/src/sam_usb.c | 24 +- configs/sama5d4-ek/src/sam_userleds.c | 4 +- configs/sama5d4-ek/src/sam_wm8904.c | 14 +- configs/samd20-xplained/src/sam_autoleds.c | 4 +- configs/samd20-xplained/src/sam_mmcsd.c | 4 +- configs/samd20-xplained/src/sam_spi.c | 4 +- .../samd20-xplained/src/sam_ug2832hsweg04.c | 8 +- configs/samd20-xplained/src/sam_userleds.c | 4 +- configs/samd21-xplained/src/sam_autoleds.c | 4 +- configs/samd21-xplained/src/sam_mmcsd.c | 4 +- configs/samd21-xplained/src/sam_spi.c | 4 +- .../samd21-xplained/src/sam_ug2832hsweg04.c | 8 +- configs/samd21-xplained/src/sam_userleds.c | 4 +- configs/same70-xplained/src/sam_at24config.c | 8 +- configs/same70-xplained/src/sam_autoleds.c | 4 +- configs/same70-xplained/src/sam_bringup.c | 6 +- configs/same70-xplained/src/sam_ethernet.c | 34 +-- configs/same70-xplained/src/sam_hsmci.c | 8 +- configs/same70-xplained/src/sam_mcan.c | 8 +- configs/same70-xplained/src/sam_spi.c | 4 +- configs/saml21-xplained/src/sam_autoleds.c | 4 +- configs/saml21-xplained/src/sam_mmcsd.c | 4 +- configs/saml21-xplained/src/sam_spi.c | 4 +- .../saml21-xplained/src/sam_ug2832hsweg04.c | 8 +- configs/saml21-xplained/src/sam_userleds.c | 4 +- configs/samv71-xult/src/sam_at24config.c | 8 +- configs/samv71-xult/src/sam_audio_null.c | 8 +- configs/samv71-xult/src/sam_autoleds.c | 4 +- configs/samv71-xult/src/sam_bringup.c | 6 +- configs/samv71-xult/src/sam_ethernet.c | 34 +-- configs/samv71-xult/src/sam_hsmci.c | 8 +- configs/samv71-xult/src/sam_ili9488.c | 30 +-- configs/samv71-xult/src/sam_maxtouch.c | 6 +- configs/samv71-xult/src/sam_mcan.c | 8 +- configs/samv71-xult/src/sam_spi.c | 4 +- configs/samv71-xult/src/sam_wm8904.c | 14 +- configs/shenzhou/src/stm32_adc.c | 4 +- configs/shenzhou/src/stm32_autoleds.c | 4 +- configs/shenzhou/src/stm32_can.c | 8 +- configs/shenzhou/src/stm32_ili93xx.c | 22 +- configs/shenzhou/src/stm32_mmcsd.c | 4 +- configs/shenzhou/src/stm32_spi.c | 8 +- configs/shenzhou/src/stm32_ssd1289.c | 16 +- configs/shenzhou/src/stm32_touchscreen.c | 6 +- configs/shenzhou/src/stm32_usb.c | 4 +- configs/shenzhou/src/stm32_userleds.c | 4 +- configs/shenzhou/src/stm32_w25.c | 10 +- configs/sim/src/sim_bringup.c | 2 +- configs/sim/src/sim_touchscreen.c | 12 +- configs/spark/src/stm32_appinit.c | 8 +- configs/spark/src/stm32_autoleds.c | 4 +- configs/spark/src/stm32_composite.c | 14 +- configs/spark/src/stm32_spi.c | 10 +- configs/spark/src/stm32_userleds.c | 4 +- configs/spark/src/stm32_wireless.c | 6 +- configs/stm3210e-eval/src/stm32_adc.c | 4 +- configs/stm3210e-eval/src/stm32_appinit.c | 4 +- configs/stm3210e-eval/src/stm32_can.c | 8 +- configs/stm3210e-eval/src/stm32_lcd.c | 58 ++--- configs/stm3210e-eval/src/stm32_leds.c | 4 +- configs/stm3210e-eval/src/stm32_spi.c | 10 +- configs/stm3220g-eval/src/stm32_adc.c | 4 +- configs/stm3220g-eval/src/stm32_appinit.c | 4 +- configs/stm3220g-eval/src/stm32_autoleds.c | 4 +- configs/stm3220g-eval/src/stm32_can.c | 8 +- configs/stm3220g-eval/src/stm32_lcd.c | 10 +- configs/stm3220g-eval/src/stm32_pwm.c | 4 +- configs/stm3220g-eval/src/stm32_spi.c | 10 +- configs/stm3220g-eval/src/stm32_stmpe811.c | 8 +- configs/stm3220g-eval/src/stm32_usb.c | 4 +- configs/stm3220g-eval/src/stm32_userleds.c | 4 +- configs/stm3240g-eval/src/stm32_adc.c | 4 +- configs/stm3240g-eval/src/stm32_appinit.c | 8 +- configs/stm3240g-eval/src/stm32_autoleds.c | 4 +- configs/stm3240g-eval/src/stm32_boot.c | 6 +- configs/stm3240g-eval/src/stm32_can.c | 8 +- configs/stm3240g-eval/src/stm32_lcd.c | 10 +- configs/stm3240g-eval/src/stm32_pwm.c | 4 +- configs/stm3240g-eval/src/stm32_spi.c | 10 +- configs/stm3240g-eval/src/stm32_stmpe811.c | 8 +- configs/stm3240g-eval/src/stm32_usb.c | 4 +- configs/stm3240g-eval/src/stm32_userleds.c | 4 +- configs/stm32_tiny/src/stm32_leds.c | 4 +- configs/stm32_tiny/src/stm32_pwm.c | 4 +- configs/stm32_tiny/src/stm32_spi.c | 4 +- configs/stm32_tiny/src/stm32_wireless.c | 4 +- .../stm32f103-minimum/src/stm32_autoleds.c | 4 +- configs/stm32f103-minimum/src/stm32_spi.c | 4 +- configs/stm32f3discovery/src/stm32_autoleds.c | 4 +- configs/stm32f3discovery/src/stm32_pwm.c | 4 +- configs/stm32f3discovery/src/stm32_qencoder.c | 2 +- configs/stm32f3discovery/src/stm32_spi.c | 10 +- configs/stm32f3discovery/src/stm32_userleds.c | 4 +- configs/stm32f429i-disco/src/stm32_appinit.c | 8 +- configs/stm32f429i-disco/src/stm32_autoleds.c | 4 +- .../stm32f429i-disco/src/stm32_ili93414ws.c | 10 +- configs/stm32f429i-disco/src/stm32_lcd.c | 8 +- configs/stm32f429i-disco/src/stm32_spi.c | 12 +- configs/stm32f429i-disco/src/stm32_usb.c | 6 +- configs/stm32f429i-disco/src/stm32_userleds.c | 4 +- configs/stm32f4discovery/src/stm32_autoleds.c | 4 +- .../stm32f4discovery/src/stm32_bh1750fvi.c | 4 +- configs/stm32f4discovery/src/stm32_bmp180.c | 4 +- configs/stm32f4discovery/src/stm32_bringup.c | 16 +- configs/stm32f4discovery/src/stm32_ethernet.c | 14 +- configs/stm32f4discovery/src/stm32_max31855.c | 2 +- configs/stm32f4discovery/src/stm32_max6675.c | 2 +- configs/stm32f4discovery/src/stm32_pca9635.c | 4 +- configs/stm32f4discovery/src/stm32_pwm.c | 4 +- configs/stm32f4discovery/src/stm32_qencoder.c | 2 +- configs/stm32f4discovery/src/stm32_rgbled.c | 8 +- configs/stm32f4discovery/src/stm32_sdio.c | 4 +- configs/stm32f4discovery/src/stm32_spi.c | 10 +- configs/stm32f4discovery/src/stm32_ssd1289.c | 6 +- configs/stm32f4discovery/src/stm32_ssd1351.c | 8 +- .../src/stm32_ug2864ambag01.c | 8 +- .../src/stm32_ug2864hsweg01.c | 8 +- configs/stm32f4discovery/src/stm32_usb.c | 10 +- configs/stm32f4discovery/src/stm32_userleds.c | 4 +- configs/stm32f746g-disco/src/stm32_autoleds.c | 4 +- configs/stm32f746g-disco/src/stm32_spi.c | 14 +- configs/stm32f746g-disco/src/stm32_userleds.c | 4 +- configs/stm32l476vg-disco/src/stm32_appinit.c | 6 +- .../stm32l476vg-disco/src/stm32_autoleds.c | 4 +- configs/stm32l476vg-disco/src/stm32_spi.c | 12 +- .../stm32l476vg-disco/src/stm32_userleds.c | 4 +- configs/stm32ldiscovery/src/stm32_autoleds.c | 4 +- configs/stm32ldiscovery/src/stm32_lcd.c | 4 +- configs/stm32ldiscovery/src/stm32_pwm.c | 4 +- configs/stm32ldiscovery/src/stm32_qencoder.c | 2 +- configs/stm32ldiscovery/src/stm32_spi.c | 10 +- configs/stm32ldiscovery/src/stm32_userleds.c | 4 +- configs/stm32vldiscovery/src/stm32_leds.c | 4 +- configs/sure-pic32mx/src/pic32mx_autoleds.c | 4 +- configs/sure-pic32mx/src/pic32mx_lcd1602.c | 4 +- configs/sure-pic32mx/src/pic32mx_spi.c | 4 +- configs/teensy-2.0/src/at90usb_leds.c | 4 +- configs/teensy-2.0/src/at90usb_spi.c | 8 +- configs/teensy-3.x/src/k20_pwm.c | 12 +- configs/teensy-3.x/src/k20_spi.c | 10 +- configs/teensy-lc/src/kl_led.c | 4 +- configs/teensy-lc/src/kl_pwm.c | 4 +- configs/teensy-lc/src/kl_spi.c | 4 +- .../tm4c123g-launchpad/src/tm4c_autoleds.c | 6 +- configs/tm4c123g-launchpad/src/tm4c_ssi.c | 8 +- configs/tm4c1294-launchpad/src/tm4c_bringup.c | 6 +- configs/tm4c1294-launchpad/src/tm4c_timer.c | 2 +- .../tm4c1294-launchpad/src/tm4c_userleds.c | 4 +- configs/twr-k60n512/src/k60_leds.c | 4 +- configs/twr-k60n512/src/k60_spi.c | 10 +- configs/u-blox-c027/src/lpc17_adc.c | 4 +- configs/u-blox-c027/src/lpc17_dac.c | 4 +- configs/u-blox-c027/src/lpc17_leds.c | 4 +- configs/u-blox-c027/src/lpc17_pwm.c | 12 +- configs/u-blox-c027/src/lpc17_ssp.c | 14 +- configs/u-blox-c027/src/lpc17_ubxmdm.c | 4 +- configs/ubw32/src/pic32_leds.c | 4 +- configs/us7032evb1/shterm/shterm.c | 2 +- .../viewtool-stm32f107/src/stm32_appinit.c | 4 +- configs/viewtool-stm32f107/src/stm32_can.c | 8 +- configs/viewtool-stm32f107/src/stm32_leds.c | 4 +- configs/viewtool-stm32f107/src/stm32_mmcsd.c | 4 +- .../viewtool-stm32f107/src/stm32_mpl115a.c | 2 +- configs/viewtool-stm32f107/src/stm32_spi.c | 10 +- .../viewtool-stm32f107/src/stm32_ssd1289.c | 46 ++-- .../src/stm32_touchscreen.c | 6 +- configs/zkit-arm-1769/src/lpc17_adc.c | 4 +- configs/zkit-arm-1769/src/lpc17_can.c | 12 +- configs/zkit-arm-1769/src/lpc17_dac.c | 4 +- configs/zkit-arm-1769/src/lpc17_lcd.c | 4 +- configs/zkit-arm-1769/src/lpc17_leds.c | 4 +- configs/zkit-arm-1769/src/lpc17_spi.c | 10 +- configs/zkit-arm-1769/src/lpc17_ssp.c | 14 +- configs/zp214xpa/src/lpc2148_spi1.c | 26 +-- configs/zp214xpa/src/lpc2148_ug2864ambag01.c | 8 +- drivers/analog/ad5410.c | 2 +- drivers/analog/adc.c | 2 +- drivers/analog/ads1242.c | 14 +- drivers/analog/ads1255.c | 2 +- drivers/analog/pga11x.c | 6 +- drivers/audio/audio_null.c | 12 +- drivers/audio/i2schar.c | 14 +- drivers/audio/vs1053.c | 36 +-- drivers/audio/wm8904.c | 32 +-- drivers/bch/bchdev_register.c | 4 +- drivers/bch/bchdev_unregister.c | 4 +- drivers/bch/bchlib_cache.c | 4 +- drivers/bch/bchlib_read.c | 2 +- drivers/bch/bchlib_setup.c | 12 +- drivers/bch/bchlib_write.c | 4 +- drivers/can.c | 6 +- drivers/i2c/i2c_driver.c | 4 +- drivers/input/ads7843e.c | 18 +- drivers/input/max11802.c | 20 +- drivers/input/mxt.c | 58 ++--- drivers/input/stmpe811_adc.c | 8 +- drivers/input/stmpe811_base.c | 12 +- drivers/input/stmpe811_gpio.c | 10 +- drivers/input/stmpe811_tsc.c | 14 +- drivers/input/tsc2007.c | 24 +- drivers/lcd/ili9341.c | 16 +- drivers/lcd/memlcd.c | 16 +- drivers/lcd/mio283qt2.c | 8 +- drivers/lcd/mio283qt9a.c | 6 +- drivers/lcd/nokia6100.c | 14 +- drivers/lcd/p14201.c | 20 +- drivers/lcd/pcf8574_lcd_backpack.c | 4 +- drivers/lcd/ra8875.c | 10 +- drivers/lcd/skeleton.c | 4 +- drivers/lcd/ssd1289.c | 16 +- drivers/lcd/ssd1306.h | 4 +- drivers/lcd/ssd1306_i2c.c | 4 +- drivers/lcd/ssd1351.c | 4 +- drivers/lcd/st7565.c | 4 +- drivers/lcd/st7567.c | 4 +- drivers/lcd/ug-2864ambag01.c | 4 +- drivers/lcd/ug-9664hswag01.c | 4 +- drivers/leds/pca9635pw.c | 28 +-- drivers/leds/rgbled.c | 6 +- drivers/leds/userled_upper.c | 4 +- drivers/loop/losetup.c | 20 +- drivers/mmcsd/mmcsd_sdio.c | 132 +++++------ drivers/mmcsd/mmcsd_spi.c | 100 ++++----- drivers/modem/u-blox.c | 10 +- drivers/mtd/at24xx.c | 2 +- drivers/mtd/at25.c | 4 +- drivers/mtd/at45db.c | 4 +- drivers/mtd/filemtd.c | 10 +- drivers/mtd/ftl.c | 30 +-- drivers/mtd/hamming.c | 6 +- drivers/mtd/is25xp.c | 2 +- drivers/mtd/m25px.c | 2 +- drivers/mtd/mtd_config.c | 2 +- drivers/mtd/mtd_nand.c | 32 +-- drivers/mtd/mtd_nandecc.c | 8 +- drivers/mtd/mtd_onfi.c | 4 +- drivers/mtd/mtd_partition.c | 26 +-- drivers/mtd/mtd_procfs.c | 6 +- drivers/mtd/mtd_rwbuffer.c | 10 +- drivers/mtd/n25qxxx.c | 36 +-- drivers/mtd/rammtd.c | 6 +- drivers/mtd/ramtron.c | 4 +- drivers/mtd/s25fl1.c | 36 +-- drivers/mtd/sector512.c | 18 +- drivers/mtd/smart.c | 186 ++++++++-------- drivers/mtd/sst25.c | 4 +- drivers/mtd/sst25xx.c | 2 +- drivers/mtd/sst26.c | 6 +- drivers/mtd/sst39vf.c | 4 +- drivers/mtd/w25.c | 4 +- drivers/net/cs89x0.c | 4 +- drivers/net/dm90x0.c | 28 +-- drivers/net/e1000.c | 2 +- drivers/net/ftmac100.c | 6 +- drivers/net/loopback.c | 6 +- drivers/net/phy_notify.c | 16 +- drivers/net/skeleton.c | 4 +- drivers/net/slip.c | 14 +- drivers/net/tun.c | 4 +- drivers/net/vnet.c | 2 +- drivers/pipes/pipe_common.c | 6 +- drivers/power/battery_charger.c | 4 +- drivers/power/battery_gauge.c | 4 +- drivers/power/bq2425x.c | 50 ++--- drivers/power/max1704x.c | 14 +- drivers/pwm.c | 6 +- drivers/ramdisk.c | 2 +- drivers/rwbuffer.c | 16 +- drivers/sensors/adxl345_base.c | 8 +- drivers/sensors/adxl345_i2c.c | 12 +- drivers/sensors/adxl345_spi.c | 6 +- drivers/sensors/as5048b.c | 66 +++--- drivers/sensors/bh1750fvi.c | 38 ++-- drivers/sensors/bmp180.c | 22 +- drivers/sensors/lm75.c | 50 ++--- drivers/sensors/lm92.c | 66 +++--- drivers/sensors/lsm9ds1.c | 34 +-- drivers/sensors/max31855.c | 18 +- drivers/sensors/max6675.c | 14 +- drivers/sensors/mb7040.c | 22 +- drivers/sensors/mcp9844.c | 18 +- drivers/sensors/mpl115a.c | 24 +- drivers/sensors/ms58xx.c | 54 ++--- drivers/sensors/qencoder.c | 2 +- drivers/sercomm/console.c | 2 +- drivers/serial/serial.c | 2 +- drivers/serial/uart_16550.c | 2 +- drivers/spi/spi_bitbang.c | 6 +- drivers/timers/cs2100-cp.c | 96 ++++---- drivers/timers/ds3231.c | 12 +- drivers/timers/pcf85263.c | 12 +- drivers/timers/timer.c | 10 +- drivers/timers/watchdog.c | 10 +- drivers/usbhost/usbhost_cdcacm.c | 46 ++-- drivers/usbhost/usbhost_devaddr.c | 2 +- drivers/usbhost/usbhost_enumerate.c | 24 +- drivers/usbhost/usbhost_hidkbd.c | 22 +- drivers/usbhost/usbhost_hidmouse.c | 24 +- drivers/usbhost/usbhost_hub.c | 44 ++-- drivers/usbhost/usbhost_skeleton.c | 8 +- drivers/usbhost/usbhost_storage.c | 30 +-- drivers/video/ov2640.c | 46 ++-- drivers/wireless/cc3000/cc3000.c | 10 +- drivers/wireless/cc3000/cc3000drv.c | 4 +- drivers/wireless/cc3000/socket.c | 4 +- drivers/wireless/ieee802154/mrf24j40.c | 34 +-- drivers/wireless/nrf24l01.c | 14 +- drivers/wireless/pn532.c | 42 ++-- fs/aio/aio_fsync.c | 2 +- fs/aio/aio_read.c | 2 +- fs/aio/aio_signal.c | 6 +- fs/aio/aio_write.c | 4 +- fs/binfs/fs_binfs.c | 4 +- fs/driver/fs_blockproxy.c | 8 +- fs/driver/fs_closeblockdriver.c | 2 +- fs/driver/fs_findblockdriver.c | 6 +- fs/driver/fs_openblockdriver.c | 4 +- fs/fat/fs_configfat.c | 38 ++-- fs/fat/fs_fat32.c | 4 +- fs/fat/fs_fat32util.c | 50 ++--- fs/fat/fs_mkfatfs.c | 26 +-- fs/mmap/fs_mmap.c | 6 +- fs/mmap/fs_munmap.c | 4 +- fs/mmap/fs_rammap.c | 8 +- fs/mount/fs_automount.c | 26 +-- fs/mount/fs_mount.c | 14 +- fs/nfs/nfs_util.c | 24 +- fs/nfs/nfs_vfsops.c | 88 ++++---- fs/nfs/rpc_clnt.c | 52 ++--- fs/nxffs/nxffs_block.c | 4 +- fs/nxffs/nxffs_blockstats.c | 26 +-- fs/nxffs/nxffs_cache.c | 8 +- fs/nxffs/nxffs_dump.c | 6 +- fs/nxffs/nxffs_initialize.c | 26 +-- fs/nxffs/nxffs_inode.c | 8 +- fs/nxffs/nxffs_ioctl.c | 4 +- fs/nxffs/nxffs_open.c | 50 ++--- fs/nxffs/nxffs_pack.c | 32 +-- fs/nxffs/nxffs_read.c | 16 +- fs/nxffs/nxffs_reformat.c | 14 +- fs/nxffs/nxffs_stat.c | 2 +- fs/nxffs/nxffs_unlink.c | 8 +- fs/nxffs/nxffs_write.c | 32 +-- fs/procfs/fs_procfs.c | 6 +- fs/procfs/fs_procfscpuload.c | 10 +- fs/procfs/fs_procfskmm.c | 10 +- fs/procfs/fs_procfsproc.c | 42 ++-- fs/procfs/fs_procfsuptime.c | 10 +- fs/procfs/fs_skeleton.c | 8 +- fs/romfs/fs_romfs.c | 62 +++--- fs/romfs/fs_romfsutil.c | 2 +- fs/smartfs/smartfs_procfs.c | 8 +- fs/smartfs/smartfs_smart.c | 34 +-- fs/smartfs/smartfs_utils.c | 48 ++-- fs/tmpfs/fs_tmpfs.c | 2 +- fs/unionfs/fs_unionfs.c | 12 +- fs/vfs/fs_epoll.c | 4 +- graphics/nxbe/nxbe_bitmap.c | 4 +- graphics/nxbe/nxbe_clipper.c | 2 +- graphics/nxbe/nxbe_configure.c | 10 +- graphics/nxmu/nx_start.c | 12 +- graphics/nxmu/nxmu_reportposition.c | 2 +- graphics/nxmu/nxmu_sendclient.c | 2 +- graphics/nxmu/nxmu_server.c | 20 +- graphics/nxsu/nx_open.c | 4 +- graphics/nxterm/nxterm_driver.c | 2 +- graphics/nxterm/nxterm_font.c | 2 +- graphics/nxterm/nxterm_kbdin.c | 14 +- graphics/nxterm/nxterm_redraw.c | 2 +- graphics/nxterm/nxterm_register.c | 6 +- graphics/nxterm/nxterm_scroll.c | 8 +- graphics/vnc/server/vnc_fbdev.c | 30 +-- graphics/vnc/server/vnc_negotiate.c | 50 ++--- graphics/vnc/server/vnc_raw.c | 4 +- graphics/vnc/server/vnc_receiver.c | 32 +-- graphics/vnc/server/vnc_rre.c | 4 +- graphics/vnc/server/vnc_server.c | 14 +- graphics/vnc/server/vnc_server.h | 8 +- graphics/vnc/server/vnc_updater.c | 8 +- include/debug.h | 207 +++++++++--------- include/nuttx/mm/shm.h | 8 +- include/nuttx/spi/spi_bitbang.c | 4 +- include/nuttx/spi/spi_bitbang.h | 4 +- include/nuttx/wireless/nrf24l01.h | 4 +- libc/aio/lio_listio.c | 12 +- libc/misc/lib_dbg.c | 6 +- libc/misc/lib_slcddecode.c | 12 +- libc/netdb/lib_dnsaddserver.c | 8 +- libc/netdb/lib_dnsbind.c | 6 +- libc/netdb/lib_dnscache.c | 2 +- libc/netdb/lib_dnsforeach.c | 8 +- libc/netdb/lib_dnsquery.c | 20 +- libc/netdb/lib_gethostbyaddrr.c | 2 +- libc/netdb/lib_gethostbynamer.c | 2 +- libc/pthread/pthread_attrdestroy.c | 4 +- libc/pthread/pthread_attrgetaffinity.c | 2 +- libc/pthread/pthread_attrgetinheritsched.c | 4 +- libc/pthread/pthread_attrgetschedparam.c | 4 +- libc/pthread/pthread_attrgetschedpolicy.c | 4 +- libc/pthread/pthread_attrgetstacksize.c | 4 +- libc/pthread/pthread_attrinit.c | 4 +- libc/pthread/pthread_attrsetaffinity.c | 2 +- libc/pthread/pthread_attrsetinheritsched.c | 4 +- libc/pthread/pthread_attrsetschedparam.c | 4 +- libc/pthread/pthread_attrsetschedpolicy.c | 4 +- libc/pthread/pthread_attrsetstacksize.c | 4 +- libc/pthread/pthread_condattrdestroy.c | 4 +- libc/pthread/pthread_condattrinit.c | 4 +- libc/pthread/pthread_mutexattrdestroy.c | 4 +- libc/pthread/pthread_mutexattrgetpshared.c | 4 +- libc/pthread/pthread_mutexattrinit.c | 4 +- libc/pthread/pthread_mutexattrsetpshared.c | 4 +- libc/spawn/lib_psa_dump.c | 30 +-- libc/spawn/lib_psfa_dump.c | 12 +- libc/stdio/lib_dtoa.c | 12 +- libc/time/lib_gmtimer.c | 6 +- libc/time/lib_mktime.c | 4 +- libnx/nxfonts/nxfonts_getfont.c | 6 +- libnx/nxmu/nx_bitmap.c | 2 +- libnx/nxmu/nx_connect.c | 8 +- libnx/nxmu/nx_disconnect.c | 2 +- libnx/nxmu/nx_eventhandler.c | 4 +- libnx/nxmu/nx_getrectangle.c | 2 +- libnx/nxmu/nx_redrawreq.c | 2 +- libnx/nxmu/nxmu_sendserver.c | 2 +- libxx/libxx_new.cxx | 2 +- libxx/libxx_newa.cxx | 2 +- libxx/libxx_stdthrow.cxx | 8 +- mm/mm_gran/mm_gran.h | 8 +- mm/mm_gran/mm_pgalloc.c | 8 +- mm/mm_heap/mm_malloc.c | 2 +- mm/mm_heap/mm_sem.c | 22 +- mm/shm/shm_initialize.c | 2 +- mm/shm/shmat.c | 6 +- mm/shm/shmctl.c | 4 +- mm/shm/shmdt.c | 6 +- mm/shm/shmget.c | 8 +- net/arp/arp_send.c | 8 +- net/icmp/icmp_ping.c | 4 +- net/icmpv6/icmpv6_autoconfig.c | 14 +- net/icmpv6/icmpv6_neighbor.c | 4 +- net/icmpv6/icmpv6_ping.c | 4 +- net/igmp/igmp_group.c | 8 +- net/igmp/igmp_leave.c | 4 +- net/igmp/igmp_timer.c | 12 +- net/iob/iob_add_queue.c | 2 +- net/iob/iob_clone.c | 2 +- net/iob/iob_contig.c | 2 +- net/iob/iob_copyin.c | 4 +- net/iob/iob_dump.c | 2 +- net/local/local_accept.c | 6 +- net/local/local_connect.c | 12 +- net/local/local_fifo.c | 10 +- net/local/local_netpoll.c | 2 +- net/local/local_recvfrom.c | 22 +- net/local/local_recvutils.c | 6 +- net/local/local_send.c | 2 +- net/local/local_sendpacket.c | 2 +- net/local/local_sendto.c | 8 +- net/procfs/net_procfs.c | 18 +- net/route/net_addroute.c | 4 +- net/socket/bind.c | 4 +- net/socket/net_clone.c | 2 +- net/socket/net_sendfile.c | 6 +- net/socket/net_vfcntl.c | 2 +- net/socket/recvfrom.c | 6 +- net/socket/sendto.c | 12 +- net/tcp/tcp_conn.c | 12 +- net/tcp/tcp_send_buffered.c | 14 +- net/tcp/tcp_send_unbuffered.c | 6 +- net/tcp/tcp_wrbuffer.c | 2 +- net/udp/udp_psock_sendto.c | 6 +- sched/clock/clock_getres.c | 6 +- sched/clock/clock_gettime.c | 6 +- sched/clock/clock_settime.c | 6 +- sched/group/group_addrenv.c | 2 +- sched/group/group_childstatus.c | 4 +- sched/group/group_join.c | 2 +- sched/init/os_smpstart.c | 6 +- sched/init/os_start.c | 2 +- sched/module/mod_bind.c | 18 +- sched/module/mod_init.c | 12 +- sched/module/mod_insmod.c | 82 +++---- sched/module/mod_iobuffer.c | 4 +- sched/module/mod_load.c | 8 +- sched/module/mod_procfs.c | 6 +- sched/module/mod_read.c | 6 +- sched/module/mod_registry.c | 2 +- sched/module/mod_rmmod.c | 6 +- sched/module/mod_sections.c | 18 +- sched/module/mod_symbols.c | 18 +- sched/module/mod_verify.c | 6 +- sched/pthread/pthread_completejoin.c | 4 +- sched/pthread/pthread_condbroadcast.c | 4 +- sched/pthread/pthread_conddestroy.c | 4 +- sched/pthread/pthread_condinit.c | 4 +- sched/pthread/pthread_condsignal.c | 8 +- sched/pthread/pthread_condtimedwait.c | 10 +- sched/pthread/pthread_condwait.c | 8 +- sched/pthread/pthread_create.c | 4 +- sched/pthread/pthread_detach.c | 6 +- sched/pthread/pthread_exit.c | 2 +- sched/pthread/pthread_getaffinity.c | 2 +- sched/pthread/pthread_getschedparam.c | 4 +- sched/pthread/pthread_join.c | 14 +- sched/pthread/pthread_mutexdestroy.c | 4 +- sched/pthread/pthread_mutexinit.c | 4 +- sched/pthread/pthread_mutexlock.c | 6 +- sched/pthread/pthread_mutextrylock.c | 4 +- sched/pthread/pthread_mutexunlock.c | 6 +- sched/pthread/pthread_setaffinity.c | 2 +- sched/pthread/pthread_setschedparam.c | 2 +- sched/semaphore/sem_holder.c | 16 +- sched/signal/sig_deliver.c | 2 +- sched/signal/sig_dispatch.c | 2 +- sched/signal/sig_mqnotempty.c | 4 +- sched/signal/sig_nanosleep.c | 4 +- sched/signal/sig_queue.c | 4 +- sched/task/task_create.c | 2 +- sched/task/task_execv.c | 2 +- sched/task/task_posixspawn.c | 10 +- sched/task/task_prctl.c | 8 +- sched/task/task_spawn.c | 10 +- sched/task/task_spawnparms.c | 8 +- sched/task/task_vfork.c | 4 +- 1091 files changed, 5976 insertions(+), 5971 deletions(-) diff --git a/Kconfig b/Kconfig index 12e8887d3b..2881c6cce8 100644 --- a/Kconfig +++ b/Kconfig @@ -413,13 +413,21 @@ if DEBUG_FEATURES comment "Debug SYSLOG Output Controls" +config DEBUG_ERROR + bool "Enable Error Output" + default n + ---help--- + Enables output from err() statements. Errors are significant system + exceptions that require immediate attention. + config DEBUG_WARN bool "Enable Warnings Output" default n + depends on DEBUG_ERROR ---help--- - Enables output from warning statements. Warnings are considered to - be potential errors or errors that will not have serious - consequences. + Enables output from warn() statements. Warnings are considered to + be various unexpected conditions, potential errors or errors that will + not have serious consequences. config DEBUG_INFO bool "Enable Informational Debug Output" diff --git a/arch/arm/src/arm/up_elf.c b/arch/arm/src/arm/up_elf.c index bb6a09d7cc..06c0c5157c 100644 --- a/arch/arm/src/arm/up_elf.c +++ b/arch/arm/src/arm/up_elf.c @@ -86,7 +86,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_machine != EM_ARM) { - bdbg("Not for ARM: e_machine=%04x\n", ehdr->e_machine); + berr("Not for ARM: e_machine=%04x\n", ehdr->e_machine); return -ENOEXEC; } @@ -94,7 +94,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_ident[EI_CLASS] != ELFCLASS32) { - bdbg("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]); + berr("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]); return -ENOEXEC; } @@ -106,7 +106,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB) #endif { - bdbg("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]); + berr("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]); return -ENOEXEC; } @@ -114,7 +114,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if ((ehdr->e_entry & 3) != 0) { - bdbg("Entry point is not properly aligned: %08x\n", ehdr->e_entry); + berr("Entry point is not properly aligned: %08x\n", ehdr->e_entry); return -ENOEXEC } @@ -185,7 +185,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset += sym->st_value - addr; if (offset & 3 || offset <= (int32_t) 0xfe000000 || offset >= (int32_t) 0x02000000) { - bdbg(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n", + berr(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n", ELF32_R_TYPE(rel->r_info), offset); return -EINVAL; @@ -256,7 +256,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, break; default: - bdbg("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info)); + berr("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info)); return -EINVAL; } @@ -266,6 +266,6 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, uintptr_t addr) { - bdbg("RELA relocation not supported\n"); + berr("RELA relocation not supported\n"); return -ENOSYS; } diff --git a/arch/arm/src/arm/up_schedulesigaction.c b/arch/arm/src/arm/up_schedulesigaction.c index 3972b77921..5b99b2059a 100644 --- a/arch/arm/src/arm/up_schedulesigaction.c +++ b/arch/arm/src/arm/up_schedulesigaction.c @@ -94,7 +94,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); /* Make sure that interrupts are disabled */ @@ -108,7 +108,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) * being delivered to the currently executing task. */ - sdbg("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); + serr("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); if (tcb == this_task()) { diff --git a/arch/arm/src/arm/up_sigdeliver.c b/arch/arm/src/arm/up_sigdeliver.c index c03511d4df..0b3b6ea266 100644 --- a/arch/arm/src/arm/up_sigdeliver.c +++ b/arch/arm/src/arm/up_sigdeliver.c @@ -95,7 +95,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -126,7 +126,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/arm/src/armv6-m/up_elf.c b/arch/arm/src/armv6-m/up_elf.c index 6e101ffe60..ad0b4d8dad 100644 --- a/arch/arm/src/armv6-m/up_elf.c +++ b/arch/arm/src/armv6-m/up_elf.c @@ -86,7 +86,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_machine != EM_ARM) { - bdbg("Not for ARM: e_machine=%04x\n", ehdr->e_machine); + berr("Not for ARM: e_machine=%04x\n", ehdr->e_machine); return -ENOEXEC; } @@ -94,7 +94,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_ident[EI_CLASS] != ELFCLASS32) { - bdbg("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]); + berr("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]); return -ENOEXEC; } @@ -106,7 +106,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB) #endif { - bdbg("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]); + berr("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]); return -ENOEXEC; } @@ -181,7 +181,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset += sym->st_value - addr; if (offset & 3 || offset <= (int32_t) 0xfe000000 || offset >= (int32_t) 0x02000000) { - bdbg(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n", + berr(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n", ELF32_R_TYPE(rel->r_info), offset); return -EINVAL; @@ -290,7 +290,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && (offset & 1) == 0) { - bdbg(" ERROR: JUMP24 [%d] requires odd offset, offset=%08lx\n", + berr(" ERROR: JUMP24 [%d] requires odd offset, offset=%08lx\n", ELF32_R_TYPE(rel->r_info), offset); return -EINVAL; @@ -300,7 +300,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, if (offset <= (int32_t)0xff000000 || offset >= (int32_t)0x01000000) { - bdbg(" ERROR: JUMP24 [%d] relocation out of range, branch taget=%08lx\n", + berr(" ERROR: JUMP24 [%d] relocation out of range, branch taget=%08lx\n", ELF32_R_TYPE(rel->r_info), offset); return -EINVAL; @@ -451,7 +451,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, break; default: - bdbg("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info)); + berr("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info)); return -EINVAL; } @@ -461,6 +461,6 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, uintptr_t addr) { - bdbg("RELA relocation not supported\n"); + berr("RELA relocation not supported\n"); return -ENOSYS; } diff --git a/arch/arm/src/armv6-m/up_hardfault.c b/arch/arm/src/armv6-m/up_hardfault.c index 6260d4ac2c..873a76d972 100644 --- a/arch/arm/src/armv6-m/up_hardfault.c +++ b/arch/arm/src/armv6-m/up_hardfault.c @@ -55,9 +55,9 @@ ****************************************************************************/ #ifdef CONFIG_DEBUG_HARDFAULT -# define hfdbg(format, ...) llerr(format, ##__VA_ARGS__) +# define hferr(format, ...) llerr(format, ##__VA_ARGS__) #else -# define hfdbg(x...) +# define hferr(x...) #endif #define INSN_SVC0 0xdf00 /* insn: svc 0 */ @@ -118,7 +118,7 @@ int up_hardfault(int irq, FAR void *context) /* Fetch the instruction that caused the Hard fault */ uint16_t insn = *pc; - hfdbg(" PC: %p INSN: %04x\n", pc, insn); + hferr(" PC: %p INSN: %04x\n", pc, insn); /* If this was the instruction 'svc 0', then forward processing * to the SVCall handler @@ -126,7 +126,7 @@ int up_hardfault(int irq, FAR void *context) if (insn == INSN_SVC0) { - hfdbg("Forward SVCall\n"); + hferr("Forward SVCall\n"); return up_svcall(irq, context); } } @@ -134,17 +134,17 @@ int up_hardfault(int irq, FAR void *context) #if defined(CONFIG_DEBUG_HARDFAULT) /* Dump some hard fault info */ - hfdbg("\nHard Fault:\n"); - hfdbg(" IRQ: %d regs: %p\n", irq, regs); - hfdbg(" PRIMASK: %08x IPSR: %08x\n", + hferr("\nHard Fault:\n"); + hferr(" IRQ: %d regs: %p\n", irq, regs); + hferr(" PRIMASK: %08x IPSR: %08x\n", getprimask(), getipsr()); - hfdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + hferr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - hfdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + hferr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); - hfdbg(" xPSR: %08x PRIMASK: %08x (saved)\n", + hferr(" xPSR: %08x PRIMASK: %08x (saved)\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]); #endif diff --git a/arch/arm/src/armv6-m/up_schedulesigaction.c b/arch/arm/src/armv6-m/up_schedulesigaction.c index be9505a9c2..bf9fdf1c49 100644 --- a/arch/arm/src/armv6-m/up_schedulesigaction.c +++ b/arch/arm/src/armv6-m/up_schedulesigaction.c @@ -107,7 +107,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); /* Make sure that interrupts are disabled */ @@ -121,7 +121,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) * to the currently executing task. */ - sdbg("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); + serr("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); if (tcb == this_task()) { diff --git a/arch/arm/src/armv6-m/up_sigdeliver.c b/arch/arm/src/armv6-m/up_sigdeliver.c index 84b89542a2..4f40b97665 100644 --- a/arch/arm/src/armv6-m/up_sigdeliver.c +++ b/arch/arm/src/armv6-m/up_sigdeliver.c @@ -100,7 +100,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -135,7 +135,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/arm/src/armv6-m/up_svcall.c b/arch/arm/src/armv6-m/up_svcall.c index da66f30461..a24fc12f2f 100644 --- a/arch/arm/src/armv6-m/up_svcall.c +++ b/arch/arm/src/armv6-m/up_svcall.c @@ -69,9 +69,9 @@ */ #if defined(CONFIG_DEBUG_SYSCALL) || defined(CONFIG_DEBUG_SVCALL) -# define svcdbg(format, ...) llerr(format, ##__VA_ARGS__) +# define svcerr(format, ...) llerr(format, ##__VA_ARGS__) #else -# define svcdbg(x...) +# define svcerr(x...) #endif /**************************************************************************** @@ -174,18 +174,18 @@ int up_svcall(int irq, FAR void *context) if (cmd > SYS_switch_context) # endif { - svcdbg("SVCALL Entry: regs: %p cmd: %d\n", regs, cmd); - svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr("SVCALL Entry: regs: %p cmd: %d\n", regs, cmd); + svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); # ifdef CONFIG_BUILD_PROTECTED - svcdbg(" PSR: %08x PRIMASK: %08x EXC_RETURN: %08x\n", + svcerr(" PSR: %08x PRIMASK: %08x EXC_RETURN: %08x\n", regs[REG_XPSR], regs[REG_PRIMASK], regs[REG_EXC_RETURN]); # else - svcdbg(" PSR: %08x PRIMASK: %08x\n", + svcerr(" PSR: %08x PRIMASK: %08x\n", regs[REG_XPSR], regs[REG_PRIMASK]); # endif } @@ -486,30 +486,30 @@ int up_svcall(int irq, FAR void *context) if (regs != CURRENT_REGS) # endif { - svcdbg("SVCall Return:\n"); - svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr("SVCall Return:\n"); + svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", CURRENT_REGS[REG_R0], CURRENT_REGS[REG_R1], CURRENT_REGS[REG_R2], CURRENT_REGS[REG_R3], CURRENT_REGS[REG_R4], CURRENT_REGS[REG_R5], CURRENT_REGS[REG_R6], CURRENT_REGS[REG_R7]); - svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", CURRENT_REGS[REG_R8], CURRENT_REGS[REG_R9], CURRENT_REGS[REG_R10], CURRENT_REGS[REG_R11], CURRENT_REGS[REG_R12], CURRENT_REGS[REG_R13], CURRENT_REGS[REG_R14], CURRENT_REGS[REG_R15]); #ifdef CONFIG_BUILD_PROTECTED - svcdbg(" PSR: %08x PRIMASK: %08x EXC_RETURN: %08x\n", + svcerr(" PSR: %08x PRIMASK: %08x EXC_RETURN: %08x\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK], CURRENT_REGS[REG_EXC_RETURN]); #else - svcdbg(" PSR: %08x PRIMASK: %08x\n", + svcerr(" PSR: %08x PRIMASK: %08x\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]); #endif } # ifdef CONFIG_DEBUG_SVCALL else { - svcdbg("SVCall Return: %d\n", regs[REG_R0]); + svcerr("SVCall Return: %d\n", regs[REG_R0]); } # endif #endif diff --git a/arch/arm/src/armv7-a/arm_addrenv.c b/arch/arm/src/armv7-a/arm_addrenv.c index 92ab46cabd..7d2818283d 100644 --- a/arch/arm/src/armv7-a/arm_addrenv.c +++ b/arch/arm/src/armv7-a/arm_addrenv.c @@ -278,7 +278,7 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize, MMU_L2_UTEXTFLAGS); if (ret < 0) { - bdbg("ERROR: Failed to create .text region: %d\n", ret); + berr("ERROR: Failed to create .text region: %d\n", ret); goto errout; } @@ -293,7 +293,7 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize, MMU_L2_UDATAFLAGS); if (ret < 0) { - bdbg("ERROR: Failed to create .bss/.data region: %d\n", ret); + berr("ERROR: Failed to create .bss/.data region: %d\n", ret); goto errout; } @@ -305,7 +305,7 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize, ret = up_addrenv_initdata((uintptr_t)addrenv->data[0] & PMD_PTE_PADDR_MASK); if (ret < 0) { - bdbg("ERROR: Failed to initialize .bss/.data region: %d\n", ret); + berr("ERROR: Failed to initialize .bss/.data region: %d\n", ret); goto errout; } #endif @@ -318,7 +318,7 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize, MMU_L2_UDATAFLAGS); if (ret < 0) { - bdbg("ERROR: Failed to create heap region: %d\n", ret); + berr("ERROR: Failed to create heap region: %d\n", ret); goto errout; } diff --git a/arch/arm/src/armv7-a/arm_addrenv_kstack.c b/arch/arm/src/armv7-a/arm_addrenv_kstack.c index 2172023d9a..5bb2b688b5 100644 --- a/arch/arm/src/armv7-a/arm_addrenv_kstack.c +++ b/arch/arm/src/armv7-a/arm_addrenv_kstack.c @@ -153,7 +153,7 @@ int up_addrenv_kstackalloc(FAR struct tcb_s *tcb) tcb->xcp.kstack = (FAR uint32_t *)kmm_memalign(8, ARCH_KERNEL_STACKSIZE); if (!tcb->xcp.kstack) { - bdbg("ERROR: Failed to allocate the kernel stack\n"); + berr("ERROR: Failed to allocate the kernel stack\n"); return -ENOMEM; } diff --git a/arch/arm/src/armv7-a/arm_addrenv_ustack.c b/arch/arm/src/armv7-a/arm_addrenv_ustack.c index bf8d135564..4b7be01bd6 100644 --- a/arch/arm/src/armv7-a/arm_addrenv_ustack.c +++ b/arch/arm/src/armv7-a/arm_addrenv_ustack.c @@ -163,7 +163,7 @@ int up_addrenv_ustackalloc(FAR struct tcb_s *tcb, size_t stacksize) MMU_L2_UDATAFLAGS); if (ret < 0) { - bdbg("ERROR: Failed to create stack region: %d\n", ret); + berr("ERROR: Failed to create stack region: %d\n", ret); up_addrenv_ustackfree(tcb); return ret; } diff --git a/arch/arm/src/armv7-a/arm_addrenv_utils.c b/arch/arm/src/armv7-a/arm_addrenv_utils.c index afc2650a89..2eb58623af 100644 --- a/arch/arm/src/armv7-a/arm_addrenv_utils.c +++ b/arch/arm/src/armv7-a/arm_addrenv_utils.c @@ -98,7 +98,7 @@ int arm_addrenv_create_region(FAR uintptr_t **list, unsigned int listlen, npages = MM_NPAGES(regionsize); if (npages > (listlen << (20 - MM_PGSHIFT))) { - bdbg("ERROR: npages=%u listlen=%u\n", npages, listlen); + berr("ERROR: npages=%u listlen=%u\n", npages, listlen); return -E2BIG; } diff --git a/arch/arm/src/armv7-a/arm_elf.c b/arch/arm/src/armv7-a/arm_elf.c index ada27e19cc..e262095e5c 100644 --- a/arch/arm/src/armv7-a/arm_elf.c +++ b/arch/arm/src/armv7-a/arm_elf.c @@ -74,7 +74,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_machine != EM_ARM) { - bdbg("Not for ARM: e_machine=%04x\n", ehdr->e_machine); + berr("Not for ARM: e_machine=%04x\n", ehdr->e_machine); return -ENOEXEC; } @@ -82,7 +82,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_ident[EI_CLASS] != ELFCLASS32) { - bdbg("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]); + berr("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]); return -ENOEXEC; } @@ -94,7 +94,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB) #endif { - bdbg("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]); + berr("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]); return -ENOEXEC; } @@ -102,7 +102,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if ((ehdr->e_entry & 3) != 0) { - bdbg("Entry point is not properly aligned: %08x\n", ehdr->e_entry); + berr("Entry point is not properly aligned: %08x\n", ehdr->e_entry); return -ENOEXEC; } @@ -175,7 +175,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset += sym->st_value - addr; if (offset & 3 || offset <= (int32_t) 0xfe000000 || offset >= (int32_t) 0x02000000) { - bdbg(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n", + berr(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n", ELF32_R_TYPE(rel->r_info), offset); return -EINVAL; @@ -246,7 +246,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, break; default: - bdbg("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info)); + berr("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info)); return -EINVAL; } @@ -256,6 +256,6 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, uintptr_t addr) { - bdbg("RELA relocation not supported\n"); + berr("RELA relocation not supported\n"); return -ENOSYS; } diff --git a/arch/arm/src/armv7-a/arm_schedulesigaction.c b/arch/arm/src/armv7-a/arm_schedulesigaction.c index 3dfe5fc285..74648c8fa5 100644 --- a/arch/arm/src/armv7-a/arm_schedulesigaction.c +++ b/arch/arm/src/armv7-a/arm_schedulesigaction.c @@ -94,7 +94,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); /* Make sure that interrupts are disabled */ @@ -108,7 +108,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) * to the currently executing task. */ - sdbg("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); + serr("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); if (tcb == this_task()) { diff --git a/arch/arm/src/armv7-a/arm_sigdeliver.c b/arch/arm/src/armv7-a/arm_sigdeliver.c index 32f1e0b40d..8009386492 100644 --- a/arch/arm/src/armv7-a/arm_sigdeliver.c +++ b/arch/arm/src/armv7-a/arm_sigdeliver.c @@ -83,7 +83,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -114,7 +114,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/arm/src/armv7-a/arm_syscall.c b/arch/arm/src/armv7-a/arm_syscall.c index d6845595f6..b0b8201756 100644 --- a/arch/arm/src/armv7-a/arm_syscall.c +++ b/arch/arm/src/armv7-a/arm_syscall.c @@ -71,9 +71,9 @@ /* Debug ********************************************************************/ #if defined(CONFIG_DEBUG_SYSCALL) -# define svcdbg(format, ...) llerr(format, ##__VA_ARGS__) +# define svcerr(format, ...) llerr(format, ##__VA_ARGS__) #else -# define svcdbg(x...) +# define svcerr(x...) #endif /**************************************************************************** @@ -179,14 +179,14 @@ uint32_t *arm_syscall(uint32_t *regs) */ #if defined(CONFIG_DEBUG_SYSCALL) - svcdbg("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd); - svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd); + svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); - svcdbg("CPSR: %08x\n", regs[REG_CPSR]); + svcerr("CPSR: %08x\n", regs[REG_CPSR]); #endif /* Handle the SVCall according to the command in R0 */ @@ -480,7 +480,7 @@ uint32_t *arm_syscall(uint32_t *regs) regs[REG_R0] -= CONFIG_SYS_RESERVED; #else - svcdbg("ERROR: Bad SYS call: %d\n", regs[REG_R0]); + svcerr("ERROR: Bad SYS call: %d\n", regs[REG_R0]); #endif #ifdef CONFIG_ARCH_KERNEL_STACK @@ -504,14 +504,14 @@ uint32_t *arm_syscall(uint32_t *regs) #if defined(CONFIG_DEBUG_SYSCALL) /* Report what happened */ - svcdbg("SYSCALL Exit: regs: %p\n", regs); - svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr("SYSCALL Exit: regs: %p\n", regs); + svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); - svcdbg("CPSR: %08x\n", regs[REG_CPSR]); + svcerr("CPSR: %08x\n", regs[REG_CPSR]); #endif /* Return the last value of curent_regs. This supports context switches diff --git a/arch/arm/src/armv7-a/gic.h b/arch/arm/src/armv7-a/gic.h index 0e0220e75b..2131c105ef 100644 --- a/arch/arm/src/armv7-a/gic.h +++ b/arch/arm/src/armv7-a/gic.h @@ -594,12 +594,12 @@ /* Debug */ #ifdef CONFIG_DEBUG_IRQ -# define gicdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define gicerr(format, ...) err(format, ##__VA_ARGS__) # define gicllerr(format, ...) llerr(format, ##__VA_ARGS__) # define gicinfo(format, ...) info(format, ##__VA_ARGS__) # define gicllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define gicdbg(x...) +# define gicerr(x...) # define gicllerr(x...) # define gicinfo(x...) # define gicllinfo(x...) diff --git a/arch/arm/src/armv7-m/mpu.h b/arch/arm/src/armv7-m/mpu.h index 8ca9a0293c..c58403dcf7 100644 --- a/arch/arm/src/armv7-m/mpu.h +++ b/arch/arm/src/armv7-m/mpu.h @@ -221,7 +221,7 @@ static inline void mpu_showtype(void) { #ifdef CONFIG_DEBUG_FEATURES uint32_t regval = getreg32(MPU_TYPE); - dbg("%s MPU Regions: data=%d instr=%d\n", + err("%s MPU Regions: data=%d instr=%d\n", (regval & MPU_TYPE_SEPARATE) != 0 ? "Separate" : "Unified", (regval & MPU_TYPE_DREGION_MASK) >> MPU_TYPE_DREGION_SHIFT, (regval & MPU_TYPE_IREGION_MASK) >> MPU_TYPE_IREGION_SHIFT); diff --git a/arch/arm/src/armv7-m/up_elf.c b/arch/arm/src/armv7-m/up_elf.c index e3c2a8c1d3..e45e2dbe24 100644 --- a/arch/arm/src/armv7-m/up_elf.c +++ b/arch/arm/src/armv7-m/up_elf.c @@ -82,7 +82,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_machine != EM_ARM) { - bdbg("Not for ARM: e_machine=%04x\n", ehdr->e_machine); + berr("Not for ARM: e_machine=%04x\n", ehdr->e_machine); return -ENOEXEC; } @@ -90,7 +90,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_ident[EI_CLASS] != ELFCLASS32) { - bdbg("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]); + berr("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]); return -ENOEXEC; } @@ -102,7 +102,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB) #endif { - bdbg("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]); + berr("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]); return -ENOEXEC; } @@ -177,7 +177,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset += sym->st_value - addr; if (offset & 3 || offset <= (int32_t) 0xfe000000 || offset >= (int32_t) 0x02000000) { - bdbg(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n", + berr(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n", ELF32_R_TYPE(rel->r_info), offset); return -EINVAL; @@ -298,7 +298,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && (offset & 1) == 0) { - bdbg(" ERROR: JUMP24 [%d] requires odd offset, offset=%08lx\n", + berr(" ERROR: JUMP24 [%d] requires odd offset, offset=%08lx\n", ELF32_R_TYPE(rel->r_info), offset); return -EINVAL; @@ -308,7 +308,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, if (offset <= (int32_t)0xff000000 || offset >= (int32_t)0x01000000) { - bdbg(" ERROR: JUMP24 [%d] relocation out of range, branch taget=%08lx\n", + berr(" ERROR: JUMP24 [%d] relocation out of range, branch taget=%08lx\n", ELF32_R_TYPE(rel->r_info), offset); return -EINVAL; @@ -461,7 +461,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, break; default: - bdbg("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info)); + berr("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info)); return -EINVAL; } @@ -471,7 +471,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, uintptr_t addr) { - bdbg("RELA relocation not supported\n"); + berr("RELA relocation not supported\n"); return -ENOSYS; } diff --git a/arch/arm/src/armv7-m/up_hardfault.c b/arch/arm/src/armv7-m/up_hardfault.c index e65f08534f..b08466258f 100644 --- a/arch/arm/src/armv7-m/up_hardfault.c +++ b/arch/arm/src/armv7-m/up_hardfault.c @@ -60,9 +60,9 @@ */ #ifdef CONFIG_DEBUG_HARDFAULT -# define hfdbg(format, ...) llerr(format, ##__VA_ARGS__) +# define hferr(format, ...) llerr(format, ##__VA_ARGS__) #else -# define hfdbg(x...) +# define hferr(x...) #endif #define INSN_SVC0 0xdf00 /* insn: svc 0 */ @@ -127,7 +127,7 @@ int up_hardfault(int irq, FAR void *context) /* Fetch the instruction that caused the Hard fault */ uint16_t insn = *pc; - hfdbg(" PC: %p INSN: %04x\n", pc, insn); + hferr(" PC: %p INSN: %04x\n", pc, insn); /* If this was the instruction 'svc 0', then forward processing * to the SVCall handler @@ -135,7 +135,7 @@ int up_hardfault(int irq, FAR void *context) if (insn == INSN_SVC0) { - hfdbg("Forward SVCall\n"); + hferr("Forward SVCall\n"); return up_svcall(irq, context); } } @@ -143,37 +143,37 @@ int up_hardfault(int irq, FAR void *context) /* Dump some hard fault info */ - hfdbg("Hard Fault:\n"); - hfdbg(" IRQ: %d regs: %p\n", irq, regs); - hfdbg(" BASEPRI: %08x PRIMASK: %08x IPSR: %08x CONTROL: %08x\n", + hferr("Hard Fault:\n"); + hferr(" IRQ: %d regs: %p\n", irq, regs); + hferr(" BASEPRI: %08x PRIMASK: %08x IPSR: %08x CONTROL: %08x\n", getbasepri(), getprimask(), getipsr(), getcontrol()); - hfdbg(" CFAULTS: %08x HFAULTS: %08x DFAULTS: %08x BFAULTADDR: %08x AFAULTS: %08x\n", + hferr(" CFAULTS: %08x HFAULTS: %08x DFAULTS: %08x BFAULTADDR: %08x AFAULTS: %08x\n", getreg32(NVIC_CFAULTS), getreg32(NVIC_HFAULTS), getreg32(NVIC_DFAULTS), getreg32(NVIC_BFAULT_ADDR), getreg32(NVIC_AFAULTS)); - hfdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + hferr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - hfdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + hferr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); #ifdef CONFIG_ARMV7M_USEBASEPRI # ifdef REG_EXC_RETURN - hfdbg(" xPSR: %08x BASEPRI: %08x EXC_RETURN: %08x (saved)\n", + hferr(" xPSR: %08x BASEPRI: %08x EXC_RETURN: %08x (saved)\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_BASEPRI], CURRENT_REGS[REG_EXC_RETURN]); # else - hfdbg(" xPSR: %08x BASEPRI: %08x (saved)\n", + hferr(" xPSR: %08x BASEPRI: %08x (saved)\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_BASEPRI]); # endif #else # ifdef REG_EXC_RETURN - hfdbg(" xPSR: %08x PRIMASK: %08x EXC_RETURN: %08x (saved)\n", + hferr(" xPSR: %08x PRIMASK: %08x EXC_RETURN: %08x (saved)\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK], CURRENT_REGS[REG_EXC_RETURN]); # else - hfdbg(" xPSR: %08x PRIMASK: %08x (saved)\n", + hferr(" xPSR: %08x PRIMASK: %08x (saved)\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]); # endif #endif diff --git a/arch/arm/src/armv7-m/up_memfault.c b/arch/arm/src/armv7-m/up_memfault.c index 40881f722c..629304d6d2 100644 --- a/arch/arm/src/armv7-m/up_memfault.c +++ b/arch/arm/src/armv7-m/up_memfault.c @@ -55,9 +55,9 @@ #undef DEBUG_MEMFAULTS /* Define to debug memory management faults */ #ifdef DEBUG_MEMFAULTS -# define mfdbg(format, ...) llerr(format, ##__VA_ARGS__) +# define mferr(format, ...) llerr(format, ##__VA_ARGS__) #else -# define mfdbg(x...) +# define mferr(x...) #endif /**************************************************************************** @@ -93,34 +93,34 @@ int up_memfault(int irq, FAR void *context) (void)up_irq_save(); llerr("PANIC!!! Memory Management Fault:\n"); - mfdbg(" IRQ: %d context: %p\n", irq, regs); + mferr(" IRQ: %d context: %p\n", irq, regs); llerr(" CFAULTS: %08x MMFAR: %08x\n", getreg32(NVIC_CFAULTS), getreg32(NVIC_MEMMANAGE_ADDR)); - mfdbg(" BASEPRI: %08x PRIMASK: %08x IPSR: %08x CONTROL: %08x\n", + mferr(" BASEPRI: %08x PRIMASK: %08x IPSR: %08x CONTROL: %08x\n", getbasepri(), getprimask(), getipsr(), getcontrol()); - mfdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + mferr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - mfdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + mferr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); #ifdef CONFIG_ARMV7M_USEBASEPRI # ifdef REG_EXC_RETURN - mfdbg(" xPSR: %08x BASEPRI: %08x EXC_RETURN: %08x (saved)\n", + mferr(" xPSR: %08x BASEPRI: %08x EXC_RETURN: %08x (saved)\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_BASEPRI], CURRENT_REGS[REG_EXC_RETURN]); # else - mfdbg(" xPSR: %08x BASEPRI: %08x (saved)\n", + mferr(" xPSR: %08x BASEPRI: %08x (saved)\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_BASEPRI]); # endif #else # ifdef REG_EXC_RETURN - mfdbg(" xPSR: %08x PRIMASK: %08x EXC_RETURN: %08x (saved)\n", + mferr(" xPSR: %08x PRIMASK: %08x EXC_RETURN: %08x (saved)\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK], CURRENT_REGS[REG_EXC_RETURN]); # else - mfdbg(" xPSR: %08x PRIMASK: %08x (saved)\n", + mferr(" xPSR: %08x PRIMASK: %08x (saved)\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]); # endif #endif diff --git a/arch/arm/src/armv7-m/up_ramvec_attach.c b/arch/arm/src/armv7-m/up_ramvec_attach.c index 60ba6e8590..fc3439d6a0 100644 --- a/arch/arm/src/armv7-m/up_ramvec_attach.c +++ b/arch/arm/src/armv7-m/up_ramvec_attach.c @@ -59,10 +59,10 @@ */ #ifdef CONFIG_DEBUG_IRQ -# define intdbg llerr +# define interr llerr # define intinfo llinfo #else -# define intdbg(x...) +# define interr(x...) # define intinfo(x...) #endif diff --git a/arch/arm/src/armv7-m/up_ramvec_initialize.c b/arch/arm/src/armv7-m/up_ramvec_initialize.c index 9ff31cc902..354e5eaf4b 100644 --- a/arch/arm/src/armv7-m/up_ramvec_initialize.c +++ b/arch/arm/src/armv7-m/up_ramvec_initialize.c @@ -78,10 +78,10 @@ */ #ifdef CONFIG_DEBUG_IRQ -# define intdbg llerr +# define interr llerr # define intinfo llinfo #else -# define intdbg(x...) +# define interr(x...) # define intinfo(x...) #endif diff --git a/arch/arm/src/armv7-m/up_schedulesigaction.c b/arch/arm/src/armv7-m/up_schedulesigaction.c index c44298c14e..d24906dd3b 100644 --- a/arch/arm/src/armv7-m/up_schedulesigaction.c +++ b/arch/arm/src/armv7-m/up_schedulesigaction.c @@ -95,7 +95,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); DEBUGASSERT(tcb != NULL && sigdeliver != NULL); /* Make sure that interrupts are disabled */ @@ -110,7 +110,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) * to the currently executing task. */ - sdbg("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); + serr("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); if (tcb == this_task()) { diff --git a/arch/arm/src/armv7-m/up_sigdeliver.c b/arch/arm/src/armv7-m/up_sigdeliver.c index bfa672aa7a..16f05b5adc 100644 --- a/arch/arm/src/armv7-m/up_sigdeliver.c +++ b/arch/arm/src/armv7-m/up_sigdeliver.c @@ -95,7 +95,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -138,7 +138,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/arm/src/armv7-m/up_svcall.c b/arch/arm/src/armv7-m/up_svcall.c index d6f5cacdb8..70eef08054 100644 --- a/arch/arm/src/armv7-m/up_svcall.c +++ b/arch/arm/src/armv7-m/up_svcall.c @@ -70,9 +70,9 @@ */ #if defined(CONFIG_DEBUG_SYSCALL) || defined(CONFIG_DEBUG_SVCALL) -# define svcdbg(format, ...) llerr(format, ##__VA_ARGS__) +# define svcerr(format, ...) llerr(format, ##__VA_ARGS__) #else -# define svcdbg(x...) +# define svcerr(x...) #endif /**************************************************************************** @@ -169,18 +169,18 @@ int up_svcall(int irq, FAR void *context) if (cmd > SYS_switch_context) # endif { - svcdbg("SVCALL Entry: regs: %p cmd: %d\n", regs, cmd); - svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr("SVCALL Entry: regs: %p cmd: %d\n", regs, cmd); + svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); # ifdef REG_EXC_RETURN - svcdbg(" PSR: %08x EXC_RETURN: %08x\n", + svcerr(" PSR: %08x EXC_RETURN: %08x\n", regs[REG_XPSR], regs[REG_EXC_RETURN]); # else - svcdbg(" PSR: %08x\n", regs[REG_XPSR]); + svcerr(" PSR: %08x\n", regs[REG_XPSR]); # endif } #endif @@ -488,28 +488,28 @@ int up_svcall(int irq, FAR void *context) if (regs != CURRENT_REGS) # endif { - svcdbg("SVCall Return:\n"); - svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr("SVCall Return:\n"); + svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", CURRENT_REGS[REG_R0], CURRENT_REGS[REG_R1], CURRENT_REGS[REG_R2], CURRENT_REGS[REG_R3], CURRENT_REGS[REG_R4], CURRENT_REGS[REG_R5], CURRENT_REGS[REG_R6], CURRENT_REGS[REG_R7]); - svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", CURRENT_REGS[REG_R8], CURRENT_REGS[REG_R9], CURRENT_REGS[REG_R10], CURRENT_REGS[REG_R11], CURRENT_REGS[REG_R12], CURRENT_REGS[REG_R13], CURRENT_REGS[REG_R14], CURRENT_REGS[REG_R15]); # ifdef REG_EXC_RETURN - svcdbg(" PSR: %08x EXC_RETURN: %08x\n", + svcerr(" PSR: %08x EXC_RETURN: %08x\n", CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_EXC_RETURN]); # else - svcdbg(" PSR: %08x\n", CURRENT_REGS[REG_XPSR]); + svcerr(" PSR: %08x\n", CURRENT_REGS[REG_XPSR]); # endif } # ifdef CONFIG_DEBUG_SVCALL else { - svcdbg("SVCall Return: %d\n", regs[REG_R0]); + svcerr("SVCall Return: %d\n", regs[REG_R0]); } # endif #endif diff --git a/arch/arm/src/armv7-r/arm_elf.c b/arch/arm/src/armv7-r/arm_elf.c index 71ee69450b..0d7b40cd49 100644 --- a/arch/arm/src/armv7-r/arm_elf.c +++ b/arch/arm/src/armv7-r/arm_elf.c @@ -86,7 +86,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_machine != EM_ARM) { - bdbg("Not for ARM: e_machine=%04x\n", ehdr->e_machine); + berr("Not for ARM: e_machine=%04x\n", ehdr->e_machine); return -ENOEXEC; } @@ -94,7 +94,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_ident[EI_CLASS] != ELFCLASS32) { - bdbg("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]); + berr("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]); return -ENOEXEC; } @@ -106,7 +106,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB) #endif { - bdbg("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]); + berr("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]); return -ENOEXEC; } @@ -114,7 +114,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr) if ((ehdr->e_entry & 3) != 0) { - bdbg("Entry point is not properly aligned: %08x\n", ehdr->e_entry); + berr("Entry point is not properly aligned: %08x\n", ehdr->e_entry); return -ENOEXEC; } @@ -187,7 +187,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset += sym->st_value - addr; if (offset & 3 || offset <= (int32_t) 0xfe000000 || offset >= (int32_t) 0x02000000) { - bdbg(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n", + berr(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n", ELF32_R_TYPE(rel->r_info), offset); return -EINVAL; @@ -258,7 +258,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, break; default: - bdbg("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info)); + berr("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info)); return -EINVAL; } @@ -268,6 +268,6 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, uintptr_t addr) { - bdbg("RELA relocation not supported\n"); + berr("RELA relocation not supported\n"); return -ENOSYS; } diff --git a/arch/arm/src/armv7-r/arm_schedulesigaction.c b/arch/arm/src/armv7-r/arm_schedulesigaction.c index 692debff2f..3ece5d8acf 100644 --- a/arch/arm/src/armv7-r/arm_schedulesigaction.c +++ b/arch/arm/src/armv7-r/arm_schedulesigaction.c @@ -94,7 +94,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); /* Make sure that interrupts are disabled */ @@ -108,7 +108,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) * to the currently executing task. */ - sdbg("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); + serr("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); if (tcb == this_task()) { diff --git a/arch/arm/src/armv7-r/arm_sigdeliver.c b/arch/arm/src/armv7-r/arm_sigdeliver.c index f638b35bfd..1a4f9b966d 100644 --- a/arch/arm/src/armv7-r/arm_sigdeliver.c +++ b/arch/arm/src/armv7-r/arm_sigdeliver.c @@ -83,7 +83,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -114,7 +114,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/arm/src/armv7-r/arm_syscall.c b/arch/arm/src/armv7-r/arm_syscall.c index ce4a60bb8b..5bf59d595e 100644 --- a/arch/arm/src/armv7-r/arm_syscall.c +++ b/arch/arm/src/armv7-r/arm_syscall.c @@ -69,9 +69,9 @@ /* Debug ********************************************************************/ #if defined(CONFIG_DEBUG_SYSCALL) -# define svcdbg(format, ...) llerr(format, ##__VA_ARGS__) +# define svcerr(format, ...) llerr(format, ##__VA_ARGS__) #else -# define svcdbg(x...) +# define svcerr(x...) #endif /**************************************************************************** @@ -177,14 +177,14 @@ uint32_t *arm_syscall(uint32_t *regs) */ #if defined(CONFIG_DEBUG_SYSCALL) - svcdbg("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd); - svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd); + svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); - svcdbg("CPSR: %08x\n", regs[REG_CPSR]); + svcerr("CPSR: %08x\n", regs[REG_CPSR]); #endif /* Handle the SVCall according to the command in R0 */ @@ -478,7 +478,7 @@ uint32_t *arm_syscall(uint32_t *regs) regs[REG_R0] -= CONFIG_SYS_RESERVED; #else - svcdbg("ERROR: Bad SYS call: %d\n", regs[REG_R0]); + svcerr("ERROR: Bad SYS call: %d\n", regs[REG_R0]); #endif #ifdef CONFIG_ARCH_KERNEL_STACK @@ -502,14 +502,14 @@ uint32_t *arm_syscall(uint32_t *regs) #if defined(CONFIG_DEBUG_SYSCALL) /* Report what happened */ - svcdbg("SYSCALL Exit: regs: %p\n", regs); - svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr("SYSCALL Exit: regs: %p\n", regs); + svcerr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + svcerr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); - svcdbg("CPSR: %08x\n", regs[REG_CPSR]); + svcerr("CPSR: %08x\n", regs[REG_CPSR]); #endif /* Return the last value of curent_regs. This supports context switches diff --git a/arch/arm/src/armv7-r/mpu.h b/arch/arm/src/armv7-r/mpu.h index 26d5f9373d..7428e9cac2 100644 --- a/arch/arm/src/armv7-r/mpu.h +++ b/arch/arm/src/armv7-r/mpu.h @@ -361,7 +361,7 @@ static inline void mpu_showtype(void) { #ifdef CONFIG_DEBUG_FEATURES uint32_t regval = mpu_get_mpuir(); - dbg("%s MPU Regions: data=%d instr=%d\n", + err("%s MPU Regions: data=%d instr=%d\n", (regval & MPUIR_SEPARATE) != 0 ? "Separate" : "Unified", (regval & MPUIR_DREGION_MASK) >> MPUIR_DREGION_SHIFT, (regval & MPUIR_IREGION_MASK) >> MPUIR_IREGION_SHIFT); diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c index f59b028f21..38d894e74e 100644 --- a/arch/arm/src/c5471/c5471_ethernet.c +++ b/arch/arm/src/c5471/c5471_ethernet.c @@ -737,22 +737,22 @@ static int c5471_phyinit (void) phyid = (c5471_mdread(0, MD_PHY_MSB_REG) << 16) | c5471_mdread(0, MD_PHY_LSB_REG); if (phyid != LU3X31_T64_PHYID) { - ndbg("Unrecognized PHY ID: %08x\n", phyid); + nerr("Unrecognized PHY ID: %08x\n", phyid); return ERROR; } /* Next, Set desired network rate, 10BaseT, 100BaseT, or auto. */ #ifdef CONFIG_C5471_AUTONEGOTIATION - ndbg("Setting PHY Transceiver for Autonegotiation\n"); + nerr("Setting PHY Transceiver for Autonegotiation\n"); c5471_mdwrite(0, MD_PHY_CONTROL_REG, MODE_AUTONEG); #endif #ifdef CONFIG_C5471_BASET100 - ndbg("Setting PHY Transceiver for 100BaseT FullDuplex\n"); + nerr("Setting PHY Transceiver for 100BaseT FullDuplex\n"); c5471_mdwrite(0, MD_PHY_CONTROL_REG, MODE_100MBIT_FULLDUP); #endif #ifdef CONFIG_C5471_BASET10 - ndbg("Setting PHY Transceiver for 10BaseT FullDuplex\n"); + nerr("Setting PHY Transceiver for 10BaseT FullDuplex\n"); c5471_mdwrite(0, MD_PHY_CONTROL_REG, MODE_10MBIT_FULLDUP); #endif @@ -1371,7 +1371,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) { /* Increment the count of dropped packets */ - ndbg("Too big! packetlen: %d\n", packetlen); + nerr("Too big! packetlen: %d\n", packetlen); c5471->c_rxdropped++; } #endif @@ -1680,7 +1680,7 @@ static int c5471_ifup(struct net_driver_s *dev) struct c5471_driver_s *c5471 = (struct c5471_driver_s *)dev->d_private; volatile uint32_t clearbits; - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); @@ -1742,7 +1742,7 @@ static int c5471_ifdown(struct net_driver_s *dev) struct c5471_driver_s *c5471 = (struct c5471_driver_s *)dev->d_private; irqstate_t flags; - ndbg("Stopping\n"); + nerr("Stopping\n"); /* Disable the Ethernet interrupt */ @@ -1798,7 +1798,7 @@ static int c5471_txavail(struct net_driver_s *dev) struct c5471_driver_s *c5471 = (struct c5471_driver_s *)dev->d_private; irqstate_t flags; - ndbg("Polling\n"); + nerr("Polling\n"); flags = enter_critical_section(); /* Ignore the notification if the interface is not yet up */ @@ -1951,7 +1951,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) /* TX ENET 0 */ - ndbg("TX ENET0 desc: %08x pbuf: %08x\n", desc, pbuf); + nerr("TX ENET0 desc: %08x pbuf: %08x\n", desc, pbuf); putreg32((desc & 0x0000ffff), ENET0_TDBA); /* 16-bit offset address */ for (i = NUM_DESC_TX-1; i >= 0; i--) { @@ -1978,7 +1978,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) /* RX ENET 0 */ - ndbg("RX ENET0 desc: %08x pbuf: %08x\n", desc, pbuf); + nerr("RX ENET0 desc: %08x pbuf: %08x\n", desc, pbuf); putreg32((desc & 0x0000ffff), ENET0_RDBA); /* 16-bit offset address */ for (i = NUM_DESC_RX-1; i >= 0; i--) { @@ -2005,7 +2005,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) /* TX CPU */ - ndbg("TX CPU desc: %08x pbuf: %08x\n", desc, pbuf); + nerr("TX CPU desc: %08x pbuf: %08x\n", desc, pbuf); c5471->c_txcpudesc = desc; putreg32((desc & 0x0000ffff), EIM_CPU_TXBA); /* 16-bit offset address */ for (i = NUM_DESC_TX-1; i >= 0; i--) @@ -2035,7 +2035,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) /* RX CPU */ - ndbg("RX CPU desc: %08x pbuf: %08x\n", desc, pbuf); + nerr("RX CPU desc: %08x pbuf: %08x\n", desc, pbuf); c5471->c_rxcpudesc = desc; putreg32((desc & 0x0000ffff), EIM_CPU_RXBA); /* 16-bit offset address */ for (i = NUM_DESC_RX-1; i >= 0; i--) @@ -2063,7 +2063,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) pbuf += sizeof(uint32_t); /* Ether Module's "Buffer Usage Word" */ } - ndbg("END desc: %08x pbuf: %08x\n", desc, pbuf); + nerr("END desc: %08x pbuf: %08x\n", desc, pbuf); /* Save the descriptor packet size */ @@ -2150,13 +2150,13 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) static void c5471_reset(struct c5471_driver_s *c5471) { #if defined(CONFIG_C5471_PHY_LU3X31T_T64) - ndbg("EIM reset\n"); + nerr("EIM reset\n"); c5471_eimreset(c5471); #endif - ndbg("PHY init\n"); + nerr("PHY init\n"); c5471_phyinit(); - ndbg("EIM config\n"); + nerr("EIM config\n"); c5471_eimconfig(c5471); } @@ -2178,7 +2178,7 @@ static void c5471_macassign(struct c5471_driver_s *c5471) uint8_t *mptr = dev->d_mac.ether_addr_octet; register uint32_t tmp; - ndbg("MAC: %0x:%0x:%0x:%0x:%0x:%0x\n", + nerr("MAC: %0x:%0x:%0x:%0x:%0x:%0x\n", mptr[0], mptr[1], mptr[2], mptr[3], mptr[4], mptr[5]); /* Set CPU port MAC address. S/W will only see incoming packets that match diff --git a/arch/arm/src/c5471/c5471_watchdog.c b/arch/arm/src/c5471/c5471_watchdog.c index 2143246d6e..011357fb5c 100644 --- a/arch/arm/src/c5471/c5471_watchdog.c +++ b/arch/arm/src/c5471/c5471_watchdog.c @@ -155,7 +155,7 @@ static inline unsigned int wdt_prescaletoptv(unsigned int prescale) } } - dbg("prescale=%d -> ptv=%d\n", prescale, ptv); + err("prescale=%d -> ptv=%d\n", prescale, ptv); return ptv; } @@ -173,7 +173,7 @@ static int wdt_setusec(uint32_t usec) uint32_t divisor = 1; uint32_t mode; - dbg("usec=%d\n", usec); + err("usec=%d\n", usec); /* Calculate a value of prescaler and divisor that will be able * to count to the usec. It may not be exact or the best @@ -186,7 +186,7 @@ static int wdt_setusec(uint32_t usec) do { divisor = (CLOCK_MHZx2 * usec) / (prescaler * 2); - dbg("divisor=0x%x prescaler=0x%x\n", divisor, prescaler); + err("divisor=0x%x prescaler=0x%x\n", divisor, prescaler); if (divisor >= 0x10000) { @@ -194,7 +194,7 @@ static int wdt_setusec(uint32_t usec) { /* This is the max possible ~2.5 seconds. */ - dbg("prescaler=0x%x too big!\n", prescaler); + err("prescaler=0x%x too big!\n", prescaler); return ERROR; } @@ -207,19 +207,19 @@ static int wdt_setusec(uint32_t usec) } while (divisor >= 0x10000); - dbg("prescaler=0x%x divisor=0x%x\n", prescaler, divisor); + err("prescaler=0x%x divisor=0x%x\n", prescaler, divisor); mode = wdt_prescaletoptv(prescaler); mode &= ~C5471_TIMER_AUTORELOAD; /* One shot mode. */ mode |= divisor << 5; - dbg("mode=0x%x\n", mode); + err("mode=0x%x\n", mode); c5471_wdt_cntl = mode; /* Now start the watchdog */ c5471_wdt_cntl |= C5471_TIMER_STARTBIT; - dbg("cntl_timer=0x%x\n", c5471_wdt_cntl); + err("cntl_timer=0x%x\n", c5471_wdt_cntl); return 0; } @@ -234,17 +234,17 @@ static int wdt_setusec(uint32_t usec) static int wdt_interrupt(int irq, void *context) { - dbg("expired\n"); + err("expired\n"); #if defined(CONFIG_SOFTWARE_REBOOT) # if defined(CONFIG_SOFTWARE_TEST) - dbg(" Test only\n"); + err(" Test only\n"); # else - dbg(" Re-booting\n"); + err(" Re-booting\n"); # warning "Add logic to reset CPU here" # endif #else - dbg(" No reboot\n"); + err(" No reboot\n"); #endif return OK; } @@ -259,7 +259,7 @@ static ssize_t wdt_read(struct file *filep, char *buffer, size_t buflen) * not work if the user provides a buffer smaller than 18 bytes. */ - dbg("buflen=%d\n", buflen); + err("buflen=%d\n", buflen); if (buflen >= 18) { sprintf(buffer, "%08x %08x\n", c5471_wdt_cntl, c5471_wdt_count); @@ -274,7 +274,7 @@ static ssize_t wdt_read(struct file *filep, char *buffer, size_t buflen) static ssize_t wdt_write(struct file *filep, const char *buffer, size_t buflen) { - dbg("buflen=%d\n", buflen); + err("buflen=%d\n", buflen); if (buflen) { /* Reset the timer to the maximum delay */ @@ -292,7 +292,7 @@ static ssize_t wdt_write(struct file *filep, const char *buffer, size_t buflen) static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { - dbg("ioctl Call: cmd=0x%x arg=0x%x", cmd, arg); + err("ioctl Call: cmd=0x%x arg=0x%x", cmd, arg); /* Process the IOCTL command (see arch/watchdog.h) */ @@ -315,7 +315,7 @@ static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg) static int wdt_open(struct file *filep) { - dbg(""); + err(""); if (g_wdtopen) { @@ -339,7 +339,7 @@ static int wdt_open(struct file *filep) static int wdt_close(struct file *filep) { - dbg(""); + err(""); /* The task controlling the watchdog has terminated. Take the timer * the @@ -367,7 +367,7 @@ int up_wdtinit(void) { int ret; - dbg("C547x Watchdog Driver\n"); + err("C547x Watchdog Driver\n"); /* Register as /dev/wdt */ @@ -379,7 +379,7 @@ int up_wdtinit(void) /* Register for an interrupt level callback through wdt_interrupt */ - dbg("Attach to IRQ=%d\n", C5471_IRQ_WATCHDOG); + err("Attach to IRQ=%d\n", C5471_IRQ_WATCHDOG); /* Make sure that the timer is stopped */ diff --git a/arch/arm/src/calypso/calypso_spi.c b/arch/arm/src/calypso/calypso_spi.c index e3b063a559..fb5f871dfb 100644 --- a/arch/arm/src/calypso/calypso_spi.c +++ b/arch/arm/src/calypso/calypso_spi.c @@ -216,7 +216,7 @@ int spi_xfer(uint8_t dev_idx, uint8_t bitlen, const void *dout, void *din) tmp <<= (32-bitlen); /* align to MSB */ } - dbg("spi_xfer(dev_idx=%u, bitlen=%u, data_out=0x%08x): ", + err("spi_xfer(dev_idx=%u, bitlen=%u, data_out=0x%08x): ", dev_idx, bitlen, tmp); /* fill transmit registers */ @@ -236,14 +236,14 @@ int spi_xfer(uint8_t dev_idx, uint8_t bitlen, const void *dout, void *din) } putreg16(reg_ctrl, SPI_REG(REG_CTRL)); - dbg("reg_ctrl=0x%04x ", reg_ctrl); + err("reg_ctrl=0x%04x ", reg_ctrl); /* wait until the transfer is complete */ while (1) { reg_status = getreg16(SPI_REG(REG_STATUS)); - dbg("status=0x%04x ", reg_status); + err("status=0x%04x ", reg_status); if (din && (reg_status & SPI_STATUS_RE)) { break; @@ -262,7 +262,7 @@ int spi_xfer(uint8_t dev_idx, uint8_t bitlen, const void *dout, void *din) { tmp = getreg16(SPI_REG(REG_RX_MSB)) << 16; tmp |= getreg16(SPI_REG(REG_RX_LSB)); - dbg("data_in=0x%08x ", tmp); + err("data_in=0x%08x ", tmp); if (bitlen <= 8) { @@ -278,7 +278,7 @@ int spi_xfer(uint8_t dev_idx, uint8_t bitlen, const void *dout, void *din) } } - dbg("\n"); + err("\n"); return 0; } diff --git a/arch/arm/src/calypso/calypso_uwire.c b/arch/arm/src/calypso/calypso_uwire.c index d837a7abdc..ee932b2924 100644 --- a/arch/arm/src/calypso/calypso_uwire.c +++ b/arch/arm/src/calypso/calypso_uwire.c @@ -112,7 +112,7 @@ int uwire_xfer(int cs, int bitlen, const void *dout, void *din) /* FIXME uwire_init always selects CS0 for now */ - dbg("uwire_xfer(dev_idx=%u, bitlen=%u\n", cs, bitlen); + err("uwire_xfer(dev_idx=%u, bitlen=%u\n", cs, bitlen); /* select the chip */ @@ -128,7 +128,7 @@ int uwire_xfer(int cs, int bitlen, const void *dout, void *din) tmp <<= 16 - bitlen; /* align to MSB */ putreg16(tmp, UWIRE_REG(REG_DATA)); - dbg(", data_out=0x%04hx", tmp); + err(", data_out=0x%04hx", tmp); } tmp = (dout ? UWIRE_CSR_BITS_WR(bitlen) : 0) | @@ -142,7 +142,7 @@ int uwire_xfer(int cs, int bitlen, const void *dout, void *din) _uwire_wait(UWIRE_CSR_RDRB, UWIRE_CSR_RDRB); tmp = getreg16(UWIRE_REG(REG_DATA)); - dbg(", data_in=0x%08x", tmp); + err(", data_in=0x%08x", tmp); if (bitlen <= 8) *(uint8_t *)din = tmp & 0xff; @@ -155,7 +155,7 @@ int uwire_xfer(int cs, int bitlen, const void *dout, void *din) putreg16(UWIRE_CSR_IDX(0) | 0, UWIRE_REG(REG_CSR)); _uwire_wait(UWIRE_CSR_CSRB, 0); - dbg(")\n"); + err(")\n"); return 0; } diff --git a/arch/arm/src/common/up_createstack.c b/arch/arm/src/common/up_createstack.c index 1aa06a31c3..70d83a83a5 100644 --- a/arch/arm/src/common/up_createstack.c +++ b/arch/arm/src/common/up_createstack.c @@ -210,7 +210,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) if (!tcb->stack_alloc_ptr) { - sdbg("ERROR: Failed to allocate stack, size %d\n", stack_size); + serr("ERROR: Failed to allocate stack, size %d\n", stack_size); } #endif } diff --git a/arch/arm/src/common/up_exit.c b/arch/arm/src/common/up_exit.c index b58ba08a44..be084481fd 100644 --- a/arch/arm/src/common/up_exit.c +++ b/arch/arm/src/common/up_exit.c @@ -77,8 +77,8 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) int i; #endif - sdbg(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); - sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); + serr(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); + serr(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); #if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; @@ -87,7 +87,7 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) struct inode *inode = filelist->fl_files[i].f_inode; if (inode) { - sdbg(" fd=%d refcount=%d\n", + serr(" fd=%d refcount=%d\n", i, inode->i_crefs); } } @@ -101,11 +101,11 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 - sdbg(" fd=%d nbytes=%d\n", + serr(" fd=%d nbytes=%d\n", filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - sdbg(" fd=%d\n", filep->fs_fd); + serr(" fd=%d\n", filep->fs_fd); #endif } } diff --git a/arch/arm/src/common/up_vfork.c b/arch/arm/src/common/up_vfork.c index 1d8e8c5de1..e655ab15b4 100644 --- a/arch/arm/src/common/up_vfork.c +++ b/arch/arm/src/common/up_vfork.c @@ -143,7 +143,7 @@ pid_t up_vfork(const struct vfork_s *context) child = task_vforksetup((start_t)(context->lr & ~1)); if (!child) { - sdbg("ERROR: task_vforksetup failed\n"); + serr("ERROR: task_vforksetup failed\n"); return (pid_t)ERROR; } @@ -162,7 +162,7 @@ pid_t up_vfork(const struct vfork_s *context) parent->flags & TCB_FLAG_TTYPE_MASK); if (ret != OK) { - sdbg("ERROR: up_create_stack failed: %d\n", ret); + serr("ERROR: up_create_stack failed: %d\n", ret); task_vforkabort(child, -ret); return (pid_t)ERROR; } diff --git a/arch/arm/src/dm320/dm320_framebuffer.c b/arch/arm/src/dm320/dm320_framebuffer.c index b753adc274..ca81e8a848 100644 --- a/arch/arm/src/dm320/dm320_framebuffer.c +++ b/arch/arm/src/dm320/dm320_framebuffer.c @@ -928,7 +928,7 @@ static void dm320_hwinitialize(void) /* Set up the rectangular cursor with defaults */ #ifdef CONFIG_FB_HWCURSOR - gdbg("Initialize rectangular cursor\n"); + gerr("Initialize rectangular cursor\n"); putreg16(0, DM320_OSD_CURXP); putreg16(0, DM320_OSD_CURYP); @@ -1385,7 +1385,7 @@ int up_fbinitialize(int display) ret = dm320_allocvideomemory(); if (ret != 0) { - gdbg("Failed to allocate video buffers\n"); + gerr("Failed to allocate video buffers\n"); return ret; } diff --git a/arch/arm/src/efm32/efm32_adc.c b/arch/arm/src/efm32/efm32_adc.c index 0053a874bd..bc652fc59e 100644 --- a/arch/arm/src/efm32/efm32_adc.c +++ b/arch/arm/src/efm32/efm32_adc.c @@ -1298,7 +1298,7 @@ struct adc_dev_s *efm32_adcinitialize(int intf, const uint8_t *chanlist, int nch else #endif { - adbg("No ADC interface defined\n"); + aerr("No ADC interface defined\n"); return NULL; } diff --git a/arch/arm/src/efm32/efm32_dma.c b/arch/arm/src/efm32/efm32_dma.c index c6c7af4e48..de260de00d 100644 --- a/arch/arm/src/efm32/efm32_dma.c +++ b/arch/arm/src/efm32/efm32_dma.c @@ -804,29 +804,29 @@ void efm32_dmadump(DMA_HANDLE handle, const struct efm32_dmaregs_s *regs, { struct dma_channel_s *dmach = (struct dma_channel_s *)handle; - dmadbg("%s\n", msg); - dmadbg(" DMA Registers:\n"); - dmadbg(" STATUS: %08x\n", regs->status); - dmadbg(" CTRLBASE: %08x\n", regs->ctrlbase); - dmadbg(" ALTCTRLBASE: %08x\n", regs->altctrlbase); - dmadbg(" CHWAITSTATUS: %08x\n", regs->chwaitstatus); - dmadbg(" CHUSEBURSTS: %08x\n", regs->chusebursts); - dmadbg(" CHREQMASKS: %08x\n", regs->chreqmasks); - dmadbg(" CHENS: %08x\n", regs->chens); - dmadbg(" CHALTS: %08x\n", regs->chalts); - dmadbg(" CHPRIS: %08x\n", regs->chpris); - dmadbg(" ERRORC: %08x\n", regs->errorc); - dmadbg(" CHREQSTATUS: %08x\n", regs->chreqstatus); - dmadbg(" CHSREQSTATUS: %08x\n", regs->chsreqstatus); - dmadbg(" IEN: %08x\n", regs->ien); + dmaerr("%s\n", msg); + dmaerr(" DMA Registers:\n"); + dmaerr(" STATUS: %08x\n", regs->status); + dmaerr(" CTRLBASE: %08x\n", regs->ctrlbase); + dmaerr(" ALTCTRLBASE: %08x\n", regs->altctrlbase); + dmaerr(" CHWAITSTATUS: %08x\n", regs->chwaitstatus); + dmaerr(" CHUSEBURSTS: %08x\n", regs->chusebursts); + dmaerr(" CHREQMASKS: %08x\n", regs->chreqmasks); + dmaerr(" CHENS: %08x\n", regs->chens); + dmaerr(" CHALTS: %08x\n", regs->chalts); + dmaerr(" CHPRIS: %08x\n", regs->chpris); + dmaerr(" ERRORC: %08x\n", regs->errorc); + dmaerr(" CHREQSTATUS: %08x\n", regs->chreqstatus); + dmaerr(" CHSREQSTATUS: %08x\n", regs->chsreqstatus); + dmaerr(" IEN: %08x\n", regs->ien); #if defined(CONFIG_EFM32_EFM32GG) - dmadbg(" CTRL: %08x\n", regs->ctrl); - dmadbg(" RDS: %08x\n", regs->rds); - dmadbg(" LOOP0: %08x\n", regs->loop0); - dmadbg(" LOOP1: %08x\n", regs->loop1); - dmadbg(" RECT0: %08x\n", regs->rect0); + dmaerr(" CTRL: %08x\n", regs->ctrl); + dmaerr(" RDS: %08x\n", regs->rds); + dmaerr(" LOOP0: %08x\n", regs->loop0); + dmaerr(" LOOP1: %08x\n", regs->loop1); + dmaerr(" RECT0: %08x\n", regs->rect0); #endif - dmadbg(" DMA Channel %d Registers:\n", dmach->chan); - dmadbg(" CHCTRL: %08x\n", regs->chnctrl); + dmaerr(" DMA Channel %d Registers:\n", dmach->chan); + dmaerr(" CHCTRL: %08x\n", regs->chnctrl); } #endif diff --git a/arch/arm/src/efm32/efm32_i2c.c b/arch/arm/src/efm32/efm32_i2c.c index aef2df814e..f12118f512 100644 --- a/arch/arm/src/efm32/efm32_i2c.c +++ b/arch/arm/src/efm32/efm32_i2c.c @@ -137,10 +137,10 @@ /* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */ #ifdef CONFIG_DEBUG_I2C -# define i2cdbg dbg +# define i2cerr err # define i2cinfo info #else -# define i2cdbg(x...) +# define i2cerr(x...) # define i2cinfo(x...) #endif @@ -761,7 +761,7 @@ static void efm32_i2c_tracenew(FAR struct efm32_i2c_priv_s *priv) if (priv->tndx >= (CONFIG_I2C_NTRACE - 1)) { - i2cdbg("Trace table overflow\n"); + i2cerr("Trace table overflow\n"); return; } @@ -1536,7 +1536,7 @@ static int efm32_i2c_transfer(FAR struct i2c_master_s *dev, { ret = -ETIMEDOUT; - i2cdbg("Timed out: I2Cx_STATE: 0x%04x I2Cx_STATUS: 0x%08x\n", + i2cerr("Timed out: I2Cx_STATE: 0x%04x I2Cx_STATUS: 0x%08x\n", efm32_i2c_getreg(priv, EFM32_I2C_STATE_OFFSET), efm32_i2c_getreg(priv, EFM32_I2C_STATUS_OFFSET)); diff --git a/arch/arm/src/efm32/efm32_irq.c b/arch/arm/src/efm32/efm32_irq.c index 4ad702d4ab..f22d4a44ae 100644 --- a/arch/arm/src/efm32/efm32_irq.c +++ b/arch/arm/src/efm32/efm32_irq.c @@ -155,7 +155,7 @@ static void efm32_dumpnvic(const char *msg, int irq) /**************************************************************************** * Name: efm32_nmi, efm32_busfault, efm32_usagefault, efm32_pendsv, - * efm32_dbgmonitor, efm32_pendsv, efm32_reserved + * efm32_errmonitor, efm32_pendsv, efm32_reserved * * Description: * Handlers for various exceptions. None are handled and all are fatal @@ -168,7 +168,7 @@ static void efm32_dumpnvic(const char *msg, int irq) static int efm32_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -176,7 +176,7 @@ static int efm32_nmi(int irq, FAR void *context) static int efm32_busfault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); + err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; } @@ -184,7 +184,7 @@ static int efm32_busfault(int irq, FAR void *context) static int efm32_usagefault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); + err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; } @@ -192,15 +192,15 @@ static int efm32_usagefault(int irq, FAR void *context) static int efm32_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } -static int efm32_dbgmonitor(int irq, FAR void *context) +static int efm32_errmonitor(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Debug Monitor received\n"); + err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; } @@ -208,7 +208,7 @@ static int efm32_dbgmonitor(int irq, FAR void *context) static int efm32_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } @@ -456,7 +456,7 @@ void up_irqinitialize(void) irq_attach(EFM32_IRQ_BUSFAULT, efm32_busfault); irq_attach(EFM32_IRQ_USAGEFAULT, efm32_usagefault); irq_attach(EFM32_IRQ_PENDSV, efm32_pendsv); - irq_attach(EFM32_IRQ_DBGMONITOR, efm32_dbgmonitor); + irq_attach(EFM32_IRQ_DBGMONITOR, efm32_errmonitor); irq_attach(EFM32_IRQ_RESERVED, efm32_reserved); #endif diff --git a/arch/arm/src/efm32/efm32_pwm.c b/arch/arm/src/efm32/efm32_pwm.c index 3794c177c8..815ae7ed96 100644 --- a/arch/arm/src/efm32/efm32_pwm.c +++ b/arch/arm/src/efm32/efm32_pwm.c @@ -82,7 +82,7 @@ #endif #ifdef CONFIG_DEBUG_PWM -# define pwmdbg dbg +# define pwmerr err # define pwmllerr llerr # ifdef CONFIG_DEBUG_INFO # define pwminfo info @@ -94,7 +94,7 @@ # define pwm_dumpgpio(p,m) # endif #else -# define pwmdbg(x...) +# define pwmerr(x...) # define pwmllerr(x...) # define pwminfo(x...) # define pwmllinfo(x...) @@ -414,7 +414,7 @@ static int pwm_timer(FAR struct efm32_pwmtimer_s *priv, if (efm32_timer_set_freq(priv->base, priv->pclk, info->frequency) < 0) { - pwmdbg("Cannot set TIMER frequency %dHz from clock %dHz\n", + pwmerr("Cannot set TIMER frequency %dHz from clock %dHz\n", info->frequency, priv->pclk); return -EINVAL; } @@ -933,7 +933,7 @@ FAR struct pwm_lowerhalf_s *efm32_pwminitialize(int timer) #endif default: - pwmdbg("No such timer configured\n"); + pwmerr("No such timer configured\n"); return NULL; } diff --git a/arch/arm/src/efm32/efm32_rmu.c b/arch/arm/src/efm32/efm32_rmu.c index 6b77564b24..1d30cb2b40 100644 --- a/arch/arm/src/efm32/efm32_rmu.c +++ b/arch/arm/src/efm32/efm32_rmu.c @@ -262,7 +262,7 @@ void efm32_rmu_initialize(void) } #ifdef CONFIG_EFM32_RMU_DEBUG - rmudbg("RMU => reg = 0x%08X\n", g_efm32_rstcause); + rmuerr("RMU => reg = 0x%08X\n", g_efm32_rstcause); for (; ; ) { const char *str; @@ -273,7 +273,7 @@ void efm32_rmu_initialize(void) break; } - rmudbg("RMU => %s\n", str); + rmuerr("RMU => %s\n", str); } #endif } diff --git a/arch/arm/src/efm32/efm32_rmu.h b/arch/arm/src/efm32/efm32_rmu.h index dec1a00464..d633c9f73c 100644 --- a/arch/arm/src/efm32/efm32_rmu.h +++ b/arch/arm/src/efm32/efm32_rmu.h @@ -56,14 +56,14 @@ #endif #ifdef CONFIG_EFM32_RMU_DEBUG -# define rmudbg llerr +# define rmuerr llerr # ifdef CONFIG_DEBUG_INFO # define rmuinfo llerr # else # define rmuinfo(x...) # endif #else -# define rmudbg(x...) +# define rmuerr(x...) # define rmuinfo(x...) #endif diff --git a/arch/arm/src/efm32/efm32_rtc_burtc.c b/arch/arm/src/efm32/efm32_rtc_burtc.c index ed32518f7b..779c922e59 100644 --- a/arch/arm/src/efm32/efm32_rtc_burtc.c +++ b/arch/arm/src/efm32/efm32_rtc_burtc.c @@ -131,9 +131,9 @@ #define __CNT_ZERO_REG EFM32_BURTC_RET_REG(1) #if defined CONFIG_DEBUG_FEATURES && defined CONFIG_RTC_DEBUG -# define burtcdbg llerr +# define burtcerr llerr #else -# define burtcdbg(x...) +# define burtcerr(x...) #endif /************************************************************************************ @@ -191,7 +191,7 @@ static int efm32_rtc_burtc_interrupt(int irq, void *context) if (source & BURTC_IF_LFXOFAIL) { - burtcdbg("BURTC_IF_LFXOFAIL"); + burtcerr("BURTC_IF_LFXOFAIL"); } #ifdef CONFIG_RTC_HIRES @@ -245,7 +245,7 @@ static void efm32_rtc_burtc_init(void) regval = g_efm32_rstcause; regval2 = getreg32(EFM32_BURTC_CTRL); - burtcdbg("BURTC RESETCAUSE=0x%08X BURTC_CTRL=0x%08X\n", regval, regval2); + burtcerr("BURTC RESETCAUSE=0x%08X BURTC_CTRL=0x%08X\n", regval, regval2); if (!(regval2 & BURTC_CTRL_RSTEN) && !(regval & RMU_RSTCAUSE_BUBODREG) && @@ -262,11 +262,11 @@ static void efm32_rtc_burtc_init(void) /* restore saved base time */ - burtcdbg("BURTC OK\n"); + burtcerr("BURTC OK\n"); return; } - burtcdbg("BURTC RESETED\n"); + burtcerr("BURTC RESETED\n"); /* Disable reset of BackupDomain */ @@ -358,7 +358,7 @@ static uint64_t efm32_get_burtc_tick(void) val = (uint64_t)cnt_carry*__CNT_TOP + cnt + cnt_zero; - burtcdbg("Get Tick carry %u zero %u reg %u\n", cnt_carry, cnt_carry,cnt); + burtcerr("Get Tick carry %u zero %u reg %u\n", cnt_carry, cnt_carry,cnt); return val; } @@ -449,7 +449,7 @@ int up_rtc_gettime(FAR struct timespec *tp) tp->tv_sec = val / CONFIG_RTC_FREQUENCY; tp->tv_nsec = (val % CONFIG_RTC_FREQUENCY)*(NSEC_PER_SEC/CONFIG_RTC_FREQUENCY); - burtcdbg("Get RTC %u.%09u\n", tp->tv_sec, tp->tv_nsec); + burtcerr("Get RTC %u.%09u\n", tp->tv_sec, tp->tv_nsec); return OK; } @@ -499,7 +499,7 @@ int up_rtc_settime(FAR const struct timespec *tp) cnt_carry = val / __CNT_TOP; cnt = val % __CNT_TOP; - burtcdbg("Set RTC %u.%09u carry %u zero %u reg %u\n", + burtcerr("Set RTC %u.%09u carry %u zero %u reg %u\n", tp->tv_sec, tp->tv_nsec, cnt_carry, cnt, cnt_reg); putreg32(cnt_carry, __CNT_CARRY_REG); diff --git a/arch/arm/src/efm32/efm32_spi.c b/arch/arm/src/efm32/efm32_spi.c index 5fce18d3ae..7eafb1a779 100644 --- a/arch/arm/src/efm32/efm32_spi.c +++ b/arch/arm/src/efm32/efm32_spi.c @@ -100,14 +100,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -1456,7 +1456,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, ret = wd_start(priv->wdog, (int)ticks, spi_dma_timeout, 1, (uint32_t)priv); if (ret < 0) { - spidbg("ERROR: Failed to start timeout\n"); + spierr("ERROR: Failed to start timeout\n"); } /* Then wait for each to complete. TX should complete first */ @@ -1594,7 +1594,7 @@ static int spi_portinitialize(struct efm32_spidev_s *priv) priv->rxdmach = efm32_dmachannel(); if (!priv->rxdmach) { - spidbg("ERROR: Failed to allocate the RX DMA channel for SPI port: %d\n", + spierr("ERROR: Failed to allocate the RX DMA channel for SPI port: %d\n", port); goto errout; } @@ -1602,7 +1602,7 @@ static int spi_portinitialize(struct efm32_spidev_s *priv) priv->txdmach = efm32_dmachannel(); if (!priv->txdmach) { - spidbg("ERROR: Failed to allocate the TX DMA channel for SPI port: %d\n", + spierr("ERROR: Failed to allocate the TX DMA channel for SPI port: %d\n", port); goto errout_with_rxdmach; } @@ -1612,7 +1612,7 @@ static int spi_portinitialize(struct efm32_spidev_s *priv) priv->wdog = wd_create(); if (!priv->wdog) { - spidbg("ERROR: Failed to create a timer for SPI port: %d\n", port); + spierr("ERROR: Failed to create a timer for SPI port: %d\n", port); goto errout_with_txdmach; } @@ -1709,7 +1709,7 @@ struct spi_dev_s *efm32_spibus_initialize(int port) else #endif { - spidbg("ERROR: Unsupported SPI port: %d\n", port); + spierr("ERROR: Unsupported SPI port: %d\n", port); return NULL; } @@ -1731,7 +1731,7 @@ struct spi_dev_s *efm32_spibus_initialize(int port) ret = spi_portinitialize(priv); if (ret < 0) { - spidbg("ERROR: Failed to initialize SPI port %d\n", port); + spierr("ERROR: Failed to initialize SPI port %d\n", port); leave_critical_section(flags); return NULL; } diff --git a/arch/arm/src/efm32/efm32_timer.c b/arch/arm/src/efm32/efm32_timer.c index e44121e411..a1350a9154 100644 --- a/arch/arm/src/efm32/efm32_timer.c +++ b/arch/arm/src/efm32/efm32_timer.c @@ -68,7 +68,7 @@ #endif #ifdef CONFIG_DEBUG_TIMER -# define efm32_timerdbg dbg +# define efm32_timererr err # define efm32_timerllerr llerr # ifdef CONFIG_DEBUG_INFO # define efm32_timerinfo info @@ -80,7 +80,7 @@ # define efm32_timer_dumpgpio(p,m) # endif #else -# define efm32_timerdbg(x...) +# define efm32_timererr(x...) # define efm32_timerllerr(x...) # define efm32_timerinfo(x...) # define efm32_timerllinfo(x...) @@ -262,7 +262,7 @@ int efm32_timer_set_freq(uintptr_t base, uint32_t clk_freq, uint32_t freq) reload = (clk_freq / prescaler / freq); - efm32_timerdbg("Source: %4xHz Div: %4x Reload: %4x \n", + efm32_timererr("Source: %4xHz Div: %4x Reload: %4x \n", clk_freq, prescaler, reload); putreg32(reload, base + EFM32_TIMER_TOP_OFFSET); diff --git a/arch/arm/src/efm32/efm32_usbdev.c b/arch/arm/src/efm32/efm32_usbdev.c index fe0a85f15d..a6f4c7362c 100644 --- a/arch/arm/src/efm32/efm32_usbdev.c +++ b/arch/arm/src/efm32/efm32_usbdev.c @@ -3799,7 +3799,7 @@ static int efm32_epout_configure(FAR struct efm32_ep_s *privep, uint8_t eptype, break; default: - udbg("Unsupported maxpacket: %d\n", maxpacket); + uerr("Unsupported maxpacket: %d\n", maxpacket); return -EINVAL; } } @@ -3894,7 +3894,7 @@ static int efm32_epin_configure(FAR struct efm32_ep_s *privep, uint8_t eptype, break; default: - udbg("Unsupported maxpacket: %d\n", maxpacket); + uerr("Unsupported maxpacket: %d\n", maxpacket); return -EINVAL; } } @@ -5482,7 +5482,7 @@ void up_usbinitialize(void) ret = irq_attach(EFM32_IRQ_USB, efm32_usbinterrupt); if (ret < 0) { - udbg("irq_attach failed\n", ret); + uerr("irq_attach failed\n", ret); goto errout; } diff --git a/arch/arm/src/efm32/efm32_usbhost.c b/arch/arm/src/efm32/efm32_usbhost.c index 8c18363062..55786d14e0 100644 --- a/arch/arm/src/efm32/efm32_usbhost.c +++ b/arch/arm/src/efm32/efm32_usbhost.c @@ -1362,7 +1362,7 @@ static int efm32_ctrlep_alloc(FAR struct efm32_usbhost_s *priv, ctrlep = (FAR struct efm32_ctrlinfo_s *)kmm_malloc(sizeof(struct efm32_ctrlinfo_s)); if (ctrlep == NULL) { - udbg("ERROR: Failed to allocate control endpoint container\n"); + uerr("ERROR: Failed to allocate control endpoint container\n"); return -ENOMEM; } @@ -1372,7 +1372,7 @@ static int efm32_ctrlep_alloc(FAR struct efm32_usbhost_s *priv, hport->funcaddr, hport->speed, ctrlep); if (ret < 0) { - udbg("ERROR: efm32_ctrlchan_alloc failed: %d\n", ret); + uerr("ERROR: efm32_ctrlchan_alloc failed: %d\n", ret); kmm_free(ctrlep); return ret; } @@ -1424,7 +1424,7 @@ static int efm32_xfrep_alloc(FAR struct efm32_usbhost_s *priv, chidx = efm32_chan_alloc(priv); if (chidx < 0) { - udbg("ERROR: Failed to allocate a host channel\n"); + uerr("ERROR: Failed to allocate a host channel\n"); return -ENOMEM; } @@ -1934,7 +1934,7 @@ static ssize_t efm32_in_transfer(FAR struct efm32_usbhost_s *priv, int chidx, ret = efm32_in_setup(priv, chidx); if (ret < 0) { - udbg("ERROR: efm32_in_setup failed: %d\n", ret); + uerr("ERROR: efm32_in_setup failed: %d\n", ret); return (ssize_t)ret; } @@ -1965,7 +1965,7 @@ static ssize_t efm32_in_transfer(FAR struct efm32_usbhost_s *priv, int chidx, { /* Break out and return the error */ - udbg("ERROR: efm32_chan_wait failed: %d\n", ret); + uerr("ERROR: efm32_chan_wait failed: %d\n", ret); return (ssize_t)ret; } } @@ -2010,7 +2010,7 @@ static void efm32_in_next(FAR struct efm32_usbhost_s *priv, return; } - udbg("ERROR: efm32_in_setup failed: %d\n", ret); + uerr("ERROR: efm32_in_setup failed: %d\n", ret); result = ret; } @@ -2068,7 +2068,7 @@ static int efm32_in_asynch(FAR struct efm32_usbhost_s *priv, int chidx, ret = efm32_chan_asynchsetup(priv, chan, callback, arg); if (ret < 0) { - udbg("ERROR: efm32_chan_asynchsetup failed: %d\n", ret); + uerr("ERROR: efm32_chan_asynchsetup failed: %d\n", ret); return ret; } @@ -2077,7 +2077,7 @@ static int efm32_in_asynch(FAR struct efm32_usbhost_s *priv, int chidx, ret = efm32_in_setup(priv, chidx); if (ret < 0) { - udbg("ERROR: efm32_in_setup failed: %d\n", ret); + uerr("ERROR: efm32_in_setup failed: %d\n", ret); } /* And return with the transfer pending */ @@ -2203,7 +2203,7 @@ static ssize_t efm32_out_transfer(FAR struct efm32_usbhost_s *priv, int chidx, ret = efm32_out_setup(priv, chidx); if (ret < 0) { - udbg("ERROR: efm32_out_setup failed: %d\n", ret); + uerr("ERROR: efm32_out_setup failed: %d\n", ret); return (ssize_t)ret; } @@ -2231,7 +2231,7 @@ static ssize_t efm32_out_transfer(FAR struct efm32_usbhost_s *priv, int chidx, { /* Break out and return the error */ - udbg("ERROR: efm32_chan_wait failed: %d\n", ret); + uerr("ERROR: efm32_chan_wait failed: %d\n", ret); return (ssize_t)ret; } @@ -2296,7 +2296,7 @@ static void efm32_out_next(FAR struct efm32_usbhost_s *priv, return; } - udbg("ERROR: efm32_out_setup failed: %d\n", ret); + uerr("ERROR: efm32_out_setup failed: %d\n", ret); result = ret; } @@ -2354,7 +2354,7 @@ static int efm32_out_asynch(FAR struct efm32_usbhost_s *priv, int chidx, ret = efm32_chan_asynchsetup(priv, chan, callback, arg); if (ret < 0) { - udbg("ERROR: efm32_chan_asynchsetup failed: %d\n", ret); + uerr("ERROR: efm32_chan_asynchsetup failed: %d\n", ret); return ret; } @@ -2363,7 +2363,7 @@ static int efm32_out_asynch(FAR struct efm32_usbhost_s *priv, int chidx, ret = efm32_out_setup(priv, chidx); if (ret < 0) { - udbg("ERROR: efm32_out_setup failed: %d\n", ret); + uerr("ERROR: efm32_out_setup failed: %d\n", ret); } /* And return with the transfer pending */ @@ -3932,7 +3932,7 @@ static int efm32_rh_enumerate(FAR struct efm32_usbhost_s *priv, ret = efm32_ctrlchan_alloc(priv, 0, 0, priv->rhport.hport.speed, &priv->ep0); if (ret < 0) { - udbg("ERROR: Failed to allocate a control endpoint: %d\n", ret); + uerr("ERROR: Failed to allocate a control endpoint: %d\n", ret); } return ret; @@ -3978,7 +3978,7 @@ static int efm32_enumerate(FAR struct usbhost_connection_s *conn, { /* Return to the disconnected state */ - udbg("ERROR: Enumeration failed: %d\n", ret); + uerr("ERROR: Enumeration failed: %d\n", ret); efm32_gint_disconnected(priv); } diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index 3328587c1c..b8e0ed627e 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -918,7 +918,7 @@ static int kinetis_ifup(struct net_driver_s *dev) uint8_t *mac = dev->d_mac.ether_addr_octet; uint32_t regval; - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); @@ -1695,7 +1695,7 @@ int kinetis_netinitialize(int intf) { /* We could not attach the ISR to the interrupt */ - ndbg("Failed to attach EMACTMR IRQ\n"); + nerr("Failed to attach EMACTMR IRQ\n"); return -EAGAIN; } #endif @@ -1706,7 +1706,7 @@ int kinetis_netinitialize(int intf) { /* We could not attach the ISR to the interrupt */ - ndbg("Failed to attach EMACTX IRQ\n"); + nerr("Failed to attach EMACTX IRQ\n"); return -EAGAIN; } @@ -1716,7 +1716,7 @@ int kinetis_netinitialize(int intf) { /* We could not attach the ISR to the interrupt */ - ndbg("Failed to attach EMACRX IRQ\n"); + nerr("Failed to attach EMACRX IRQ\n"); return -EAGAIN; } @@ -1726,7 +1726,7 @@ int kinetis_netinitialize(int intf) { /* We could not attach the ISR to the interrupt */ - ndbg("Failed to attach EMACMISC IRQ\n"); + nerr("Failed to attach EMACMISC IRQ\n"); return -EAGAIN; } diff --git a/arch/arm/src/kinetis/kinetis_irq.c b/arch/arm/src/kinetis/kinetis_irq.c index 10abcf8e5f..45b147af67 100644 --- a/arch/arm/src/kinetis/kinetis_irq.c +++ b/arch/arm/src/kinetis/kinetis_irq.c @@ -159,7 +159,7 @@ static void kinetis_dumpnvic(const char *msg, int irq) /**************************************************************************** * Name: kinetis_nmi, kinetis_busfault, kinetis_usagefault, kinetis_pendsv, - * kinetis_dbgmonitor, kinetis_pendsv, kinetis_reserved + * kinetis_errmonitor, kinetis_pendsv, kinetis_reserved * * Description: * Handlers for various execptions. None are handled and all are fatal @@ -172,7 +172,7 @@ static void kinetis_dumpnvic(const char *msg, int irq) static int kinetis_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -180,7 +180,7 @@ static int kinetis_nmi(int irq, FAR void *context) static int kinetis_busfault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Bus fault recived\n"); + err("PANIC!!! Bus fault recived\n"); PANIC(); return 0; } @@ -188,7 +188,7 @@ static int kinetis_busfault(int irq, FAR void *context) static int kinetis_usagefault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Usage fault received\n"); + err("PANIC!!! Usage fault received\n"); PANIC(); return 0; } @@ -196,15 +196,15 @@ static int kinetis_usagefault(int irq, FAR void *context) static int kinetis_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } -static int kinetis_dbgmonitor(int irq, FAR void *context) +static int kinetis_errmonitor(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Debug Monitor received\n"); + err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; } @@ -212,7 +212,7 @@ static int kinetis_dbgmonitor(int irq, FAR void *context) static int kinetis_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } @@ -428,7 +428,7 @@ void up_irqinitialize(void) irq_attach(KINETIS_IRQ_BUSFAULT, kinetis_busfault); irq_attach(KINETIS_IRQ_USAGEFAULT, kinetis_usagefault); irq_attach(KINETIS_IRQ_PENDSV, kinetis_pendsv); - irq_attach(KINETIS_IRQ_DBGMONITOR, kinetis_dbgmonitor); + irq_attach(KINETIS_IRQ_DBGMONITOR, kinetis_errmonitor); irq_attach(KINETIS_IRQ_RESERVED, kinetis_reserved); #endif diff --git a/arch/arm/src/kinetis/kinetis_pwm.c b/arch/arm/src/kinetis/kinetis_pwm.c index 214b3249a3..1f552d8e4b 100644 --- a/arch/arm/src/kinetis/kinetis_pwm.c +++ b/arch/arm/src/kinetis/kinetis_pwm.c @@ -83,7 +83,7 @@ #endif #ifdef CONFIG_DEBUG_PWM -# define pwmdbg dbg +# define pwmerr err # define pwmllerr llerr # ifdef CONFIG_DEBUG_INFO # define pwminfo info @@ -95,7 +95,7 @@ # define pwm_dumpgpio(p,m) # endif #else -# define pwmdbg(x...) +# define pwmerr(x...) # define pwmllerr(x...) # define pwminfo(x...) # define pwmllinfo(x...) @@ -519,7 +519,7 @@ static int pwm_timer(FAR struct kinetis_pwmtimer_s *priv, break; default: - pwmdbg("No such channel: %d\n", priv->channel); + pwmerr("No such channel: %d\n", priv->channel); return -EINVAL; } @@ -711,7 +711,7 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev) break; default: - pwmdbg("No such channel: %d\n", priv->channel); + pwmerr("No such channel: %d\n", priv->channel); return -EINVAL; } @@ -798,7 +798,7 @@ FAR struct pwm_lowerhalf_s *kinetis_pwminitialize(int timer) #endif default: - pwmdbg("No such timer configured\n"); + pwmerr("No such timer configured\n"); return NULL; } diff --git a/arch/arm/src/kinetis/kinetis_sdhc.c b/arch/arm/src/kinetis/kinetis_sdhc.c index 7c6f2d421f..0b2214cb2b 100644 --- a/arch/arm/src/kinetis/kinetis_sdhc.c +++ b/arch/arm/src/kinetis/kinetis_sdhc.c @@ -574,29 +574,29 @@ static void kinetis_sample(struct kinetis_dev_s *priv, int index) static void kinetis_dumpsample(struct kinetis_dev_s *priv, struct kinetis_sdhcregs_s *regs, const char *msg) { - fdbg("SDHC Registers: %s\n", msg); - fdbg(" DSADDR[%08x]: %08x\n", KINETIS_SDHC_DSADDR, regs->dsaddr); - fdbg(" BLKATTR[%08x]: %08x\n", KINETIS_SDHC_BLKATTR, regs->blkattr); - fdbg(" CMDARG[%08x]: %08x\n", KINETIS_SDHC_CMDARG, regs->cmdarg); - fdbg(" XFERTY[%08x]: %08x\n", KINETIS_SDHC_XFERTYP, regs->xferty); - fdbg(" CMDRSP0[%08x]: %08x\n", KINETIS_SDHC_CMDRSP0, regs->cmdrsp0); - fdbg(" CMDRSP1[%08x]: %08x\n", KINETIS_SDHC_CMDRSP1, regs->cmdrsp1); - fdbg(" CMDRSP2[%08x]: %08x\n", KINETIS_SDHC_CMDRSP2, regs->cmdrsp2); - fdbg(" CMDRSP3[%08x]: %08x\n", KINETIS_SDHC_CMDRSP3, regs->cmdrsp3); - fdbg(" PRSSTAT[%08x]: %08x\n", KINETIS_SDHC_PRSSTAT, regs->prsstat); - fdbg(" PROCTL[%08x]: %08x\n", KINETIS_SDHC_PROCTL, regs->proctl); - fdbg(" SYSCTL[%08x]: %08x\n", KINETIS_SDHC_SYSCTL, regs->sysctl); - fdbg(" IRQSTAT[%08x]: %08x\n", KINETIS_SDHC_IRQSTAT, regs->irqstat); - fdbg("IRQSTATEN[%08x]: %08x\n", KINETIS_SDHC_IRQSTATEN, regs->irqstaten); - fdbg(" IRQSIGEN[%08x]: %08x\n", KINETIS_SDHC_IRQSIGEN, regs->irqsigen); - fdbg(" AC12ERR[%08x]: %08x\n", KINETIS_SDHC_AC12ERR, regs->ac12err); - fdbg(" HTCAPBLT[%08x]: %08x\n", KINETIS_SDHC_HTCAPBLT, regs->htcapblt); - fdbg(" WML[%08x]: %08x\n", KINETIS_SDHC_WML, regs->wml); - fdbg(" ADMAES[%08x]: %08x\n", KINETIS_SDHC_ADMAES, regs->admaes); - fdbg(" ADSADDR[%08x]: %08x\n", KINETIS_SDHC_ADSADDR, regs->adsaddr); - fdbg(" VENDOR[%08x]: %08x\n", KINETIS_SDHC_VENDOR, regs->vendor); - fdbg(" MMCBOOT[%08x]: %08x\n", KINETIS_SDHC_MMCBOOT, regs->mmcboot); - fdbg(" HOSTVER[%08x]: %08x\n", KINETIS_SDHC_HOSTVER, regs->hostver); + ferr("SDHC Registers: %s\n", msg); + ferr(" DSADDR[%08x]: %08x\n", KINETIS_SDHC_DSADDR, regs->dsaddr); + ferr(" BLKATTR[%08x]: %08x\n", KINETIS_SDHC_BLKATTR, regs->blkattr); + ferr(" CMDARG[%08x]: %08x\n", KINETIS_SDHC_CMDARG, regs->cmdarg); + ferr(" XFERTY[%08x]: %08x\n", KINETIS_SDHC_XFERTYP, regs->xferty); + ferr(" CMDRSP0[%08x]: %08x\n", KINETIS_SDHC_CMDRSP0, regs->cmdrsp0); + ferr(" CMDRSP1[%08x]: %08x\n", KINETIS_SDHC_CMDRSP1, regs->cmdrsp1); + ferr(" CMDRSP2[%08x]: %08x\n", KINETIS_SDHC_CMDRSP2, regs->cmdrsp2); + ferr(" CMDRSP3[%08x]: %08x\n", KINETIS_SDHC_CMDRSP3, regs->cmdrsp3); + ferr(" PRSSTAT[%08x]: %08x\n", KINETIS_SDHC_PRSSTAT, regs->prsstat); + ferr(" PROCTL[%08x]: %08x\n", KINETIS_SDHC_PROCTL, regs->proctl); + ferr(" SYSCTL[%08x]: %08x\n", KINETIS_SDHC_SYSCTL, regs->sysctl); + ferr(" IRQSTAT[%08x]: %08x\n", KINETIS_SDHC_IRQSTAT, regs->irqstat); + ferr("IRQSTATEN[%08x]: %08x\n", KINETIS_SDHC_IRQSTATEN, regs->irqstaten); + ferr(" IRQSIGEN[%08x]: %08x\n", KINETIS_SDHC_IRQSIGEN, regs->irqsigen); + ferr(" AC12ERR[%08x]: %08x\n", KINETIS_SDHC_AC12ERR, regs->ac12err); + ferr(" HTCAPBLT[%08x]: %08x\n", KINETIS_SDHC_HTCAPBLT, regs->htcapblt); + ferr(" WML[%08x]: %08x\n", KINETIS_SDHC_WML, regs->wml); + ferr(" ADMAES[%08x]: %08x\n", KINETIS_SDHC_ADMAES, regs->admaes); + ferr(" ADSADDR[%08x]: %08x\n", KINETIS_SDHC_ADSADDR, regs->adsaddr); + ferr(" VENDOR[%08x]: %08x\n", KINETIS_SDHC_VENDOR, regs->vendor); + ferr(" MMCBOOT[%08x]: %08x\n", KINETIS_SDHC_MMCBOOT, regs->mmcboot); + ferr(" HOSTVER[%08x]: %08x\n", KINETIS_SDHC_HOSTVER, regs->hostver); } #endif @@ -1840,7 +1840,7 @@ static int kinetis_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t ar { if (--timeout <= 0) { - fdbg("ERROR: Timeout cmd: %08x PRSSTAT: %08x\n", + ferr("ERROR: Timeout cmd: %08x PRSSTAT: %08x\n", cmd, getreg32(KINETIS_SDHC_PRSSTAT)); return -EBUSY; @@ -2079,7 +2079,7 @@ static int kinetis_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { if (--timeout <= 0) { - fdbg("ERROR: Timeout cmd: %08x IRQSTAT: %08x\n", + ferr("ERROR: Timeout cmd: %08x IRQSTAT: %08x\n", cmd, getreg32(KINETIS_SDHC_IRQSTAT)); return -ETIMEDOUT; @@ -2090,7 +2090,7 @@ static int kinetis_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) if ((getreg32(KINETIS_SDHC_IRQSTAT) & errors) != 0) { - fdbg("ERROR: cmd: %08x errors: %08x IRQSTAT: %08x\n", + ferr("ERROR: cmd: %08x errors: %08x IRQSTAT: %08x\n", cmd, errors, getreg32(KINETIS_SDHC_IRQSTAT)); ret = -EIO; } @@ -2155,7 +2155,7 @@ static int kinetis_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, #ifdef CONFIG_DEBUG_FEATURES if (!rshort) { - fdbg("ERROR: rshort=NULL\n"); + ferr("ERROR: rshort=NULL\n"); ret = -EINVAL; } @@ -2165,7 +2165,7 @@ static int kinetis_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R1B_RESPONSE && (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R6_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2176,12 +2176,12 @@ static int kinetis_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, regval = getreg32(KINETIS_SDHC_IRQSTAT); if ((regval & SDHC_INT_CTOE) != 0) { - fdbg("ERROR: Command timeout: %08x\n", regval); + ferr("ERROR: Command timeout: %08x\n", regval); ret = -ETIMEDOUT; } else if ((regval & SDHC_INT_CCE) != 0) { - fdbg("ERROR: CRC failure: %08x\n", regval); + ferr("ERROR: CRC failure: %08x\n", regval); ret = -EIO; } } @@ -2214,7 +2214,7 @@ static int kinetis_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t r if ((cmd & MMCSD_RESPONSE_MASK) != MMCSD_R2_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2225,12 +2225,12 @@ static int kinetis_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t r regval = getreg32(KINETIS_SDHC_IRQSTAT); if (regval & SDHC_INT_CTOE) { - fdbg("ERROR: Timeout IRQSTAT: %08x\n", regval); + ferr("ERROR: Timeout IRQSTAT: %08x\n", regval); ret = -ETIMEDOUT; } else if (regval & SDHC_INT_CCE) { - fdbg("ERROR: CRC fail IRQSTAT: %08x\n", regval); + ferr("ERROR: CRC fail IRQSTAT: %08x\n", regval); ret = -EIO; } } @@ -2267,7 +2267,7 @@ static int kinetis_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t if ((cmd & MMCSD_RESPONSE_MASK) != MMCSD_R3_RESPONSE && (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R7_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2280,7 +2280,7 @@ static int kinetis_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t regval = getreg32(KINETIS_SDHC_IRQSTAT); if (regval & SDHC_INT_CTOE) { - fdbg("ERROR: Timeout IRQSTAT: %08x\n", regval); + ferr("ERROR: Timeout IRQSTAT: %08x\n", regval); ret = -ETIMEDOUT; } } @@ -2416,7 +2416,7 @@ static sdio_eventset_t kinetis_eventwait(FAR struct sdio_dev_s *dev, 1, (uint32_t)priv); if (ret != OK) { - fdbg("ERROR: wd_start failed: %d\n", ret); + ferr("ERROR: wd_start failed: %d\n", ret); } } diff --git a/arch/arm/src/kinetis/kinetis_start.c b/arch/arm/src/kinetis/kinetis_start.c index f686e77915..4b0451acf8 100644 --- a/arch/arm/src/kinetis/kinetis_start.c +++ b/arch/arm/src/kinetis/kinetis_start.c @@ -156,7 +156,7 @@ void __start(void) /* Show reset status */ - dbg("Reset status: %02x:%02x\n", + err("Reset status: %02x:%02x\n", getreg8(KINETIS_SMC_SRSH), getreg8(KINETIS_SMC_SRSL)); /* Then start NuttX */ diff --git a/arch/arm/src/kinetis/kinetis_usbdev.c b/arch/arm/src/kinetis/kinetis_usbdev.c index 9a8d5c75ab..dee28aed0a 100644 --- a/arch/arm/src/kinetis/kinetis_usbdev.c +++ b/arch/arm/src/kinetis/kinetis_usbdev.c @@ -369,7 +369,7 @@ const struct trace_msg_t g_usb_trace_strings_deverror[] = # undef CONFIG_KHCI_USBDEV_BDTDEBUG # define CONFIG_KHCI_USBDEV_BDTDEBUG 1 -# define regdbg llerr +# define regerr llerr # ifdef CONFIG_DEBUG_INFO # define reginfo llerr # else @@ -380,7 +380,7 @@ const struct trace_msg_t g_usb_trace_strings_deverror[] = # define khci_getreg(addr) getreg8(addr) # define khci_putreg(val,addr) putreg8(val,addr) -# define regdbg(x...) +# define regerr(x...) # define reginfo(x...) #endif @@ -389,7 +389,7 @@ const struct trace_msg_t g_usb_trace_strings_deverror[] = #ifdef CONFIG_KHCI_USBDEV_BDTDEBUG -# define bdtdbg llerr +# define bdterr llerr # ifdef CONFIG_DEBUG_INFO # define bdtinfo llerr # else @@ -398,7 +398,7 @@ const struct trace_msg_t g_usb_trace_strings_deverror[] = #else -# define bdtdbg(x...) +# define bdterr(x...) # define bdtinfo(x...) #endif @@ -953,7 +953,7 @@ static void khci_epwrite(struct khci_ep_s *privep, /* And, finally, give the BDT to the USB */ - bdtdbg("EP%d BDT IN [%p] {%08x, %08x}\n", + bdterr("EP%d BDT IN [%p] {%08x, %08x}\n", USB_EPNO(privep->ep.eplog), bdt, status, bdt->addr); bdt->status = status; @@ -994,7 +994,7 @@ static void khci_wrcomplete(struct khci_usbdev_s *priv, epno, privreq->req.len, privreq->req.xfrd, privreq->inflight[0], privreq->inflight[1]); #endif - bdtdbg("EP%d BDT IN [%p] {%08x, %08x}\n", + bdterr("EP%d BDT IN [%p] {%08x, %08x}\n", epno, bdtin, bdtin->status, bdtin->addr); /* We should own the BDT that just completed. But NULLify the entire BDT IN. @@ -1419,7 +1419,7 @@ static int khci_rdcomplete(struct khci_usbdev_s *priv, ullinfo("EP%d: len=%d xfrd=%d\n", epno, privreq->req.len, privreq->req.xfrd); - bdtdbg("EP%d BDT OUT [%p] {%08x, %08x}\n", + bdterr("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdtout, bdtout->status, bdtout->addr); /* We should own the BDT that just completed */ @@ -1563,7 +1563,7 @@ static int khci_ep0rdsetup(struct khci_usbdev_s *priv, uint8_t *dest, /* Then give the BDT to the USB */ - bdtdbg("EP0 BDT OUT [%p] {%08x, %08x}\n", bdtout, status, bdtout->addr); + bdterr("EP0 BDT OUT [%p] {%08x, %08x}\n", bdtout, status, bdtout->addr); bdtout->status = status; priv->ctrlstate = CTRLSTATE_RDREQUEST; @@ -1664,7 +1664,7 @@ static int khci_rdsetup(struct khci_ep_s *privep, uint8_t *dest, int readlen) /* Then give the BDT to the USB */ - bdtdbg("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdtout, status, bdtout->addr); + bdterr("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdtout, status, bdtout->addr); bdtout->status = status; return OK; @@ -2676,7 +2676,7 @@ static void khci_ep0transfer(struct khci_usbdev_s *priv, uint16_t ustat) bdt = &g_bdt[index]; priv->eplist[0].bdtout = bdt; - bdtdbg("EP0 BDT OUT [%p] {%08x, %08x}\n", bdt, bdt->status, bdt->addr); + bdterr("EP0 BDT OUT [%p] {%08x, %08x}\n", bdt, bdt->status, bdt->addr); /* Check the current EP0 OUT buffer contains a SETUP packet */ @@ -3299,7 +3299,7 @@ static int khci_epconfigure(struct usbdev_ep_s *ep, bdt->status = 0; bdt->addr = 0; - bdtdbg("EP%d BDT IN [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); + bdterr("EP%d BDT IN [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); /* Now do the same for the other buffer. */ @@ -3307,7 +3307,7 @@ static int khci_epconfigure(struct usbdev_ep_s *ep, bdt->status = 0; bdt->addr = 0; - bdtdbg("EP%d BDT IN [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); + bdterr("EP%d BDT IN [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); } if (!epin || bidi) @@ -3321,7 +3321,7 @@ static int khci_epconfigure(struct usbdev_ep_s *ep, bdt->status = 0; bdt->addr = 0; - bdtdbg("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); + bdterr("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); /* Now do the same for the other buffer. */ @@ -3329,7 +3329,7 @@ static int khci_epconfigure(struct usbdev_ep_s *ep, bdt->status = 0; bdt->addr = 0; - bdtdbg("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); + bdterr("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); } /* Get the maxpacket size of the endpoint. */ @@ -3666,9 +3666,9 @@ static int khci_epbdtstall(struct usbdev_ep_s *ep, bool resume, bool epin) bdt->addr = (uint8_t *)physaddr; bdt->status = (USB_BDT_UOWN | bytecount); - bdtdbg("EP0 BDT IN [%p] {%08x, %08x}\n", + bdterr("EP0 BDT IN [%p] {%08x, %08x}\n", bdt, bdt->status, bdt->addr); - bdtdbg("EP0 BDT IN [%p] {%08x, %08x}\n", + bdterr("EP0 BDT IN [%p] {%08x, %08x}\n", otherbdt, otherbdt->status, otherbdt->addr); } else @@ -3683,9 +3683,9 @@ static int khci_epbdtstall(struct usbdev_ep_s *ep, bool resume, bool epin) bdt->addr = 0; bdt->status = 0; - bdtdbg("EP%d BDT %s [%p] {%08x, %08x}\n", + bdterr("EP%d BDT %s [%p] {%08x, %08x}\n", epno, epin ? "IN" : "OUT", bdt, bdt->status, bdt->addr); - bdtdbg("EP%d BDT %s [%p] {%08x, %08x}\n", + bdterr("EP%d BDT %s [%p] {%08x, %08x}\n", epno, epin ? "IN" : "OUT", otherbdt, otherbdt->status, otherbdt->addr); /* Restart any queued requests (after a delay so that we can be assured @@ -3718,9 +3718,9 @@ static int khci_epbdtstall(struct usbdev_ep_s *ep, bool resume, bool epin) khci_rqstop(privep); - bdtdbg("EP%d BDT %s [%p] {%08x, %08x}\n", + bdterr("EP%d BDT %s [%p] {%08x, %08x}\n", epno, epin ? "IN" : "OUT", bdt, bdt->status, bdt->addr); - bdtdbg("EP%d BDT %s [%p] {%08x, %08x}\n", + bdterr("EP%d BDT %s [%p] {%08x, %08x}\n", epno, epin ? "IN" : "OUT", otherbdt, otherbdt->status, otherbdt->addr); } diff --git a/arch/arm/src/kl/kl_irq.c b/arch/arm/src/kl/kl_irq.c index af104dd9c6..bb9ac77db2 100644 --- a/arch/arm/src/kl/kl_irq.c +++ b/arch/arm/src/kl/kl_irq.c @@ -128,7 +128,7 @@ static void kl_dumpnvic(const char *msg, int irq) /**************************************************************************** * Name: kl_nmi, kl_busfault, kl_usagefault, kl_pendsv, - * kl_dbgmonitor, kl_pendsv, kl_reserved + * kl_errmonitor, kl_pendsv, kl_reserved * * Description: * Handlers for various execptions. None are handled and all are fatal @@ -141,7 +141,7 @@ static void kl_dumpnvic(const char *msg, int irq) static int kl_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -149,7 +149,7 @@ static int kl_nmi(int irq, FAR void *context) static int kl_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } @@ -157,7 +157,7 @@ static int kl_pendsv(int irq, FAR void *context) static int kl_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } diff --git a/arch/arm/src/kl/kl_pwm.c b/arch/arm/src/kl/kl_pwm.c index 7fef072a84..3ff80e32f0 100644 --- a/arch/arm/src/kl/kl_pwm.c +++ b/arch/arm/src/kl/kl_pwm.c @@ -80,7 +80,7 @@ #endif #ifdef CONFIG_DEBUG_PWM -# define pwmdbg dbg +# define pwmerr err # define pwmllerr llerr # ifdef CONFIG_DEBUG_INFO # define pwminfo info @@ -92,7 +92,7 @@ # define pwm_dumpgpio(p,m) # endif #else -# define pwmdbg(x...) +# define pwmerr(x...) # define pwmllerr(x...) # define pwminfo(x...) # define pwmllinfo(x...) @@ -483,7 +483,7 @@ static int pwm_timer(FAR struct kl_pwmtimer_s *priv, break; default: - pwmdbg("No such channel: %d\n", priv->channel); + pwmerr("No such channel: %d\n", priv->channel); return -EINVAL; } @@ -663,7 +663,7 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev) break; default: - pwmdbg("No such channel: %d\n", priv->channel); + pwmerr("No such channel: %d\n", priv->channel); return -EINVAL; } @@ -750,7 +750,7 @@ FAR struct pwm_lowerhalf_s *kl_pwminitialize(int timer) #endif default: - pwmdbg("No such timer configured\n"); + pwmerr("No such timer configured\n"); return NULL; } diff --git a/arch/arm/src/kl/kl_spi.c b/arch/arm/src/kl/kl_spi.c index b4fb53ac04..50553e3cf7 100644 --- a/arch/arm/src/kl/kl_spi.c +++ b/arch/arm/src/kl/kl_spi.c @@ -71,14 +71,14 @@ */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -364,7 +364,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) priv->frequency = frequency; priv->actual = actual; - spidbg("Frequency %d->%d\n", frequency, actual); + spierr("Frequency %d->%d\n", frequency, actual); return actual; } @@ -687,7 +687,7 @@ FAR struct spi_dev_s *kl_spibus_initialize(int port) else #endif { - spidbg("ERROR: Port %d not configured\n", port); + spierr("ERROR: Port %d not configured\n", port); return NULL; } diff --git a/arch/arm/src/lpc11xx/lpc11_i2c.c b/arch/arm/src/lpc11xx/lpc11_i2c.c index f838629fb2..6d4c60f852 100644 --- a/arch/arm/src/lpc11xx/lpc11_i2c.c +++ b/arch/arm/src/lpc11xx/lpc11_i2c.c @@ -485,7 +485,7 @@ struct i2c_master_s *lpc11_i2cbus_initialize(int port) if (port > 1) { - dbg("lpc I2C Only support 0,1\n"); + err("lpc I2C Only support 0,1\n"); return NULL; } diff --git a/arch/arm/src/lpc11xx/lpc11_irq.c b/arch/arm/src/lpc11xx/lpc11_irq.c index a5de46bc6e..d48cec28f8 100644 --- a/arch/arm/src/lpc11xx/lpc11_irq.c +++ b/arch/arm/src/lpc11xx/lpc11_irq.c @@ -124,7 +124,7 @@ static void lpc11_dumpnvic(const char *msg, int irq) /**************************************************************************** * Name: lpc11_nmi, lpc11_busfault, lpc11_usagefault, lpc11_pendsv, - * lpc11_dbgmonitor, lpc11_pendsv, lpc11_reserved + * lpc11_errmonitor, lpc11_pendsv, lpc11_reserved * * Description: * Handlers for various execptions. None are handled and all are fatal @@ -137,7 +137,7 @@ static void lpc11_dumpnvic(const char *msg, int irq) static int lpc11_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -145,7 +145,7 @@ static int lpc11_nmi(int irq, FAR void *context) static int lpc11_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } @@ -153,7 +153,7 @@ static int lpc11_pendsv(int irq, FAR void *context) static int lpc11_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } diff --git a/arch/arm/src/lpc11xx/lpc11_serial.c b/arch/arm/src/lpc11xx/lpc11_serial.c index 02f6ef37d3..331c4df7c2 100644 --- a/arch/arm/src/lpc11xx/lpc11_serial.c +++ b/arch/arm/src/lpc11xx/lpc11_serial.c @@ -638,7 +638,7 @@ static int up_interrupt(int irq, void *context) default: { - dbg("Unexpected IIR: %02x\n", status); + err("Unexpected IIR: %02x\n", status); break; } } diff --git a/arch/arm/src/lpc11xx/lpc11_spi.c b/arch/arm/src/lpc11xx/lpc11_spi.c index 7e9c7c0a20..2354977bff 100644 --- a/arch/arm/src/lpc11xx/lpc11_spi.c +++ b/arch/arm/src/lpc11xx/lpc11_spi.c @@ -80,14 +80,14 @@ */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -292,7 +292,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, priv->frequency = frequency; priv->actual = actual; - spidbg("Frequency %d->%d\n", frequency, actual); + spierr("Frequency %d->%d\n", frequency, actual); return actual; } @@ -456,7 +456,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, FAR uint8_t *ptr = (FAR uint8_t *)buffer; uint8_t data; - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords) { /* Write the data to transmitted to the SPI Data Register */ @@ -503,7 +503,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, { FAR uint8_t *ptr = (FAR uint8_t *)buffer; - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords) { /* Write some dummy data to the SPI Data Register in order to clock the diff --git a/arch/arm/src/lpc11xx/lpc11_ssp.c b/arch/arm/src/lpc11xx/lpc11_ssp.c index 201227ae94..ab34fd40f8 100644 --- a/arch/arm/src/lpc11xx/lpc11_ssp.c +++ b/arch/arm/src/lpc11xx/lpc11_ssp.c @@ -81,14 +81,14 @@ */ #ifdef CONFIG_DEBUG_SPI -# define sspdbg llerr +# define ssperr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define sspdbg(x...) +# define ssperr(x...) # define spiinfo(x...) #endif @@ -474,7 +474,7 @@ static uint32_t ssp_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) priv->frequency = frequency; priv->actual = actual; - sspdbg("Frequency %d->%d\n", frequency, actual); + ssperr("Frequency %d->%d\n", frequency, actual); return actual; } @@ -525,7 +525,7 @@ static void ssp_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; default: - sspdbg("Bad mode: %d\n", mode); + ssperr("Bad mode: %d\n", mode); DEBUGASSERT(FALSE); return; } @@ -613,7 +613,7 @@ static uint16_t ssp_send(FAR struct spi_dev_s *dev, uint16_t wd) /* Get the value from the RX FIFO and return it */ regval = ssp_getreg(priv, LPC11_SSP_DR_OFFSET); - sspdbg("%04x->%04x\n", wd, regval); + ssperr("%04x->%04x\n", wd, regval); return (uint16_t)regval; } @@ -651,7 +651,7 @@ static void ssp_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, /* Loop while thre are bytes remaining to be sent */ - sspdbg("nwords: %d\n", nwords); + ssperr("nwords: %d\n", nwords); u.pv = buffer; while (nwords > 0) { @@ -679,7 +679,7 @@ static void ssp_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, /* Then discard all card responses until the RX & TX FIFOs are emptied. */ - sspdbg("discarding\n"); + ssperr("discarding\n"); do { /* Is there anything in the RX fifo? */ @@ -744,7 +744,7 @@ static void ssp_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, * occurred). */ - sspdbg("nwords: %d\n", nwords); + ssperr("nwords: %d\n", nwords); u.pv = buffer; while (nwords || rxpending) { diff --git a/arch/arm/src/lpc11xx/lpc11_timer.c b/arch/arm/src/lpc11xx/lpc11_timer.c index 4791df3fc7..cb18e4c158 100644 --- a/arch/arm/src/lpc11xx/lpc11_timer.c +++ b/arch/arm/src/lpc11xx/lpc11_timer.c @@ -89,7 +89,7 @@ #endif #ifdef CONFIG_DEBUG_PWM -# define pwmdbg dbg +# define pwmerr err # define pwmllerr llerr # ifdef CONFIG_DEBUG_INFO # define pwminfo info @@ -101,7 +101,7 @@ # define pwm_dumpgpio(p,m) # endif #else -# define pwmdbg(x...) +# define pwmerr(x...) # define pwmllerr(x...) # define pwminfo(x...) # define pwmllinfo(x...) @@ -245,8 +245,8 @@ static void timer_putreg(struct lpc11_timer_s *priv, int offset, #if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO) static void timer_dumpregs(struct lpc11_timer_s *priv, FAR const char *msg) { - pwmdbg("%s:\n", msg); - pwmdbg(" CR1: %04x CR2: %04x SMCR: %04x DIER: %04x\n", + pwmerr("%s:\n", msg); + pwmerr(" CR1: %04x CR2: %04x SMCR: %04x DIER: %04x\n", timer_getreg(priv, LPC11_PWM_MR0_OFFSET), timer_getreg(priv, LPC11_PWM_MR1_OFFSET), timer_getreg(priv, LPC11_PWM_MR2_OFFSET), @@ -254,7 +254,7 @@ static void timer_dumpregs(struct lpc11_timer_s *priv, FAR const char *msg) #if defined(CONFIG_LPC11_TMR0) if (priv->timtype == TIMTYPE_ADVANCED) { - pwmdbg(" RCR: %04x BDTR: %04x DCR: %04x DMAR: %04x\n", + pwmerr(" RCR: %04x BDTR: %04x DCR: %04x DMAR: %04x\n", timer_getreg(priv, LPC11_PWM_MR0_OFFSET), timer_getreg(priv, LPC11_PWM_MR1_OFFSET), timer_getreg(priv, LPC11_PWM_MR2_OFFSET), @@ -263,7 +263,7 @@ static void timer_dumpregs(struct lpc11_timer_s *priv, FAR const char *msg) else #endif { - pwmdbg(" DCR: %04x DMAR: %04x\n", + pwmerr(" DCR: %04x DMAR: %04x\n", timer_getreg(priv, LPC11_PWM_MR2_OFFSET), timer_getreg(priv, LPC11_PWM_MR3_OFFSET)); } @@ -469,7 +469,7 @@ static int timer_shutdown(FAR struct pwm_lowerhalf_s *dev) FAR struct lpc11_timer_s *priv = (FAR struct lpc11_timer_s *)dev; uint32_t pincfg; - pwmdbg("TIM%d pincfg: %08x\n", priv->timid, priv->pincfg); + pwmerr("TIM%d pincfg: %08x\n", priv->timid, priv->pincfg); /* Make sure that the output has been stopped */ @@ -525,7 +525,7 @@ static int timer_stop(FAR struct pwm_lowerhalf_s *dev) uint32_t regval; irqstate_t flags; - pwmdbg("TIM%d\n", priv->timid); + pwmerr("TIM%d\n", priv->timid); /* Disable interrupts momentary to stop any ongoing timer processing and * to prevent any concurrent access to the reset register. @@ -551,7 +551,7 @@ static int timer_stop(FAR struct pwm_lowerhalf_s *dev) leave_critical_section(flags); - pwmdbg("regaddr: %08x resetbit: %08x\n", regaddr, resetbit); + pwmerr("regaddr: %08x resetbit: %08x\n", regaddr, resetbit); timer_dumpregs(priv, "After stop"); return OK; } @@ -580,7 +580,7 @@ static int timer_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd, /* There are no platform-specific ioctl commands */ - pwmdbg("TIM%d\n", priv->timid); + pwmerr("TIM%d\n", priv->timid); #endif return -ENOTTY; } @@ -610,7 +610,7 @@ FAR struct pwm_lowerhalf_s *lpc11_timerinitialize(int timer) { FAR struct lpc11_timer_s *lower; - pwmdbg("TIM%d\n", timer); + pwmerr("TIM%d\n", timer); switch (timer) { @@ -624,7 +624,7 @@ FAR struct pwm_lowerhalf_s *lpc11_timerinitialize(int timer) #endif default: - pwmdbg("No such timer configured\n"); + pwmerr("No such timer configured\n"); return NULL; } diff --git a/arch/arm/src/lpc17xx/lpc176x_rtc.c b/arch/arm/src/lpc17xx/lpc176x_rtc.c index a16030b48d..1ffbbf93f4 100644 --- a/arch/arm/src/lpc17xx/lpc176x_rtc.c +++ b/arch/arm/src/lpc17xx/lpc176x_rtc.c @@ -81,12 +81,12 @@ /* Debug ****************************************************************************/ #ifdef CONFIG_DEBUG_RTC -# define rtcdbg dbg +# define rtcerr err # define rtcinfo info # define rtcllerr llerr # define rtcllinfo llinfo #else -# define rtcdbg(x...) +# define rtcerr(x...) # define rtcinfo(x...) # define rtcllerr(x...) # define rtcllinfo(x...) diff --git a/arch/arm/src/lpc17xx/lpc17_can.c b/arch/arm/src/lpc17xx/lpc17_can.c index 5678f41546..725a68332e 100644 --- a/arch/arm/src/lpc17xx/lpc17_can.c +++ b/arch/arm/src/lpc17xx/lpc17_can.c @@ -166,16 +166,16 @@ #ifdef CONFIG_DEBUG_CAN # ifdef CONFIG_CAN_REGDEBUG -# define candbg llerr +# define canerr llerr # define caninfo llinfo # else -# define candbg dbg +# define canerr err # define caninfo info # endif # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -520,7 +520,7 @@ static void can_reset(FAR struct can_dev_s *dev) ret = can_bittiming(priv); if (ret != OK) { - candbg("ERROR: Failed to set bit timing: %d\n", ret); + canerr("ERROR: Failed to set bit timing: %d\n", ret); } /* Restart the CAN */ @@ -697,7 +697,7 @@ static void can_txint(FAR struct can_dev_s *dev, bool enable) static int can_ioctl(FAR struct can_dev_s *dev, int cmd, unsigned long arg) { - dbg("Fix me:Not Implemented\n"); + err("Fix me:Not Implemented\n"); return 0; } @@ -717,7 +717,7 @@ static int can_ioctl(FAR struct can_dev_s *dev, int cmd, unsigned long arg) static int can_remoterequest(FAR struct can_dev_s *dev, uint16_t id) { - dbg("Fix me:Not Implemented\n"); + err("Fix me:Not Implemented\n"); return 0; } @@ -878,7 +878,7 @@ static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) } else { - candbg("No available transmission buffer, SR: %08x\n", regval); + canerr("No available transmission buffer, SR: %08x\n", regval); ret = -EBUSY; } @@ -1299,7 +1299,7 @@ FAR struct can_dev_s *lpc17_caninitialize(int port) else #endif { - candbg("Unsupported port: %d\n", port); + canerr("Unsupported port: %d\n", port); leave_critical_section(flags); return NULL; } diff --git a/arch/arm/src/lpc17xx/lpc17_dac.c b/arch/arm/src/lpc17xx/lpc17_dac.c index d5100c5e50..6508b09683 100644 --- a/arch/arm/src/lpc17xx/lpc17_dac.c +++ b/arch/arm/src/lpc17xx/lpc17_dac.c @@ -172,7 +172,7 @@ static int dac_send(FAR struct dac_dev_s *dev, FAR struct dac_msg_s *msg) static int dac_ioctl(FAR struct dac_dev_s *dev, int cmd, unsigned long arg) { - dbg("Fix me:Not Implemented\n"); + err("Fix me:Not Implemented\n"); return 0; } diff --git a/arch/arm/src/lpc17xx/lpc17_ethernet.c b/arch/arm/src/lpc17xx/lpc17_ethernet.c index fbf3172687..369112368b 100644 --- a/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -415,7 +415,7 @@ static void lpc17_ethreset(struct lpc17_driver_s *priv); #ifdef CONFIG_NET_REGDEBUG static void lpc17_printreg(uint32_t addr, uint32_t val, bool iswrite) { - dbg("%08x%s%08x\n", addr, iswrite ? "<-" : "->", val); + err("%08x%s%08x\n", addr, iswrite ? "<-" : "->", val); } #endif @@ -465,7 +465,7 @@ static void lpc17_checkreg(uint32_t addr, uint32_t val, bool iswrite) { /* No.. More than one. */ - dbg("[repeats %d more times]\n", count); + err("[repeats %d more times]\n", count); } } @@ -1720,7 +1720,7 @@ static int lpc17_ifup(struct net_driver_s *dev) uint32_t regval; int ret; - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); @@ -1733,7 +1733,7 @@ static int lpc17_ifup(struct net_driver_s *dev) ret = lpc17_phyinit(priv); if (ret != 0) { - ndbg("lpc17_phyinit failed: %d\n", ret); + nerr("lpc17_phyinit failed: %d\n", ret); return ret; } @@ -2319,14 +2319,14 @@ static void lpc17_showpins(void) #if defined(CONFIG_NET_REGDEBUG) && defined(LPC17_HAVE_PHY) static void lpc17_showmii(uint8_t phyaddr, const char *msg) { - dbg("PHY " LPC17_PHYNAME ": %s\n", msg); - dbg(" MCR: %04x\n", lpc17_phyread(phyaddr, MII_MCR)); - dbg(" MSR: %04x\n", lpc17_phyread(phyaddr, MII_MSR)); - dbg(" ADVERTISE: %04x\n", lpc17_phyread(phyaddr, MII_ADVERTISE)); - dbg(" LPA: %04x\n", lpc17_phyread(phyaddr, MII_LPA)); - dbg(" EXPANSION: %04x\n", lpc17_phyread(phyaddr, MII_EXPANSION)); + err("PHY " LPC17_PHYNAME ": %s\n", msg); + err(" MCR: %04x\n", lpc17_phyread(phyaddr, MII_MCR)); + err(" MSR: %04x\n", lpc17_phyread(phyaddr, MII_MSR)); + err(" ADVERTISE: %04x\n", lpc17_phyread(phyaddr, MII_ADVERTISE)); + err(" LPA: %04x\n", lpc17_phyread(phyaddr, MII_LPA)); + err(" EXPANSION: %04x\n", lpc17_phyread(phyaddr, MII_EXPANSION)); #ifdef CONFIG_ETH0_PHY_KS8721 - dbg(" 10BTCR: %04x\n", lpc17_phyread(phyaddr, MII_KS8721_10BTCR)); + err(" 10BTCR: %04x\n", lpc17_phyread(phyaddr, MII_KS8721_10BTCR)); #endif } #endif @@ -2462,7 +2462,7 @@ static inline int lpc17_phyreset(uint8_t phyaddr) } } - ndbg("Reset failed. MCR: %04x\n", phyreg); + nerr("Reset failed. MCR: %04x\n", phyreg); return -ETIMEDOUT; } #endif @@ -2509,7 +2509,7 @@ static inline int lpc17_phyautoneg(uint8_t phyaddr) } } - ndbg("Auto-negotiation failed. MSR: %04x\n", phyreg); + nerr("Auto-negotiation failed. MSR: %04x\n", phyreg); return -ETIMEDOUT; } #endif @@ -2593,7 +2593,7 @@ static int lpc17_phymode(uint8_t phyaddr, uint8_t mode) #endif } - ndbg("Link failed. MSR: %04x\n", phyreg); + nerr("Link failed. MSR: %04x\n", phyreg); return -ETIMEDOUT; } #endif @@ -2673,7 +2673,7 @@ static inline int lpc17_phyinit(struct lpc17_driver_s *priv) { /* Failed to find PHY at any location */ - ndbg("No PHY detected\n"); + nerr("No PHY detected\n"); return -ENODEV; } ninfo("phyaddr: %d\n", phyaddr); @@ -2760,7 +2760,7 @@ static inline int lpc17_phyinit(struct lpc17_driver_s *priv) break; default: - ndbg("Unrecognized mode: %04x\n", phyreg); + nerr("Unrecognized mode: %04x\n", phyreg); return -ENODEV; } @@ -2788,7 +2788,7 @@ static inline int lpc17_phyinit(struct lpc17_driver_s *priv) break; default: - ndbg("Unrecognized mode: %04x\n", phyreg); + nerr("Unrecognized mode: %04x\n", phyreg); return -ENODEV; } @@ -2816,7 +2816,7 @@ static inline int lpc17_phyinit(struct lpc17_driver_s *priv) break; default: - ndbg("Unrecognized mode: %04x\n", phyreg); + nerr("Unrecognized mode: %04x\n", phyreg); return -ENODEV; } @@ -2862,7 +2862,7 @@ static inline int lpc17_phyinit(struct lpc17_driver_s *priv) } else { - ndbg("Unrecognized mode: %04x\n", phyreg); + nerr("Unrecognized mode: %04x\n", phyreg); return -ENODEV; } } @@ -2871,7 +2871,7 @@ static inline int lpc17_phyinit(struct lpc17_driver_s *priv) # warning "PHY Unknown: speed and duplex are bogus" #endif - ndbg("%dBase-T %s duplex\n", + nerr("%dBase-T %s duplex\n", (priv->lp_mode & LPC17_SPEED_MASK) == LPC17_SPEED_100 ? 100 : 10, (priv->lp_mode & LPC17_DUPLEX_MASK) == LPC17_DUPLEX_FULL ?"full" : "half"); diff --git a/arch/arm/src/lpc17xx/lpc17_gpdma.c b/arch/arm/src/lpc17xx/lpc17_gpdma.c index 4a93267718..7b692c2535 100644 --- a/arch/arm/src/lpc17xx/lpc17_gpdma.c +++ b/arch/arm/src/lpc17xx/lpc17_gpdma.c @@ -707,47 +707,47 @@ void lpc17_dmadump(DMA_HANDLE handle, const struct lpc17_dmaregs_s *regs, /* Dump the sampled global DMA registers */ - dmadbg("Global GPDMA Registers: %s\n", msg); - dmadbg(" INTST[%08x]: %08x\n", + dmaerr("Global GPDMA Registers: %s\n", msg); + dmaerr(" INTST[%08x]: %08x\n", LPC17_DMA_INTST, regs->gbl.intst); - dmadbg(" INTTCST[%08x]: %08x\n", + dmaerr(" INTTCST[%08x]: %08x\n", LPC17_DMA_INTTCST, regs->gbl.inttcst); - dmadbg(" INTERRST[%08x]: %08x\n", + dmaerr(" INTERRST[%08x]: %08x\n", LPC17_DMA_INTERRST, regs->gbl.interrst); - dmadbg(" RAWINTTCST[%08x]: %08x\n", + dmaerr(" RAWINTTCST[%08x]: %08x\n", LPC17_DMA_RAWINTTCST, regs->gbl.rawinttcst); - dmadbg(" RAWINTERRST[%08x]: %08x\n", + dmaerr(" RAWINTERRST[%08x]: %08x\n", LPC17_DMA_RAWINTERRST, regs->gbl.rawinterrst); - dmadbg(" ENBLDCHNS[%08x]: %08x\n", + dmaerr(" ENBLDCHNS[%08x]: %08x\n", LPC17_DMA_ENBLDCHNS, regs->gbl.enbldchns); - dmadbg(" SOFTBREQ[%08x]: %08x\n", + dmaerr(" SOFTBREQ[%08x]: %08x\n", LPC17_DMA_SOFTBREQ, regs->gbl.softbreq); - dmadbg(" SOFTSREQ[%08x]: %08x\n", + dmaerr(" SOFTSREQ[%08x]: %08x\n", LPC17_DMA_SOFTSREQ, regs->gbl.softsreq); - dmadbg(" SOFTLBREQ[%08x]: %08x\n", + dmaerr(" SOFTLBREQ[%08x]: %08x\n", LPC17_DMA_SOFTLBREQ, regs->gbl.softlbreq); - dmadbg(" SOFTLSREQ[%08x]: %08x\n", + dmaerr(" SOFTLSREQ[%08x]: %08x\n", LPC17_DMA_SOFTLSREQ, regs->gbl.softlsreq); - dmadbg(" CONFIG[%08x]: %08x\n", + dmaerr(" CONFIG[%08x]: %08x\n", LPC17_DMA_CONFIG, regs->gbl.config); - dmadbg(" SYNC[%08x]: %08x\n", + dmaerr(" SYNC[%08x]: %08x\n", LPC17_DMA_SYNC, regs->gbl.sync); /* Dump the DMA channel registers */ base = LPC17_DMACH_BASE((uint32_t)dmach->chn); - dmadbg("Channel GPDMA Registers: %d\n", dmach->chn); + dmaerr("Channel GPDMA Registers: %d\n", dmach->chn); - dmadbg(" SRCADDR[%08x]: %08x\n", + dmaerr(" SRCADDR[%08x]: %08x\n", base + LPC17_DMACH_SRCADDR_OFFSET, regs->ch.srcaddr); - dmadbg(" DESTADDR[%08x]: %08x\n", + dmaerr(" DESTADDR[%08x]: %08x\n", base + LPC17_DMACH_DESTADDR_OFFSET, regs->ch.destaddr); - dmadbg(" LLI[%08x]: %08x\n", + dmaerr(" LLI[%08x]: %08x\n", base + LPC17_DMACH_LLI_OFFSET, regs->ch.lli); - dmadbg(" CONTROL[%08x]: %08x\n", + dmaerr(" CONTROL[%08x]: %08x\n", base + LPC17_DMACH_CONTROL_OFFSET, regs->ch.control); - dmadbg(" CONFIG[%08x]: %08x\n", + dmaerr(" CONFIG[%08x]: %08x\n", base + LPC17_DMACH_CONFIG_OFFSET, regs->ch.config); } #endif /* CONFIG_DEBUG_DMA */ diff --git a/arch/arm/src/lpc17xx/lpc17_i2c.c b/arch/arm/src/lpc17xx/lpc17_i2c.c index 9b106fdda4..7b5346e9f3 100644 --- a/arch/arm/src/lpc17xx/lpc17_i2c.c +++ b/arch/arm/src/lpc17xx/lpc17_i2c.c @@ -485,7 +485,7 @@ struct i2c_master_s *lpc17_i2cbus_initialize(int port) if (port > 1) { - dbg("lpc I2C Only support 0,1\n"); + err("lpc I2C Only support 0,1\n"); return NULL; } diff --git a/arch/arm/src/lpc17xx/lpc17_irq.c b/arch/arm/src/lpc17xx/lpc17_irq.c index 47467d32b6..9029d7b1c2 100644 --- a/arch/arm/src/lpc17xx/lpc17_irq.c +++ b/arch/arm/src/lpc17xx/lpc17_irq.c @@ -137,7 +137,7 @@ static void lpc17_dumpnvic(const char *msg, int irq) /**************************************************************************** * Name: lpc17_nmi, lpc17_busfault, lpc17_usagefault, lpc17_pendsv, - * lpc17_dbgmonitor, lpc17_pendsv, lpc17_reserved + * lpc17_errmonitor, lpc17_pendsv, lpc17_reserved * * Description: * Handlers for various execptions. None are handled and all are fatal @@ -150,7 +150,7 @@ static void lpc17_dumpnvic(const char *msg, int irq) static int lpc17_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -158,7 +158,7 @@ static int lpc17_nmi(int irq, FAR void *context) static int lpc17_busfault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Bus fault recived\n"); + err("PANIC!!! Bus fault recived\n"); PANIC(); return 0; } @@ -166,7 +166,7 @@ static int lpc17_busfault(int irq, FAR void *context) static int lpc17_usagefault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Usage fault received\n"); + err("PANIC!!! Usage fault received\n"); PANIC(); return 0; } @@ -174,15 +174,15 @@ static int lpc17_usagefault(int irq, FAR void *context) static int lpc17_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } -static int lpc17_dbgmonitor(int irq, FAR void *context) +static int lpc17_errmonitor(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Debug Monitor received\n"); + err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; } @@ -190,7 +190,7 @@ static int lpc17_dbgmonitor(int irq, FAR void *context) static int lpc17_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } @@ -400,7 +400,7 @@ void up_irqinitialize(void) irq_attach(LPC17_IRQ_BUSFAULT, lpc17_busfault); irq_attach(LPC17_IRQ_USAGEFAULT, lpc17_usagefault); irq_attach(LPC17_IRQ_PENDSV, lpc17_pendsv); - irq_attach(LPC17_IRQ_DBGMONITOR, lpc17_dbgmonitor); + irq_attach(LPC17_IRQ_DBGMONITOR, lpc17_errmonitor); irq_attach(LPC17_IRQ_RESERVED, lpc17_reserved); #endif diff --git a/arch/arm/src/lpc17xx/lpc17_lcd.c b/arch/arm/src/lpc17xx/lpc17_lcd.c index 0c0af0cd7c..5abf5d319e 100644 --- a/arch/arm/src/lpc17xx/lpc17_lcd.c +++ b/arch/arm/src/lpc17xx/lpc17_lcd.c @@ -209,7 +209,7 @@ static int lpc17_getvideoinfo(FAR struct fb_vtable_s *vtable, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -227,7 +227,7 @@ static int lpc17_getplaneinfo(FAR struct fb_vtable_s *vtable, int planeno, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -403,7 +403,7 @@ static int lpc17_getcursor(FAR struct fb_vtable_s *vtable, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } #endif @@ -443,7 +443,7 @@ static int lpc17_setcursor(FAR struct fb_vtable_s *vtable, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } #endif diff --git a/arch/arm/src/lpc17xx/lpc17_mcpwm.c b/arch/arm/src/lpc17xx/lpc17_mcpwm.c index b882af8950..0d0f1db15a 100644 --- a/arch/arm/src/lpc17xx/lpc17_mcpwm.c +++ b/arch/arm/src/lpc17xx/lpc17_mcpwm.c @@ -88,7 +88,7 @@ #endif #ifdef CONFIG_DEBUG_PWM -# define pwmdbg dbg +# define pwmerr err # define pwmllerr llerr # ifdef CONFIG_DEBUG_INFO # define pwminfo info @@ -100,7 +100,7 @@ # define pwm_dumpgpio(p,m) # endif #else -# define pwmdbg(x...) +# define pwmerr(x...) # define pwmllerr(x...) # define pwminfo(x...) # define pwmllinfo(x...) @@ -674,7 +674,7 @@ FAR struct pwm_lowerhalf_s *lpc17_mcpwminitialize(int timer) #endif default: - pwmdbg("No such timer configured\n"); + pwmerr("No such timer configured\n"); return NULL; } diff --git a/arch/arm/src/lpc17xx/lpc17_pwm.c b/arch/arm/src/lpc17xx/lpc17_pwm.c index a2c9f6c39f..2d668b07b2 100644 --- a/arch/arm/src/lpc17xx/lpc17_pwm.c +++ b/arch/arm/src/lpc17xx/lpc17_pwm.c @@ -106,7 +106,7 @@ #endif #ifdef CONFIG_DEBUG_PWM -# define pwmdbg dbg +# define pwmerr err # define pwmllerr llerr # ifdef CONFIG_DEBUG_INFO # define pwminfo info @@ -118,7 +118,7 @@ # define pwm_dumpgpio(p,m) # endif #else -# define pwmdbg(x...) +# define pwmerr(x...) # define pwmllerr(x...) # define pwminfo(x...) # define pwmllinfo(x...) @@ -645,7 +645,7 @@ FAR struct pwm_lowerhalf_s *lpc17_pwminitialize(int timer) #endif default: - pwmdbg("No such timer configured\n"); + pwmerr("No such timer configured\n"); return NULL; } diff --git a/arch/arm/src/lpc17xx/lpc17_sdcard.c b/arch/arm/src/lpc17xx/lpc17_sdcard.c index 225bd5465a..1143d4ca1f 100644 --- a/arch/arm/src/lpc17xx/lpc17_sdcard.c +++ b/arch/arm/src/lpc17xx/lpc17_sdcard.c @@ -722,16 +722,16 @@ static void lpc17_sample(struct lpc17_dev_s *priv, int index) #ifdef CONFIG_DEBUG_SDIO static void lpc17_sdcard_dump(struct lpc17_sdcard_regs_s *regs, const char *msg) { - fdbg("SD Card Registers: %s\n", msg); - fdbg(" POWER[%08x]: %08x\n", LPC17_SDCARD_PWR, regs->pwr); - fdbg(" CLKCR[%08x]: %08x\n", LPC17_SDCARD_CLOCK, regs->clkcr); - fdbg(" DCTRL[%08x]: %08x\n", LPC17_SDCARD_DCTRL, regs->dctrl); - fdbg(" DTIMER[%08x]: %08x\n", LPC17_SDCARD_DTIMER, regs->dtimer); - fdbg(" DLEN[%08x]: %08x\n", LPC17_SDCARD_DLEN, regs->dlen); - fdbg(" DCOUNT[%08x]: %08x\n", LPC17_SDCARD_DCOUNT, regs->dcount); - fdbg(" STA[%08x]: %08x\n", LPC17_SDCARD_STATUS, regs->sta); - fdbg(" MASK[%08x]: %08x\n", LPC17_SDCARD_MASK0, regs->mask); - fdbg("FIFOCNT[%08x]: %08x\n", LPC17_SDCARD_FIFOCNT, regs->fifocnt); + ferr("SD Card Registers: %s\n", msg); + ferr(" POWER[%08x]: %08x\n", LPC17_SDCARD_PWR, regs->pwr); + ferr(" CLKCR[%08x]: %08x\n", LPC17_SDCARD_CLOCK, regs->clkcr); + ferr(" DCTRL[%08x]: %08x\n", LPC17_SDCARD_DCTRL, regs->dctrl); + ferr(" DTIMER[%08x]: %08x\n", LPC17_SDCARD_DTIMER, regs->dtimer); + ferr(" DLEN[%08x]: %08x\n", LPC17_SDCARD_DLEN, regs->dlen); + ferr(" DCOUNT[%08x]: %08x\n", LPC17_SDCARD_DCOUNT, regs->dcount); + ferr(" STA[%08x]: %08x\n", LPC17_SDCARD_STATUS, regs->sta); + ferr(" MASK[%08x]: %08x\n", LPC17_SDCARD_MASK0, regs->mask); + ferr("FIFOCNT[%08x]: %08x\n", LPC17_SDCARD_FIFOCNT, regs->fifocnt); } #endif @@ -1920,7 +1920,7 @@ static int lpc17_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { if (--timeout <= 0) { - fdbg("ERROR: Timeout cmd: %08x events: %08x STA: %08x\n", + ferr("ERROR: Timeout cmd: %08x events: %08x STA: %08x\n", cmd, events, getreg32(LPC17_SDCARD_STATUS)); return -ETIMEDOUT; @@ -1987,7 +1987,7 @@ static int lpc17_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t #ifdef CONFIG_DEBUG_FEATURES if (!rshort) { - fdbg("ERROR: rshort=NULL\n"); + ferr("ERROR: rshort=NULL\n"); ret = -EINVAL; } @@ -1997,7 +1997,7 @@ static int lpc17_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R1B_RESPONSE && (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R6_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2008,12 +2008,12 @@ static int lpc17_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t regval = getreg32(LPC17_SDCARD_STATUS); if ((regval & SDCARD_STATUS_CTIMEOUT) != 0) { - fdbg("ERROR: Command timeout: %08x\n", regval); + ferr("ERROR: Command timeout: %08x\n", regval); ret = -ETIMEDOUT; } else if ((regval & SDCARD_STATUS_CCRCFAIL) != 0) { - fdbg("ERROR: CRC failure: %08x\n", regval); + ferr("ERROR: CRC failure: %08x\n", regval); ret = -EIO; } #ifdef CONFIG_DEBUG_FEATURES @@ -2024,7 +2024,7 @@ static int lpc17_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t respcmd = getreg32(LPC17_SDCARD_RESPCMD); if ((uint8_t)(respcmd & SDCARD_RESPCMD_MASK) != (cmd & MMCSD_CMDIDX_MASK)) { - fdbg("ERROR: RESCMD=%02x CMD=%08x\n", respcmd, cmd); + ferr("ERROR: RESCMD=%02x CMD=%08x\n", respcmd, cmd); ret = -EINVAL; } } @@ -2057,7 +2057,7 @@ static int lpc17_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlo if ((cmd & MMCSD_RESPONSE_MASK) != MMCSD_R2_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2068,12 +2068,12 @@ static int lpc17_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlo regval = getreg32(LPC17_SDCARD_STATUS); if (regval & SDCARD_STATUS_CTIMEOUT) { - fdbg("ERROR: Timeout STA: %08x\n", regval); + ferr("ERROR: Timeout STA: %08x\n", regval); ret = -ETIMEDOUT; } else if (regval & SDCARD_STATUS_CCRCFAIL) { - fdbg("ERROR: CRC fail STA: %08x\n", regval); + ferr("ERROR: CRC fail STA: %08x\n", regval); ret = -EIO; } } @@ -2111,7 +2111,7 @@ static int lpc17_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *r if ((cmd & MMCSD_RESPONSE_MASK) != MMCSD_R3_RESPONSE && (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R7_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2124,7 +2124,7 @@ static int lpc17_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *r regval = getreg32(LPC17_SDCARD_STATUS); if (regval & SDCARD_STATUS_CTIMEOUT) { - fdbg("ERROR: Timeout STA: %08x\n", regval); + ferr("ERROR: Timeout STA: %08x\n", regval); ret = -ETIMEDOUT; } } @@ -2269,7 +2269,7 @@ static sdio_eventset_t lpc17_eventwait(FAR struct sdio_dev_s *dev, 1, (uint32_t)priv); if (ret != OK) { - fdbg("ERROR: wd_start failed: %d\n", ret); + ferr("ERROR: wd_start failed: %d\n", ret); } } diff --git a/arch/arm/src/lpc17xx/lpc17_serial.c b/arch/arm/src/lpc17xx/lpc17_serial.c index 6dda0aabc3..94a92873d2 100644 --- a/arch/arm/src/lpc17xx/lpc17_serial.c +++ b/arch/arm/src/lpc17xx/lpc17_serial.c @@ -1153,7 +1153,7 @@ static int up_interrupt(int irq, void *context) default: { - dbg("Unexpected IIR: %02x\n", status); + err("Unexpected IIR: %02x\n", status); break; } } diff --git a/arch/arm/src/lpc17xx/lpc17_spi.c b/arch/arm/src/lpc17xx/lpc17_spi.c index a7ccc2b2f1..a3a4f28b0f 100644 --- a/arch/arm/src/lpc17xx/lpc17_spi.c +++ b/arch/arm/src/lpc17xx/lpc17_spi.c @@ -80,14 +80,14 @@ */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -287,7 +287,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) priv->frequency = frequency; priv->actual = actual; - spidbg("Frequency %d->%d\n", frequency, actual); + spierr("Frequency %d->%d\n", frequency, actual); return actual; } @@ -449,7 +449,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size FAR uint8_t *ptr = (FAR uint8_t *)buffer; uint8_t data; - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords) { /* Write the data to transmitted to the SPI Data Register */ @@ -494,7 +494,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw { FAR uint8_t *ptr = (FAR uint8_t *)buffer; - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords) { /* Write some dummy data to the SPI Data Register in order to clock the diff --git a/arch/arm/src/lpc17xx/lpc17_ssp.c b/arch/arm/src/lpc17xx/lpc17_ssp.c index ad6fc44c87..25d2ef42ff 100644 --- a/arch/arm/src/lpc17xx/lpc17_ssp.c +++ b/arch/arm/src/lpc17xx/lpc17_ssp.c @@ -81,14 +81,14 @@ */ #ifdef CONFIG_DEBUG_SPI -# define sspdbg llerr +# define ssperr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define sspdbg(x...) +# define ssperr(x...) # define spiinfo(x...) #endif @@ -470,7 +470,7 @@ static uint32_t ssp_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) priv->frequency = frequency; priv->actual = actual; - sspdbg("Frequency %d->%d\n", frequency, actual); + ssperr("Frequency %d->%d\n", frequency, actual); return actual; } @@ -521,7 +521,7 @@ static void ssp_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; default: - sspdbg("Bad mode: %d\n", mode); + ssperr("Bad mode: %d\n", mode); DEBUGASSERT(FALSE); return; } @@ -609,7 +609,7 @@ static uint16_t ssp_send(FAR struct spi_dev_s *dev, uint16_t wd) /* Get the value from the RX FIFO and return it */ regval = ssp_getreg(priv, LPC17_SSP_DR_OFFSET); - sspdbg("%04x->%04x\n", wd, regval); + ssperr("%04x->%04x\n", wd, regval); return (uint16_t)regval; } @@ -646,7 +646,7 @@ static void ssp_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size /* Loop while thre are bytes remaining to be sent */ - sspdbg("nwords: %d\n", nwords); + ssperr("nwords: %d\n", nwords); u.pv = buffer; while (nwords > 0) { @@ -674,7 +674,7 @@ static void ssp_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size /* Then discard all card responses until the RX & TX FIFOs are emptied. */ - sspdbg("discarding\n"); + ssperr("discarding\n"); do { /* Is there anything in the RX fifo? */ @@ -735,7 +735,7 @@ static void ssp_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw /* While there is remaining to be sent (and no synchronization error has occurred) */ - sspdbg("nwords: %d\n", nwords); + ssperr("nwords: %d\n", nwords); u.pv = buffer; while (nwords || rxpending) { diff --git a/arch/arm/src/lpc17xx/lpc17_timer.c b/arch/arm/src/lpc17xx/lpc17_timer.c index 2fe7cc56cb..d609b1f4f5 100644 --- a/arch/arm/src/lpc17xx/lpc17_timer.c +++ b/arch/arm/src/lpc17xx/lpc17_timer.c @@ -89,7 +89,7 @@ #endif #ifdef CONFIG_DEBUG_PWM -# define pwmdbg dbg +# define pwmerr err # define pwmllerr llerr # ifdef CONFIG_DEBUG_INFO # define pwminfo info @@ -101,7 +101,7 @@ # define pwm_dumpgpio(p,m) # endif #else -# define pwmdbg(x...) +# define pwmerr(x...) # define pwmllerr(x...) # define pwminfo(x...) # define pwmllinfo(x...) @@ -245,8 +245,8 @@ static void timer_putreg(struct lpc17_timer_s *priv, int offset, #if defined(CONFIG_DEBUG_PWM) && defined(CONFIG_DEBUG_INFO) static void timer_dumpregs(struct lpc17_timer_s *priv, FAR const char *msg) { - pwmdbg("%s:\n", msg); - pwmdbg(" CR1: %04x CR2: %04x SMCR: %04x DIER: %04x\n", + pwmerr("%s:\n", msg); + pwmerr(" CR1: %04x CR2: %04x SMCR: %04x DIER: %04x\n", timer_getreg(priv, LPC17_PWM_MR0_OFFSET), timer_getreg(priv, LPC17_PWM_MR1_OFFSET), timer_getreg(priv, LPC17_PWM_MR2_OFFSET), @@ -254,7 +254,7 @@ static void timer_dumpregs(struct lpc17_timer_s *priv, FAR const char *msg) #if defined(CONFIG_LPC17_TMR0) if (priv->timtype == TIMTYPE_ADVANCED) { - pwmdbg(" RCR: %04x BDTR: %04x DCR: %04x DMAR: %04x\n", + pwmerr(" RCR: %04x BDTR: %04x DCR: %04x DMAR: %04x\n", timer_getreg(priv, LPC17_PWM_MR0_OFFSET), timer_getreg(priv, LPC17_PWM_MR1_OFFSET), timer_getreg(priv, LPC17_PWM_MR2_OFFSET), @@ -263,7 +263,7 @@ static void timer_dumpregs(struct lpc17_timer_s *priv, FAR const char *msg) else #endif { - pwmdbg(" DCR: %04x DMAR: %04x\n", + pwmerr(" DCR: %04x DMAR: %04x\n", timer_getreg(priv, LPC17_PWM_MR2_OFFSET), timer_getreg(priv, LPC17_PWM_MR3_OFFSET)); } @@ -469,7 +469,7 @@ static int timer_shutdown(FAR struct pwm_lowerhalf_s *dev) FAR struct lpc17_timer_s *priv = (FAR struct lpc17_timer_s *)dev; uint32_t pincfg; - pwmdbg("TIM%d pincfg: %08x\n", priv->timid, priv->pincfg); + pwmerr("TIM%d pincfg: %08x\n", priv->timid, priv->pincfg); /* Make sure that the output has been stopped */ @@ -525,7 +525,7 @@ static int timer_stop(FAR struct pwm_lowerhalf_s *dev) uint32_t regval; irqstate_t flags; - pwmdbg("TIM%d\n", priv->timid); + pwmerr("TIM%d\n", priv->timid); /* Disable interrupts momentary to stop any ongoing timer processing and * to prevent any concurrent access to the reset register. @@ -551,7 +551,7 @@ static int timer_stop(FAR struct pwm_lowerhalf_s *dev) leave_critical_section(flags); - pwmdbg("regaddr: %08x resetbit: %08x\n", regaddr, resetbit); + pwmerr("regaddr: %08x resetbit: %08x\n", regaddr, resetbit); timer_dumpregs(priv, "After stop"); return OK; } @@ -579,7 +579,7 @@ static int timer_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd, unsigned long a /* There are no platform-specific ioctl commands */ - pwmdbg("TIM%d\n", priv->timid); + pwmerr("TIM%d\n", priv->timid); #endif return -ENOTTY; } @@ -609,7 +609,7 @@ FAR struct pwm_lowerhalf_s *lpc17_timerinitialize(int timer) { FAR struct lpc17_timer_s *lower; - pwmdbg("TIM%d\n", timer); + pwmerr("TIM%d\n", timer); switch (timer) { @@ -623,7 +623,7 @@ FAR struct pwm_lowerhalf_s *lpc17_timerinitialize(int timer) #endif default: - pwmdbg("No such timer configured\n"); + pwmerr("No such timer configured\n"); return NULL; } diff --git a/arch/arm/src/lpc17xx/lpc17_usbhost.c b/arch/arm/src/lpc17xx/lpc17_usbhost.c index d11c0eb4f9..c128b18217 100644 --- a/arch/arm/src/lpc17xx/lpc17_usbhost.c +++ b/arch/arm/src/lpc17xx/lpc17_usbhost.c @@ -1547,7 +1547,7 @@ static int lpc17_ctrltd(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed, xfrinfo = lpc17_alloc_xfrinfo(); if (xfrinfo == NULL) { - udbg("ERROR: lpc17_alloc_xfrinfo failed\n"); + uerr("ERROR: lpc17_alloc_xfrinfo failed\n"); return -ENOMEM; } @@ -1566,7 +1566,7 @@ static int lpc17_ctrltd(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed, ret = lpc17_wdhwait(priv, ed); if (ret < 0) { - udbg("ERROR: Device disconnected\n"); + uerr("ERROR: Device disconnected\n"); goto errout_with_xfrinfo; } @@ -1607,7 +1607,7 @@ static int lpc17_ctrltd(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed, } else { - udbg("ERROR: Bad TD completion status: %d\n", xfrinfo->tdstatus); + uerr("ERROR: Bad TD completion status: %d\n", xfrinfo->tdstatus); ret = xfrinfo->tdstatus == TD_CC_STALL ? -EPERM : -EIO; } } @@ -1967,7 +1967,7 @@ static int lpc17_wait(struct usbhost_connection_s *conn, *hport = connport; leave_critical_section(flags); - udbg("RHport Connected: %s\n", + uerr("RHport Connected: %s\n", connport->connected ? "YES" : "NO"); return OK; @@ -1987,7 +1987,7 @@ static int lpc17_wait(struct usbhost_connection_s *conn, *hport = connport; leave_critical_section(flags); - udbg("Hub port Connected: %s\n", connport->connected ? "YES" : "NO"); + uerr("Hub port Connected: %s\n", connport->connected ? "YES" : "NO"); return OK; } #endif @@ -2041,7 +2041,7 @@ static int lpc17_rh_enumerate(struct usbhost_connection_s *conn, { /* No, return an error */ - udbg("Not connected\n"); + uerr("Not connected\n"); return -ENODEV; } @@ -2093,7 +2093,7 @@ static int lpc17_enumerate(FAR struct usbhost_connection_s *conn, ret = usbhost_enumerate(hport, &hport->devclass); if (ret < 0) { - udbg("ERROR: Enumeration failed: %d\n", ret); + uerr("ERROR: Enumeration failed: %d\n", ret); } return ret; @@ -2299,7 +2299,7 @@ static int lpc17_epalloc(struct usbhost_driver_s *drvr, { /* No.. destroy it and report the error */ - udbg("ERROR: Failed to queue ED for transfer type: %d\n", ed->xfrtype); + uerr("ERROR: Failed to queue ED for transfer type: %d\n", ed->xfrtype); sem_destroy(&ed->wdhsem); lpc17_edfree(ed); } @@ -2947,7 +2947,7 @@ static ssize_t lpc17_transfer(struct usbhost_driver_s *drvr, usbhost_ep_t ep, xfrinfo = lpc17_alloc_xfrinfo(); if (xfrinfo == NULL) { - udbg("ERROR: lpc17_alloc_xfrinfo failed\n"); + uerr("ERROR: lpc17_alloc_xfrinfo failed\n"); nbytes = -ENOMEM; goto errout_with_sem; } @@ -2966,7 +2966,7 @@ static ssize_t lpc17_transfer(struct usbhost_driver_s *drvr, usbhost_ep_t ep, ret = lpc17_dma_alloc(priv, ed, buffer, buflen, &alloc); if (ret < 0) { - udbg("ERROR: lpc17_dma_alloc failed: %d\n", ret); + uerr("ERROR: lpc17_dma_alloc failed: %d\n", ret); nbytes = (ssize_t)ret; goto errout_with_xfrinfo; } @@ -2987,7 +2987,7 @@ static ssize_t lpc17_transfer(struct usbhost_driver_s *drvr, usbhost_ep_t ep, ret = lpc17_wdhwait(priv, ed); if (ret < 0) { - udbg("ERROR: Device disconnected\n"); + uerr("ERROR: Device disconnected\n"); nbytes = (ssize_t)ret; goto errout_with_buffers; } @@ -2997,7 +2997,7 @@ static ssize_t lpc17_transfer(struct usbhost_driver_s *drvr, usbhost_ep_t ep, ret = lpc17_transfer_common(priv, ed, buffer, buflen); if (ret < 0) { - udbg("ERROR: lpc17_transfer_common failed: %d\n", ret); + uerr("ERROR: lpc17_transfer_common failed: %d\n", ret); nbytes = (ssize_t)ret; goto errout_with_wdhwait; } @@ -3021,7 +3021,7 @@ static ssize_t lpc17_transfer(struct usbhost_driver_s *drvr, usbhost_ep_t ep, * might understand. */ - udbg("ERROR: Bad TD completion status: %d\n", xfrinfo->tdstatus); + uerr("ERROR: Bad TD completion status: %d\n", xfrinfo->tdstatus); switch (xfrinfo->tdstatus) { @@ -3111,7 +3111,7 @@ static void lpc17_asynch_completion(struct lpc17_usbhost_s *priv, * might understand. */ - udbg("ERROR: Bad TD completion status: %d\n", xfrinfo->tdstatus); + uerr("ERROR: Bad TD completion status: %d\n", xfrinfo->tdstatus); switch (xfrinfo->tdstatus) { @@ -3213,7 +3213,7 @@ static int lpc17_asynch(struct usbhost_driver_s *drvr, usbhost_ep_t ep, xfrinfo = lpc17_alloc_xfrinfo(); if (xfrinfo == NULL) { - udbg("ERROR: lpc17_alloc_xfrinfo failed\n"); + uerr("ERROR: lpc17_alloc_xfrinfo failed\n"); ret = -ENOMEM; goto errout_with_sem; } @@ -3234,7 +3234,7 @@ static int lpc17_asynch(struct usbhost_driver_s *drvr, usbhost_ep_t ep, ret = lpc17_dma_alloc(priv, ed, buffer, buflen, &xfrinfo->alloc); if (ret < 0) { - udbg("ERROR: lpc17_dma_alloc failed: %d\n", ret); + uerr("ERROR: lpc17_dma_alloc failed: %d\n", ret); goto errout_with_sem; } @@ -3251,7 +3251,7 @@ static int lpc17_asynch(struct usbhost_driver_s *drvr, usbhost_ep_t ep, ret = lpc17_transfer_common(priv, ed, buffer, buflen); if (ret < 0) { - udbg("ERROR: lpc17_transfer_common failed: %d\n", ret); + uerr("ERROR: lpc17_transfer_common failed: %d\n", ret); goto errout_with_asynch; } @@ -3695,7 +3695,7 @@ struct usbhost_connection_s *lpc17_usbhost_initialize(int controller) lpc17_configgpio(GPIO_USB_OVRCR); /* USB port Over-Current status */ usbhost_dumpgpio(); - udbg("Initializing Host Stack\n"); + uerr("Initializing Host Stack\n"); /* Show AHB SRAM memory map */ @@ -3825,7 +3825,7 @@ struct usbhost_connection_s *lpc17_usbhost_initialize(int controller) if (irq_attach(LPC17_IRQ_USB, lpc17_usbinterrupt) != 0) { - udbg("Failed to attach IRQ\n"); + uerr("Failed to attach IRQ\n"); return NULL; } @@ -3850,7 +3850,7 @@ struct usbhost_connection_s *lpc17_usbhost_initialize(int controller) /* Enable interrupts at the interrupt controller */ up_enable_irq(LPC17_IRQ_USB); /* enable USB interrupt */ - udbg("USB host Initialized, Device connected:%s\n", + uerr("USB host Initialized, Device connected:%s\n", priv->connected ? "YES" : "NO"); return &g_usbconn; diff --git a/arch/arm/src/lpc214x/lpc214x_serial.c b/arch/arm/src/lpc214x/lpc214x_serial.c index f3ddd0cdd4..b0bcafd44e 100644 --- a/arch/arm/src/lpc214x/lpc214x_serial.c +++ b/arch/arm/src/lpc214x/lpc214x_serial.c @@ -549,7 +549,7 @@ static int up_interrupt(int irq, void *context) default: { - dbg("Unexpected IIR: %02x\n", status); + err("Unexpected IIR: %02x\n", status); break; } } diff --git a/arch/arm/src/lpc2378/lpc23xx_i2c.c b/arch/arm/src/lpc2378/lpc23xx_i2c.c index 54efbc52c0..d3bec89884 100644 --- a/arch/arm/src/lpc2378/lpc23xx_i2c.c +++ b/arch/arm/src/lpc2378/lpc23xx_i2c.c @@ -490,7 +490,7 @@ struct i2c_master_s *lpc2378_i2cbus_initialize(int port) if (port > 1) { - dbg("lpc I2C Only support 0,1\n"); + err("lpc I2C Only support 0,1\n"); return NULL; } diff --git a/arch/arm/src/lpc2378/lpc23xx_serial.c b/arch/arm/src/lpc2378/lpc23xx_serial.c index d582fe5de3..9ea299783d 100644 --- a/arch/arm/src/lpc2378/lpc23xx_serial.c +++ b/arch/arm/src/lpc2378/lpc23xx_serial.c @@ -667,7 +667,7 @@ static int up_interrupt(int irq, void *context) default: { - dbg("Unexpected IIR: %02x\n", status); + err("Unexpected IIR: %02x\n", status); break; } } diff --git a/arch/arm/src/lpc2378/lpc23xx_spi.c b/arch/arm/src/lpc2378/lpc23xx_spi.c index c1daf9f13c..1260105373 100644 --- a/arch/arm/src/lpc2378/lpc23xx_spi.c +++ b/arch/arm/src/lpc2378/lpc23xx_spi.c @@ -79,14 +79,14 @@ /* CONFIG_DEBUG_SPI enables debug output from this file */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -289,7 +289,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) priv->frequency = frequency; priv->actual = actual; - spidbg("Frequency %d->%d\n", frequency, actual); + spierr("Frequency %d->%d\n", frequency, actual); return actual; } @@ -453,7 +453,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size FAR uint8_t *ptr = (FAR uint8_t *)buffer; uint8_t data; - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords) { /* Write the data to transmitted to the SPI Data Register */ @@ -498,7 +498,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw { FAR uint8_t *ptr = (FAR uint8_t *)buffer; - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords) { /* Write some dummy data to the SPI Data Register in order to clock the diff --git a/arch/arm/src/lpc31xx/lpc31_ehci.c b/arch/arm/src/lpc31xx/lpc31_ehci.c index 0b161ac75c..d77700e327 100644 --- a/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -1463,11 +1463,11 @@ static int lpc31_qh_flush(struct lpc31_qh_s *qh) #ifdef CONFIG_LPC31_EHCI_REGDEBUG static void lpc31_qtd_print(struct lpc31_qtd_s *qtd) { - udbg(" QTD[%p]:\n", qtd); - udbg(" hw:\n"); - udbg(" nqp: %08x alt: %08x token: %08x\n", + uerr(" QTD[%p]:\n", qtd); + uerr(" hw:\n"); + uerr(" nqp: %08x alt: %08x token: %08x\n", qtd->hw.nqp, qtd->hw.alt, qtd->hw.token); - udbg(" bpl: %08x %08x %08x %08x %08x\n", + uerr(" bpl: %08x %08x %08x %08x %08x\n", qtd->hw.bpl[0], qtd->hw.bpl[1], qtd->hw.bpl[2], qtd->hw.bpl[3], qtd->hw.bpl[4]); } @@ -1487,29 +1487,29 @@ static void lpc31_qh_print(struct lpc31_qh_s *qh) struct lpc31_epinfo_s *epinfo; struct ehci_overlay_s *overlay; - udbg("QH[%p]:\n", qh); - udbg(" hw:\n"); - udbg(" hlp: %08x epchar: %08x epcaps: %08x cqp: %08x\n", + uerr("QH[%p]:\n", qh); + uerr(" hw:\n"); + uerr(" hlp: %08x epchar: %08x epcaps: %08x cqp: %08x\n", qh->hw.hlp, qh->hw.epchar, qh->hw.epcaps, qh->hw.cqp); overlay = &qh->hw.overlay; - udbg(" overlay:\n"); - udbg(" nqp: %08x alt: %08x token: %08x\n", + uerr(" overlay:\n"); + uerr(" nqp: %08x alt: %08x token: %08x\n", overlay->nqp, overlay->alt, overlay->token); - udbg(" bpl: %08x %08x %08x %08x %08x\n", + uerr(" bpl: %08x %08x %08x %08x %08x\n", overlay->bpl[0], overlay->bpl[1], overlay->bpl[2], overlay->bpl[3], overlay->bpl[4]); - udbg(" fqp:\n", qh->fqp); + uerr(" fqp:\n", qh->fqp); epinfo = qh->epinfo; - udbg(" epinfo[%p]:\n", epinfo); + uerr(" epinfo[%p]:\n", epinfo); if (epinfo) { - udbg(" EP%d DIR=%s FA=%08x TYPE=%d MaxPacket=%d\n", + uerr(" EP%d DIR=%s FA=%08x TYPE=%d MaxPacket=%d\n", epinfo->epno, epinfo->dirin ? "IN" : "OUT", epinfo->devaddr, epinfo->xfrtype, epinfo->maxpacket); - udbg(" Toggle=%d iocwait=%d speed=%d result=%d\n", + uerr(" Toggle=%d iocwait=%d speed=%d result=%d\n", epinfo->toggle, epinfo->iocwait, epinfo->speed, epinfo->result); } } @@ -4222,7 +4222,7 @@ static int lpc31_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, ret = lpc31_async_setup(rhport, ep0info, req, buffer, len); if (ret < 0) { - udbg("ERROR: lpc31_async_setup failed: %d\n", ret); + uerr("ERROR: lpc31_async_setup failed: %d\n", ret); goto errout_with_iocwait; } diff --git a/arch/arm/src/lpc31xx/lpc31_serial.c b/arch/arm/src/lpc31xx/lpc31_serial.c index e64e91352e..c3b9b3f509 100644 --- a/arch/arm/src/lpc31xx/lpc31_serial.c +++ b/arch/arm/src/lpc31xx/lpc31_serial.c @@ -560,7 +560,7 @@ static int up_interrupt(int irq, void *context) default: { - dbg("Unexpected IIR: %02x\n", status); + err("Unexpected IIR: %02x\n", status); break; } } diff --git a/arch/arm/src/lpc43xx/lpc43_dac.c b/arch/arm/src/lpc43xx/lpc43_dac.c index 16fa92a365..b9ab14b874 100644 --- a/arch/arm/src/lpc43xx/lpc43_dac.c +++ b/arch/arm/src/lpc43xx/lpc43_dac.c @@ -173,7 +173,7 @@ static int dac_send(FAR struct dac_dev_s *dev, FAR struct dac_msg_s *msg) static int dac_ioctl(FAR struct dac_dev_s *dev, int cmd, unsigned long arg) { - dbg("Fix me:Not Implemented\n"); + err("Fix me:Not Implemented\n"); return 0; } diff --git a/arch/arm/src/lpc43xx/lpc43_ehci.c b/arch/arm/src/lpc43xx/lpc43_ehci.c index d69b9a796d..a0d4d1160e 100644 --- a/arch/arm/src/lpc43xx/lpc43_ehci.c +++ b/arch/arm/src/lpc43xx/lpc43_ehci.c @@ -1350,11 +1350,11 @@ static int lpc43_qh_discard(struct lpc43_qh_s *qh) #ifdef CONFIG_LPC43_EHCI_REGDEBUG static void lpc43_qtd_print(struct lpc43_qtd_s *qtd) { - udbg(" QTD[%p]:\n", qtd); - udbg(" hw:\n"); - udbg(" nqp: %08x alt: %08x token: %08x\n", + uerr(" QTD[%p]:\n", qtd); + uerr(" hw:\n"); + uerr(" nqp: %08x alt: %08x token: %08x\n", qtd->hw.nqp, qtd->hw.alt, qtd->hw.token); - udbg(" bpl: %08x %08x %08x %08x %08x\n", + uerr(" bpl: %08x %08x %08x %08x %08x\n", qtd->hw.bpl[0], qtd->hw.bpl[1], qtd->hw.bpl[2], qtd->hw.bpl[3], qtd->hw.bpl[4]); } @@ -1374,29 +1374,29 @@ static void lpc43_qh_print(struct lpc43_qh_s *qh) struct lpc43_epinfo_s *epinfo; struct ehci_overlay_s *overlay; - udbg("QH[%p]:\n", qh); - udbg(" hw:\n"); - udbg(" hlp: %08x epchar: %08x epcaps: %08x cqp: %08x\n", + uerr("QH[%p]:\n", qh); + uerr(" hw:\n"); + uerr(" hlp: %08x epchar: %08x epcaps: %08x cqp: %08x\n", qh->hw.hlp, qh->hw.epchar, qh->hw.epcaps, qh->hw.cqp); overlay = &qh->hw.overlay; - udbg(" overlay:\n"); - udbg(" nqp: %08x alt: %08x token: %08x\n", + uerr(" overlay:\n"); + uerr(" nqp: %08x alt: %08x token: %08x\n", overlay->nqp, overlay->alt, overlay->token); - udbg(" bpl: %08x %08x %08x %08x %08x\n", + uerr(" bpl: %08x %08x %08x %08x %08x\n", overlay->bpl[0], overlay->bpl[1], overlay->bpl[2], overlay->bpl[3], overlay->bpl[4]); - udbg(" fqp:\n", qh->fqp); + uerr(" fqp:\n", qh->fqp); epinfo = qh->epinfo; - udbg(" epinfo[%p]:\n", epinfo); + uerr(" epinfo[%p]:\n", epinfo); if (epinfo) { - udbg(" EP%d DIR=%s FA=%08x TYPE=%d MaxPacket=%d\n", + uerr(" EP%d DIR=%s FA=%08x TYPE=%d MaxPacket=%d\n", epinfo->epno, epinfo->dirin ? "IN" : "OUT", epinfo->devaddr, epinfo->xfrtype, epinfo->maxpacket); - udbg(" Toggle=%d iocwait=%d speed=%d result=%d\n", + uerr(" Toggle=%d iocwait=%d speed=%d result=%d\n", epinfo->toggle, epinfo->iocwait, epinfo->speed, epinfo->result); } } @@ -4046,7 +4046,7 @@ static int lpc43_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, ret = lpc43_async_setup(rhport, ep0info, req, buffer, len); if (ret < 0) { - udbg("ERROR: lpc43_async_setup failed: %d\n", ret); + uerr("ERROR: lpc43_async_setup failed: %d\n", ret); goto errout_with_iocwait; } diff --git a/arch/arm/src/lpc43xx/lpc43_ethernet.c b/arch/arm/src/lpc43xx/lpc43_ethernet.c index 89d37cc88b..37e39dee6d 100644 --- a/arch/arm/src/lpc43xx/lpc43_ethernet.c +++ b/arch/arm/src/lpc43xx/lpc43_ethernet.c @@ -2381,12 +2381,12 @@ static int lpc43_ifup(struct net_driver_s *dev) int ret; #ifdef CONFIG_NET_IPv4 - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); #endif #ifdef CONFIG_NET_IPv6 - ndbg("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + nerr("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2], dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5], dev->d_ipv6addr[6], dev->d_ipv6addr[7]); @@ -2435,7 +2435,7 @@ static int lpc43_ifdown(struct net_driver_s *dev) FAR struct lpc43_ethmac_s *priv = (FAR struct lpc43_ethmac_s *)dev->d_private; irqstate_t flags; - ndbg("Taking the network down\n"); + nerr("Taking the network down\n"); /* Disable the Ethernet interrupt */ @@ -3065,7 +3065,7 @@ static int lpc43_phyread(uint16_t phydevaddr, uint16_t phyregaddr, uint16_t *val } } - ndbg("MII transfer timed out: phydevaddr: %04x phyregaddr: %04x\n", + nerr("MII transfer timed out: phydevaddr: %04x phyregaddr: %04x\n", phydevaddr, phyregaddr); return -ETIMEDOUT; @@ -3124,7 +3124,7 @@ static int lpc43_phywrite(uint16_t phydevaddr, uint16_t phyregaddr, uint16_t val } } - ndbg("MII transfer timed out: phydevaddr: %04x phyregaddr: %04x value: %04x\n", + nerr("MII transfer timed out: phydevaddr: %04x phyregaddr: %04x value: %04x\n", phydevaddr, phyregaddr, value); return -ETIMEDOUT; @@ -3161,7 +3161,7 @@ static inline int lpc43_dm9161(FAR struct lpc43_ethmac_s *priv) ret = lpc43_phyread(CONFIG_LPC43_PHYADDR, MII_PHYID1, &phyval); if (ret < 0) { - ndbg("Failed to read the PHY ID1: %d\n", ret); + nerr("Failed to read the PHY ID1: %d\n", ret); return ret; } @@ -3179,7 +3179,7 @@ static inline int lpc43_dm9161(FAR struct lpc43_ethmac_s *priv) ret = lpc43_phyread(CONFIG_LPC43_PHYADDR, 16, &phyval); if (ret < 0) { - ndbg("Failed to read the PHY Register 0x10: %d\n", ret); + nerr("Failed to read the PHY Register 0x10: %d\n", ret); return ret; } @@ -3236,7 +3236,7 @@ static int lpc43_phyinit(FAR struct lpc43_ethmac_s *priv) ret = lpc43_phywrite(CONFIG_LPC43_PHYADDR, MII_MCR, MII_MCR_RESET); if (ret < 0) { - ndbg("Failed to reset the PHY: %d\n", ret); + nerr("Failed to reset the PHY: %d\n", ret); return ret; } @@ -3248,7 +3248,7 @@ static int lpc43_phyinit(FAR struct lpc43_ethmac_s *priv) ret = lpc43_phy_boardinitialize(0); if (ret < 0) { - ndbg("Failed to initialize the PHY: %d\n", ret); + nerr("Failed to initialize the PHY: %d\n", ret); return ret; } #endif @@ -3273,7 +3273,7 @@ static int lpc43_phyinit(FAR struct lpc43_ethmac_s *priv) ret = lpc43_phyread(CONFIG_LPC43_PHYADDR, MII_MSR, &phyval); if (ret < 0) { - ndbg("Failed to read the PHY MSR: %d\n", ret); + nerr("Failed to read the PHY MSR: %d\n", ret); return ret; } else if ((phyval & MII_MSR_LINKSTATUS) != 0) @@ -3284,7 +3284,7 @@ static int lpc43_phyinit(FAR struct lpc43_ethmac_s *priv) if (timeout >= PHY_RETRY_TIMEOUT) { - ndbg("Timed out waiting for link status: %04x\n", phyval); + nerr("Timed out waiting for link status: %04x\n", phyval); return -ETIMEDOUT; } @@ -3293,7 +3293,7 @@ static int lpc43_phyinit(FAR struct lpc43_ethmac_s *priv) ret = lpc43_phywrite(CONFIG_LPC43_PHYADDR, MII_MCR, MII_MCR_ANENABLE); if (ret < 0) { - ndbg("Failed to enable auto-negotiation: %d\n", ret); + nerr("Failed to enable auto-negotiation: %d\n", ret); return ret; } @@ -3304,7 +3304,7 @@ static int lpc43_phyinit(FAR struct lpc43_ethmac_s *priv) ret = lpc43_phyread(CONFIG_LPC43_PHYADDR, MII_MSR, &phyval); if (ret < 0) { - ndbg("Failed to read the PHY MSR: %d\n", ret); + nerr("Failed to read the PHY MSR: %d\n", ret); return ret; } else if ((phyval & MII_MSR_ANEGCOMPLETE) != 0) @@ -3315,7 +3315,7 @@ static int lpc43_phyinit(FAR struct lpc43_ethmac_s *priv) if (timeout >= PHY_RETRY_TIMEOUT) { - ndbg("Timed out waiting for auto-negotiation\n"); + nerr("Timed out waiting for auto-negotiation\n"); return -ETIMEDOUT; } @@ -3324,7 +3324,7 @@ static int lpc43_phyinit(FAR struct lpc43_ethmac_s *priv) ret = lpc43_phyread(CONFIG_LPC43_PHYADDR, CONFIG_LPC43_PHYSR, &phyval); if (ret < 0) { - ndbg("Failed to read PHY status register\n"); + nerr("Failed to read PHY status register\n"); return ret; } @@ -3418,7 +3418,7 @@ static int lpc43_phyinit(FAR struct lpc43_ethmac_s *priv) ret = lpc43_phywrite(CONFIG_LPC43_PHYADDR, MII_MCR, phyval); if (ret < 0) { - ndbg("Failed to write the PHY MCR: %d\n", ret); + nerr("Failed to write the PHY MCR: %d\n", ret); return ret; } @@ -3434,7 +3434,7 @@ static int lpc43_phyinit(FAR struct lpc43_ethmac_s *priv) #endif #endif - ndbg("Duplex: %s Speed: %d MBps\n", + nerr("Duplex: %s Speed: %d MBps\n", priv->fduplex ? "FULL" : "HALF", priv->mbps100 ? 100 : 10); diff --git a/arch/arm/src/lpc43xx/lpc43_gpdma.c b/arch/arm/src/lpc43xx/lpc43_gpdma.c index c82de2a826..242b169952 100644 --- a/arch/arm/src/lpc43xx/lpc43_gpdma.c +++ b/arch/arm/src/lpc43xx/lpc43_gpdma.c @@ -67,7 +67,7 @@ #undef DMA_VERBOSE /* Define to enable verbose debug */ #ifdef DMA_DEBUG -# define dmadbg llerr +# define dmaerr llerr # ifdef DMA_VERBOSE # define spiinfo llerr # else @@ -75,7 +75,7 @@ # endif #else # undef DMA_VERBOSE -# define dmadbg(x...) +# define dmaerr(x...) # define spiinfo(x...) #endif diff --git a/arch/arm/src/lpc43xx/lpc43_gpio.c b/arch/arm/src/lpc43xx/lpc43_gpio.c index cda1757cd3..783c66c060 100644 --- a/arch/arm/src/lpc43xx/lpc43_gpio.c +++ b/arch/arm/src/lpc43xx/lpc43_gpio.c @@ -198,7 +198,7 @@ int lpc43_gpio_config(uint16_t gpiocfg) break; default : - sdbg("ERROR: Unrecognized pin mode: %04x\n", gpiocfg); + serr("ERROR: Unrecognized pin mode: %04x\n", gpiocfg); ret = -EINVAL; break; } diff --git a/arch/arm/src/lpc43xx/lpc43_i2c.c b/arch/arm/src/lpc43xx/lpc43_i2c.c index a7ddfa4726..9bc4f4b6e0 100644 --- a/arch/arm/src/lpc43xx/lpc43_i2c.c +++ b/arch/arm/src/lpc43xx/lpc43_i2c.c @@ -464,7 +464,7 @@ struct i2c_master_s *lpc43_i2cbus_initialize(int port) if (port > 1) { - dbg("lpc I2C Only support 0,1\n"); + err("lpc I2C Only support 0,1\n"); return NULL; } diff --git a/arch/arm/src/lpc43xx/lpc43_irq.c b/arch/arm/src/lpc43xx/lpc43_irq.c index cb2d1c502a..a792163de3 100644 --- a/arch/arm/src/lpc43xx/lpc43_irq.c +++ b/arch/arm/src/lpc43xx/lpc43_irq.c @@ -146,7 +146,7 @@ static void lpc43_dumpnvic(const char *msg, int irq) /**************************************************************************** * Name: lpc43_nmi, lpc43_busfault, lpc43_usagefault, lpc43_pendsv, - * lpc43_dbgmonitor, lpc43_pendsv, lpc43_reserved + * lpc43_errmonitor, lpc43_pendsv, lpc43_reserved * * Description: * Handlers for various exceptions. None are handled and all are fatal @@ -159,7 +159,7 @@ static void lpc43_dumpnvic(const char *msg, int irq) static int lpc43_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -167,7 +167,7 @@ static int lpc43_nmi(int irq, FAR void *context) static int lpc43_busfault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Bus fault recived\n"); + err("PANIC!!! Bus fault recived\n"); PANIC(); return 0; } @@ -175,7 +175,7 @@ static int lpc43_busfault(int irq, FAR void *context) static int lpc43_usagefault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Usage fault received\n"); + err("PANIC!!! Usage fault received\n"); PANIC(); return 0; } @@ -183,15 +183,15 @@ static int lpc43_usagefault(int irq, FAR void *context) static int lpc43_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } -static int lpc43_dbgmonitor(int irq, FAR void *context) +static int lpc43_errmonitor(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Debug Monitor received\n"); + err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; } @@ -199,7 +199,7 @@ static int lpc43_dbgmonitor(int irq, FAR void *context) static int lpc43_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } @@ -435,7 +435,7 @@ void up_irqinitialize(void) irq_attach(LPC43_IRQ_BUSFAULT, lpc43_busfault); irq_attach(LPC43_IRQ_USAGEFAULT, lpc43_usagefault); irq_attach(LPC43_IRQ_PENDSV, lpc43_pendsv); - irq_attach(LPC43_IRQ_DBGMONITOR, lpc43_dbgmonitor); + irq_attach(LPC43_IRQ_DBGMONITOR, lpc43_errmonitor); irq_attach(LPC43_IRQ_RESERVED, lpc43_reserved); #endif diff --git a/arch/arm/src/lpc43xx/lpc43_serial.c b/arch/arm/src/lpc43xx/lpc43_serial.c index 78778b609e..1e045e13d7 100644 --- a/arch/arm/src/lpc43xx/lpc43_serial.c +++ b/arch/arm/src/lpc43xx/lpc43_serial.c @@ -873,7 +873,7 @@ static int up_interrupt(int irq, void *context) default: { - dbg("Unexpected IIR: %02x\n", status); + err("Unexpected IIR: %02x\n", status); break; } } diff --git a/arch/arm/src/lpc43xx/lpc43_spi.c b/arch/arm/src/lpc43xx/lpc43_spi.c index a5e6254ce1..1d425bc5ff 100644 --- a/arch/arm/src/lpc43xx/lpc43_spi.c +++ b/arch/arm/src/lpc43xx/lpc43_spi.c @@ -67,7 +67,7 @@ /* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else @@ -75,7 +75,7 @@ # endif #else # undef CONFIG_DEBUG_INFO -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -274,7 +274,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) priv->frequency = frequency; priv->actual = actual; - spidbg("Frequency %d->%d\n", frequency, actual); + spierr("Frequency %d->%d\n", frequency, actual); return actual; } @@ -436,7 +436,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size FAR uint8_t *ptr = (FAR uint8_t *)buffer; uint8_t data; - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords) { /* Write the data to transmitted to the SPI Data Register */ @@ -481,7 +481,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw { FAR uint8_t *ptr = (FAR uint8_t *)buffer; - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords) { /* Write some dummy data to the SPI Data Register in order to clock the diff --git a/arch/arm/src/lpc43xx/lpc43_spifi.c b/arch/arm/src/lpc43xx/lpc43_spifi.c index 101f355546..71920dc477 100644 --- a/arch/arm/src/lpc43xx/lpc43_spifi.c +++ b/arch/arm/src/lpc43xx/lpc43_spifi.c @@ -388,7 +388,7 @@ static void lpc43_blockerase(struct lpc43_dev_s *priv, off_t sector) result = SPIFI_ERASE(priv, &priv->rom, &priv->operands); if (result != 0) { - fdbg("ERROR: SPIFI_ERASE failed: %05x\n", result); + ferr("ERROR: SPIFI_ERASE failed: %05x\n", result); } } @@ -417,7 +417,7 @@ static inline int lpc43_chiperase(struct lpc43_dev_s *priv) result = SPIFI_ERASE(priv, &priv->rom, &priv->operands); if (result != 0) { - fdbg("ERROR: SPIFI_ERASE failed: %05x\n", result); + ferr("ERROR: SPIFI_ERASE failed: %05x\n", result); return -EIO; } @@ -463,7 +463,7 @@ static int lpc43_pagewrite(FAR struct lpc43_dev_s *priv, FAR uint8_t *dest, result = SPIFI_PROGRAM(priv, &priv->rom, src, &priv->operands); if (result != 0) { - fdbg("ERROR: SPIFI_PROGRAM failed: %05x\n", result); + ferr("ERROR: SPIFI_PROGRAM failed: %05x\n", result); return -EIO; } @@ -475,7 +475,7 @@ static int lpc43_pagewrite(FAR struct lpc43_dev_s *priv, FAR uint8_t *dest, result = lpc43_verify(priv, dest, src, nbytes); if (result != 0) { - fdbg("ERROR: lpc43_verify failed: %05x\n", result); + ferr("ERROR: lpc43_verify failed: %05x\n", result); return -EIO; } #endif @@ -523,7 +523,7 @@ static void lpc43_cacheflush(struct lpc43_dev_s *priv) ret = lpc43_pagewrite(priv, dest, priv->cache, SPIFI_BLKSIZE); if (ret < 0) { - fdbg("ERROR: lpc43_pagewrite failed: %d\n", ret); + ferr("ERROR: lpc43_pagewrite failed: %d\n", ret); } /* The case is no long dirty and the FLASH is no longer erased */ @@ -798,7 +798,7 @@ static ssize_t lpc43_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t ret = lpc43_pagewrite(priv, dest, buffer, nblocks << SPIFI_512SHIFT); if (ret < 0) { - fdbg("ERROR: lpc43_pagewrite failed: %d\n", ret); + ferr("ERROR: lpc43_pagewrite failed: %d\n", ret); return ret; } #endif @@ -1025,7 +1025,7 @@ static inline int lpc43_rominit(FAR struct lpc43_dev_s *priv) S_RCVCLK | S_FULLCLK, SCLK_MHZ); if (result != 0) { - fdbg("ERROR: SPIFI_INIT failed: %05x\n", result); + ferr("ERROR: SPIFI_INIT failed: %05x\n", result); /* Try again */ @@ -1033,7 +1033,7 @@ static inline int lpc43_rominit(FAR struct lpc43_dev_s *priv) S_RCVCLK | S_FULLCLK, SCLK_MHZ); if (result != 0) { - fdbg("ERROR: SPIFI_INIT failed: %05x\n", result); + ferr("ERROR: SPIFI_INIT failed: %05x\n", result); return -ENODEV; } } @@ -1201,7 +1201,7 @@ FAR struct mtd_dev_s *lpc43_spifi_initialize(void) { /* Allocation failed! Discard all of that work we just did and return NULL */ - fdbg("ERROR: Allocation failed\n"); + ferr("ERROR: Allocation failed\n"); return NULL; } #endif diff --git a/arch/arm/src/lpc43xx/lpc43_ssp.c b/arch/arm/src/lpc43xx/lpc43_ssp.c index 4767ac057f..ae66e5753f 100644 --- a/arch/arm/src/lpc43xx/lpc43_ssp.c +++ b/arch/arm/src/lpc43xx/lpc43_ssp.c @@ -76,7 +76,7 @@ */ #ifdef CONFIG_SSP_DEBUG -# define sspdbg llerr +# define ssperr llerr # ifdef CONFIG_SSP_VERBOSE # define spiinfo llerr # else @@ -84,7 +84,7 @@ # endif #else # undef CONFIG_SSP_VERBOSE -# define sspdbg(x...) +# define ssperr(x...) # define spiinfo(x...) #endif @@ -378,7 +378,7 @@ static uint32_t ssp_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) priv->frequency = frequency; priv->actual = actual; - sspdbg("Frequency %d->%d\n", frequency, actual); + ssperr("Frequency %d->%d\n", frequency, actual); return actual; } @@ -429,7 +429,7 @@ static void ssp_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) break; default: - sspdbg("Bad mode: %d\n", mode); + ssperr("Bad mode: %d\n", mode); DEBUGASSERT(FALSE); return; } @@ -517,7 +517,7 @@ static uint16_t ssp_send(FAR struct spi_dev_s *dev, uint16_t wd) /* Get the value from the RX FIFO and return it */ regval = ssp_getreg(priv, LPC43_SSP_DR_OFFSET); - sspdbg("%04x->%04x\n", wd, regval); + ssperr("%04x->%04x\n", wd, regval); return (uint16_t)regval; } @@ -564,7 +564,7 @@ static void ssp_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, /* While there is remaining to be sent (and no synchronization error has occurred) */ - sspdbg("nwords: %d\n", nwords); + ssperr("nwords: %d\n", nwords); tx.pv = txbuffer; rx.pv = rxbuffer; diff --git a/arch/arm/src/nuc1xx/nuc_irq.c b/arch/arm/src/nuc1xx/nuc_irq.c index 961d7c8405..ff4d6f0e61 100644 --- a/arch/arm/src/nuc1xx/nuc_irq.c +++ b/arch/arm/src/nuc1xx/nuc_irq.c @@ -128,7 +128,7 @@ static void nuc_dumpnvic(const char *msg, int irq) /**************************************************************************** * Name: nuc_nmi, nuc_busfault, nuc_usagefault, nuc_pendsv, - * nuc_dbgmonitor, nuc_pendsv, nuc_reserved + * nuc_errmonitor, nuc_pendsv, nuc_reserved * * Description: * Handlers for various execptions. None are handled and all are fatal @@ -141,7 +141,7 @@ static void nuc_dumpnvic(const char *msg, int irq) static int nuc_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -149,7 +149,7 @@ static int nuc_nmi(int irq, FAR void *context) static int nuc_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } @@ -157,7 +157,7 @@ static int nuc_pendsv(int irq, FAR void *context) static int nuc_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } diff --git a/arch/arm/src/sam34/sam4cm_freerun.c b/arch/arm/src/sam34/sam4cm_freerun.c index 429ae813c5..1b74144713 100644 --- a/arch/arm/src/sam34/sam4cm_freerun.c +++ b/arch/arm/src/sam34/sam4cm_freerun.c @@ -133,7 +133,7 @@ int sam_freerun_initialize(struct sam_freerun_s *freerun, int chan, ret = sam_tc_divisor(frequency, &divisor, &cmr); if (ret < 0) { - tcdbg("ERROR: sam_tc_divisor failed: %d\n", ret); + tcerr("ERROR: sam_tc_divisor failed: %d\n", ret); return ret; } @@ -172,7 +172,7 @@ int sam_freerun_initialize(struct sam_freerun_s *freerun, int chan, freerun->tch = sam_tc_allocate(chan, cmr); if (!freerun->tch) { - tcdbg("ERROR: Failed to allocate timer channel %d\n", chan); + tcerr("ERROR: Failed to allocate timer channel %d\n", chan); return -EBUSY; } diff --git a/arch/arm/src/sam34/sam4cm_oneshot.c b/arch/arm/src/sam34/sam4cm_oneshot.c index 79a668ee0f..6ce9858d4c 100644 --- a/arch/arm/src/sam34/sam4cm_oneshot.c +++ b/arch/arm/src/sam34/sam4cm_oneshot.c @@ -160,7 +160,7 @@ int sam_oneshot_initialize(struct sam_oneshot_s *oneshot, int chan, ret = sam_tc_divisor(frequency, &divisor, &cmr); if (ret < 0) { - tcdbg("ERROR: sam_tc_divisor failed: %d\n", ret); + tcerr("ERROR: sam_tc_divisor failed: %d\n", ret); return ret; } @@ -200,7 +200,7 @@ int sam_oneshot_initialize(struct sam_oneshot_s *oneshot, int chan, oneshot->tch = sam_tc_allocate(chan, cmr); if (!oneshot->tch) { - tcdbg("ERROR: Failed to allocate timer channel %d\n", chan); + tcerr("ERROR: Failed to allocate timer channel %d\n", chan); return -EBUSY; } diff --git a/arch/arm/src/sam34/sam4cm_tc.c b/arch/arm/src/sam34/sam4cm_tc.c index 9edcbe9d8c..5a7be95409 100644 --- a/arch/arm/src/sam34/sam4cm_tc.c +++ b/arch/arm/src/sam34/sam4cm_tc.c @@ -757,7 +757,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) { /* Timer/counter is not invalid or not enabled */ - tcdbg("ERROR: Bad channel number: %d\n", channel); + tcerr("ERROR: Bad channel number: %d\n", channel); return NULL; } @@ -770,7 +770,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) { /* Initialize the channel. */ - tcdbg("Initializing TC%d\n", chconfig->chan); + tcerr("Initializing TC%d\n", chconfig->chan); memset(chan, 0, sizeof(struct sam_chan_s)); sem_init(&chan->exclsem, 0, 1); @@ -831,7 +831,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) { /* No.. return a failure */ - tcdbg("Channel %d is in-used\n", channel); + tcerr("Channel %d is in-used\n", channel); sam_givesem(chan); return NULL; } @@ -1246,7 +1246,7 @@ int sam_tc_divisor(uint32_t frequency, uint32_t *div, uint32_t *tcclks) { /* If no divisor can be found, return -ERANGE */ - tcdbg("Lower bound search failed\n"); + tcerr("Lower bound search failed\n"); return -ERANGE; } } diff --git a/arch/arm/src/sam34/sam4cm_tc.h b/arch/arm/src/sam34/sam4cm_tc.h index 8476619aef..f3b32a1a6f 100644 --- a/arch/arm/src/sam34/sam4cm_tc.h +++ b/arch/arm/src/sam34/sam4cm_tc.h @@ -83,12 +83,12 @@ /* Timer/counter debug output */ #ifdef CONFIG_SAM34_TC_DEBUG -# define tcdbg dbg +# define tcerr err # define tcinfo info # define tcllerr llerr # define tcllinfo llinfo #else -# define tcdbg(x...) +# define tcerr(x...) # define tcinfo(x...) # define tcllerr(x...) # define tcllinfo(x...) diff --git a/arch/arm/src/sam34/sam_dmac.c b/arch/arm/src/sam34/sam_dmac.c index d3d2899286..7eb31148cb 100644 --- a/arch/arm/src/sam34/sam_dmac.c +++ b/arch/arm/src/sam34/sam_dmac.c @@ -1780,22 +1780,22 @@ void sam_dmadump(DMA_HANDLE handle, const struct sam_dmaregs_s *regs, { struct sam_dma_s *dmach = (struct sam_dma_s *)handle; - dmadbg("%s\n", msg); - dmadbg(" DMA Global Registers:\n"); - dmadbg(" GCFG[%08x]: %08x\n", SAM_DMAC_GCFG, regs->gcfg); - dmadbg(" EN[%08x]: %08x\n", SAM_DMAC_EN, regs->en); - dmadbg(" SREQ[%08x]: %08x\n", SAM_DMAC_SREQ, regs->sreq); - dmadbg(" CREQ[%08x]: %08x\n", SAM_DMAC_CREQ, regs->creq); - dmadbg(" LAST[%08x]: %08x\n", SAM_DMAC_LAST, regs->last); - dmadbg(" EBCIMR[%08x]: %08x\n", SAM_DMAC_EBCIMR, regs->ebcimr); - dmadbg(" CHSR[%08x]: %08x\n", SAM_DMAC_CHSR, regs->chsr); - dmadbg(" DMA Channel Registers:\n"); - dmadbg(" SADDR[%08x]: %08x\n", dmach->base + SAM_DMACHAN_SADDR_OFFSET, regs->saddr); - dmadbg(" DADDR[%08x]: %08x\n", dmach->base + SAM_DMACHAN_DADDR_OFFSET, regs->daddr); - dmadbg(" DSCR[%08x]: %08x\n", dmach->base + SAM_DMACHAN_DSCR_OFFSET, regs->dscr); - dmadbg(" CTRLA[%08x]: %08x\n", dmach->base + SAM_DMACHAN_CTRLA_OFFSET, regs->ctrla); - dmadbg(" CTRLB[%08x]: %08x\n", dmach->base + SAM_DMACHAN_CTRLB_OFFSET, regs->ctrlb); - dmadbg(" CFG[%08x]: %08x\n", dmach->base + SAM_DMACHAN_CFG_OFFSET, regs->cfg); + dmaerr("%s\n", msg); + dmaerr(" DMA Global Registers:\n"); + dmaerr(" GCFG[%08x]: %08x\n", SAM_DMAC_GCFG, regs->gcfg); + dmaerr(" EN[%08x]: %08x\n", SAM_DMAC_EN, regs->en); + dmaerr(" SREQ[%08x]: %08x\n", SAM_DMAC_SREQ, regs->sreq); + dmaerr(" CREQ[%08x]: %08x\n", SAM_DMAC_CREQ, regs->creq); + dmaerr(" LAST[%08x]: %08x\n", SAM_DMAC_LAST, regs->last); + dmaerr(" EBCIMR[%08x]: %08x\n", SAM_DMAC_EBCIMR, regs->ebcimr); + dmaerr(" CHSR[%08x]: %08x\n", SAM_DMAC_CHSR, regs->chsr); + dmaerr(" DMA Channel Registers:\n"); + dmaerr(" SADDR[%08x]: %08x\n", dmach->base + SAM_DMACHAN_SADDR_OFFSET, regs->saddr); + dmaerr(" DADDR[%08x]: %08x\n", dmach->base + SAM_DMACHAN_DADDR_OFFSET, regs->daddr); + dmaerr(" DSCR[%08x]: %08x\n", dmach->base + SAM_DMACHAN_DSCR_OFFSET, regs->dscr); + dmaerr(" CTRLA[%08x]: %08x\n", dmach->base + SAM_DMACHAN_CTRLA_OFFSET, regs->ctrla); + dmaerr(" CTRLB[%08x]: %08x\n", dmach->base + SAM_DMACHAN_CTRLB_OFFSET, regs->ctrlb); + dmaerr(" CFG[%08x]: %08x\n", dmach->base + SAM_DMACHAN_CFG_OFFSET, regs->cfg); } #endif /* CONFIG_DEBUG_DMA */ #endif /* CONFIG_SAM34_DMAC0 */ diff --git a/arch/arm/src/sam34/sam_hsmci.c b/arch/arm/src/sam34/sam_hsmci.c index 7b36cac7fb..f07fdf5be3 100644 --- a/arch/arm/src/sam34/sam_hsmci.c +++ b/arch/arm/src/sam34/sam_hsmci.c @@ -831,38 +831,38 @@ static void sam_hsmcisample(struct sam_hsmciregs_s *regs) #if defined(CONFIG_SAM34_HSMCI_XFRDEBUG) || defined(CONFIG_SAM34_HSMCI_CMDDEBUG) static void sam_hsmcidump(struct sam_hsmciregs_s *regs, const char *msg) { - fdbg("HSMCI Registers: %s\n", msg); - fdbg(" MR[%08x]: %08x\n", SAM_HSMCI_MR, regs->mr); - fdbg(" DTOR[%08x]: %08x\n", SAM_HSMCI_DTOR, regs->dtor); - fdbg(" SDCR[%08x]: %08x\n", SAM_HSMCI_SDCR, regs->sdcr); - fdbg(" ARGR[%08x]: %08x\n", SAM_HSMCI_ARGR, regs->argr); - fdbg(" BLKR[%08x]: %08x\n", SAM_HSMCI_BLKR, regs->blkr); - fdbg(" CSTOR[%08x]: %08x\n", SAM_HSMCI_CSTOR, regs->cstor); - fdbg(" RSPR0[%08x]: %08x\n", SAM_HSMCI_RSPR0, regs->rsp0); - fdbg(" RSPR1[%08x]: %08x\n", SAM_HSMCI_RSPR1, regs->rsp1); - fdbg(" RSPR2[%08x]: %08x\n", SAM_HSMCI_RSPR2, regs->rsp2); - fdbg(" RSPR3[%08x]: %08x\n", SAM_HSMCI_RSPR3, regs->rsp3); - fdbg(" SR[%08x]: %08x\n", SAM_HSMCI_SR, regs->sr); - fdbg(" IMR[%08x]: %08x\n", SAM_HSMCI_IMR, regs->imr); + ferr("HSMCI Registers: %s\n", msg); + ferr(" MR[%08x]: %08x\n", SAM_HSMCI_MR, regs->mr); + ferr(" DTOR[%08x]: %08x\n", SAM_HSMCI_DTOR, regs->dtor); + ferr(" SDCR[%08x]: %08x\n", SAM_HSMCI_SDCR, regs->sdcr); + ferr(" ARGR[%08x]: %08x\n", SAM_HSMCI_ARGR, regs->argr); + ferr(" BLKR[%08x]: %08x\n", SAM_HSMCI_BLKR, regs->blkr); + ferr(" CSTOR[%08x]: %08x\n", SAM_HSMCI_CSTOR, regs->cstor); + ferr(" RSPR0[%08x]: %08x\n", SAM_HSMCI_RSPR0, regs->rsp0); + ferr(" RSPR1[%08x]: %08x\n", SAM_HSMCI_RSPR1, regs->rsp1); + ferr(" RSPR2[%08x]: %08x\n", SAM_HSMCI_RSPR2, regs->rsp2); + ferr(" RSPR3[%08x]: %08x\n", SAM_HSMCI_RSPR3, regs->rsp3); + ferr(" SR[%08x]: %08x\n", SAM_HSMCI_SR, regs->sr); + ferr(" IMR[%08x]: %08x\n", SAM_HSMCI_IMR, regs->imr); #if defined(CONFIG_ARCH_CHIP_SAM3U) - fdbg(" DMA[%08x]: %08x\n", SAM_HSMCI_DMA, regs->dma); + ferr(" DMA[%08x]: %08x\n", SAM_HSMCI_DMA, regs->dma); #endif - fdbg(" CFG[%08x]: %08x\n", SAM_HSMCI_CFG, regs->cfg); - fdbg(" WPMR[%08x]: %08x\n", SAM_HSMCI_WPMR, regs->wpmr); - fdbg(" WPSR[%08x]: %08x\n", SAM_HSMCI_WPSR, regs->wpsr); + ferr(" CFG[%08x]: %08x\n", SAM_HSMCI_CFG, regs->cfg); + ferr(" WPMR[%08x]: %08x\n", SAM_HSMCI_WPMR, regs->wpmr); + ferr(" WPSR[%08x]: %08x\n", SAM_HSMCI_WPSR, regs->wpsr); #ifdef CONFIG_SAM34_PDCA - fdbg("HSMCI PDC Registers:\n"); - fdbg(" RPR[%08x]: %08x\n", SAM_HSMCI_PDC_RPR, regs->pdc_rpr); - fdbg(" RCR[%08x]: %08x\n", SAM_HSMCI_PDC_RCR, regs->pdc_rcr); - fdbg(" TPR[%08x]: %08x\n", SAM_HSMCI_PDC_TPR, regs->pdc_tpr); - fdbg(" TCR[%08x]: %08x\n", SAM_HSMCI_PDC_TCR, regs->pdc_tcr); - fdbg(" RNPR[%08x]: %08x\n", SAM_HSMCI_PDC_RNPR, regs->pdc_rnpr); - fdbg(" RNCR[%08x]: %08x\n", SAM_HSMCI_PDC_RNCR, regs->pdc_rncr); - fdbg(" TNPR[%08x]: %08x\n", SAM_HSMCI_PDC_TNPR, regs->pdc_tnpr); - fdbg(" TNCR[%08x]: %08x\n", SAM_HSMCI_PDC_TNCR, regs->pdc_tncr); -//fdbg(" TCR[%08x]: %08x\n", SAM_HSMCI_PDC_PTCR, regs->pdc_ptcr); - fdbg(" PTSR[%08x]: %08x\n", SAM_HSMCI_PDC_PTSR, regs->pdc_ptsr); + ferr("HSMCI PDC Registers:\n"); + ferr(" RPR[%08x]: %08x\n", SAM_HSMCI_PDC_RPR, regs->pdc_rpr); + ferr(" RCR[%08x]: %08x\n", SAM_HSMCI_PDC_RCR, regs->pdc_rcr); + ferr(" TPR[%08x]: %08x\n", SAM_HSMCI_PDC_TPR, regs->pdc_tpr); + ferr(" TCR[%08x]: %08x\n", SAM_HSMCI_PDC_TCR, regs->pdc_tcr); + ferr(" RNPR[%08x]: %08x\n", SAM_HSMCI_PDC_RNPR, regs->pdc_rnpr); + ferr(" RNCR[%08x]: %08x\n", SAM_HSMCI_PDC_RNCR, regs->pdc_rncr); + ferr(" TNPR[%08x]: %08x\n", SAM_HSMCI_PDC_TNPR, regs->pdc_tnpr); + ferr(" TNCR[%08x]: %08x\n", SAM_HSMCI_PDC_TNCR, regs->pdc_tncr); +//ferr(" TCR[%08x]: %08x\n", SAM_HSMCI_PDC_PTCR, regs->pdc_ptcr); + ferr(" PTSR[%08x]: %08x\n", SAM_HSMCI_PDC_PTSR, regs->pdc_ptsr); #endif } #endif @@ -1933,7 +1933,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { /* Yes.. Was the error some kind of timeout? */ - fdbg("ERROR: cmd: %08x events: %08x SR: %08x\n", + ferr("ERROR: cmd: %08x events: %08x SR: %08x\n", cmd, priv->cmdrmask, sr); if ((pending & HSMCI_RESPONSE_TIMEOUT_ERRORS) != 0) @@ -1963,7 +1963,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) } else if (--timeout <= 0) { - fdbg("ERROR: Timeout cmd: %08x events: %08x SR: %08x\n", + ferr("ERROR: Timeout cmd: %08x events: %08x SR: %08x\n", cmd, priv->cmdrmask, sr); priv->wkupevent = SDIOWAIT_TIMEOUT; @@ -2038,7 +2038,7 @@ static int sam_recvshort(FAR struct sdio_dev_s *dev, #ifdef CONFIG_DEBUG_FEATURES if (!rshort) { - fdbg("ERROR: rshort=NULL\n"); + ferr("ERROR: rshort=NULL\n"); ret = -EINVAL; } @@ -2050,7 +2050,7 @@ static int sam_recvshort(FAR struct sdio_dev_s *dev, (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R3_RESPONSE && (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R7_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2100,7 +2100,7 @@ static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlong if ((cmd & MMCSD_RESPONSE_MASK) != MMCSD_R2_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2282,7 +2282,7 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, 1, (uint32_t)priv); if (ret != OK) { - fdbg("ERROR: wd_start failed: %d\n", ret); + ferr("ERROR: wd_start failed: %d\n", ret); } } @@ -2472,7 +2472,7 @@ static int sam_dmarecvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, #ifdef CONFIG_SAM34_PDCA modifyreg32(SAM_HSMCI_MR, 0, HSMCI_MR_PDCMODE); - fdbg("SAM_HSMCI_MR = 0x%08X\n", getreg32(SAM_HSMCI_MR)); + ferr("SAM_HSMCI_MR = 0x%08X\n", getreg32(SAM_HSMCI_MR)); putreg32((uint32_t)buffer, SAM_HSMCI_PDC_RPR); putreg32(buflen/4, SAM_HSMCI_PDC_RCR); putreg32(PDC_PTCR_RXTEN, SAM_HSMCI_PDC_PTCR); @@ -2541,7 +2541,7 @@ static int sam_dmasendsetup(FAR struct sdio_dev_s *dev, #ifdef CONFIG_SAM34_PDCA modifyreg32(SAM_HSMCI_MR, 0, HSMCI_MR_PDCMODE); - fdbg("SAM_HSMCI_MR = 0x%08X\n", getreg32(SAM_HSMCI_MR)); + ferr("SAM_HSMCI_MR = 0x%08X\n", getreg32(SAM_HSMCI_MR)); putreg32((uint32_t)buffer, SAM_HSMCI_PDC_TPR); putreg32(buflen/4, SAM_HSMCI_PDC_TCR); putreg32(PDC_PTCR_TXTEN, SAM_HSMCI_PDC_PTCR); @@ -2663,7 +2663,7 @@ FAR struct sdio_dev_s *sdio_initialize(int slotno) struct sam_dev_s *priv = &g_sdiodev; - fdbg("slotno: %d\n", slotno); + ferr("slotno: %d\n", slotno); /* Initialize the HSMCI slot structure */ diff --git a/arch/arm/src/sam34/sam_irq.c b/arch/arm/src/sam34/sam_irq.c index d1a1de2407..3eee00dbdc 100644 --- a/arch/arm/src/sam34/sam_irq.c +++ b/arch/arm/src/sam34/sam_irq.c @@ -161,7 +161,7 @@ static void sam_dumpnvic(const char *msg, int irq) #endif /**************************************************************************** - * Name: sam_nmi, sam_busfault, sam_usagefault, sam_pendsv, sam_dbgmonitor, + * Name: sam_nmi, sam_busfault, sam_usagefault, sam_pendsv, sam_errmonitor, * sam_pendsv, sam_reserved * * Description: @@ -175,7 +175,7 @@ static void sam_dumpnvic(const char *msg, int irq) static int sam_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -183,7 +183,7 @@ static int sam_nmi(int irq, FAR void *context) static int sam_busfault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); + err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; } @@ -191,7 +191,7 @@ static int sam_busfault(int irq, FAR void *context) static int sam_usagefault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); + err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; } @@ -199,15 +199,15 @@ static int sam_usagefault(int irq, FAR void *context) static int sam_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } -static int sam_dbgmonitor(int irq, FAR void *context) +static int sam_errmonitor(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Debug Monitor received\n"); + err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; } @@ -215,7 +215,7 @@ static int sam_dbgmonitor(int irq, FAR void *context) static int sam_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } @@ -464,7 +464,7 @@ void up_irqinitialize(void) irq_attach(SAM_IRQ_BUSFAULT, sam_busfault); irq_attach(SAM_IRQ_USAGEFAULT, sam_usagefault); irq_attach(SAM_IRQ_PENDSV, sam_pendsv); - irq_attach(SAM_IRQ_DBGMONITOR, sam_dbgmonitor); + irq_attach(SAM_IRQ_DBGMONITOR, sam_errmonitor); irq_attach(SAM_IRQ_RESERVED, sam_reserved); #endif diff --git a/arch/arm/src/sam34/sam_rtc.c b/arch/arm/src/sam34/sam_rtc.c index 39a9c7b111..698a9df295 100644 --- a/arch/arm/src/sam34/sam_rtc.c +++ b/arch/arm/src/sam34/sam_rtc.c @@ -89,12 +89,12 @@ /* Debug ****************************************************************************/ #ifdef CONFIG_DEBUG_RTC -# define rtcdbg dbg +# define rtcerr err # define rtcinfo info # define rtcllerr llerr # define rtcllinfo llinfo #else -# define rtcdbg(x...) +# define rtcerr(x...) # define rtcinfo(x...) # define rtcllerr(x...) # define rtcllinfo(x...) diff --git a/arch/arm/src/sam34/sam_rtt.c b/arch/arm/src/sam34/sam_rtt.c index f5f8b7e822..e2972e00ba 100644 --- a/arch/arm/src/sam34/sam_rtt.c +++ b/arch/arm/src/sam34/sam_rtt.c @@ -81,10 +81,10 @@ */ #ifdef CONFIG_DEBUG_RTT -# define rttdbg llerr +# define rtterr llerr # define rttinfo llinfo #else -# define rttdbg(x...) +# define rtterr(x...) # define rttinfo(x...) #endif @@ -537,7 +537,7 @@ static int sam34_settimeout(FAR struct timer_lowerhalf_s *lower, if (timeout < 1 || timeout > RTT_MAXTIMEOUT) { - rttdbg("Cannot represent timeout=%lu > %lu\n", + rtterr("Cannot represent timeout=%lu > %lu\n", timeout, RTT_MAXTIMEOUT); return -ERANGE; } diff --git a/arch/arm/src/sam34/sam_spi.c b/arch/arm/src/sam34/sam_spi.c index 80c2b3dc2c..04860eb4bf 100644 --- a/arch/arm/src/sam34/sam_spi.c +++ b/arch/arm/src/sam34/sam_spi.c @@ -148,14 +148,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -1076,7 +1076,7 @@ static uint32_t spi_setfrequency(struct spi_dev_s *dev, uint32_t frequency) spics->frequency = frequency; spics->actual = actual; - spidbg("Frequency %d->%d\n", frequency, actual); + spierr("Frequency %d->%d\n", frequency, actual); return actual; } @@ -1543,7 +1543,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, ret = sam_dmarxsetup(spics->rxdma, regaddr, memaddr, nwords); if (ret < 0) { - dmadbg("ERROR: sam_dmarxsetup failed: %d\n", ret); + dmaerr("ERROR: sam_dmarxsetup failed: %d\n", ret); return; } @@ -1557,7 +1557,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, ret = sam_dmatxsetup(spics->txdma, regaddr, memaddr, nwords); if (ret < 0) { - dmadbg("ERROR: sam_dmatxsetup failed: %d\n", ret); + dmaerr("ERROR: sam_dmatxsetup failed: %d\n", ret); return; } @@ -1569,7 +1569,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, ret = sam_dmastart(spics->rxdma, spi_rxcallback, (void *)spics); if (ret < 0) { - dmadbg("ERROR: RX sam_dmastart failed: %d\n", ret); + dmaerr("ERROR: RX sam_dmastart failed: %d\n", ret); return; } @@ -1578,7 +1578,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, ret = sam_dmastart(spics->txdma, spi_txcallback, (void *)spics); if (ret < 0) { - dmadbg("ERROR: RX sam_dmastart failed: %d\n", ret); + dmaerr("ERROR: RX sam_dmastart failed: %d\n", ret); sam_dmastop(spics->rxdma); return; } @@ -1600,7 +1600,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, (wdentry_t)spi_dmatimeout, 1, (uint32_t)spics); if (ret != OK) { - spidbg("ERROR: wd_start failed: %d\n", ret); + spierr("ERROR: wd_start failed: %d\n", ret); } /* Wait for the DMA complete */ @@ -1651,7 +1651,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, if (spics->result) { - spidbg("ERROR: DMA failed with result: %d\n", spics->result); + spierr("ERROR: DMA failed with result: %d\n", spics->result); } } #endif /* CONFIG_SAM34_SPI_DMA */ @@ -1764,7 +1764,7 @@ struct spi_dev_s *sam_spibus_initialize(int port) spics = (struct sam_spics_s *)zalloc(sizeof(struct sam_spics_s)); if (!spics) { - spidbg("ERROR: Failed to allocate a chip select structure\n"); + spierr("ERROR: Failed to allocate a chip select structure\n"); return NULL; } @@ -1787,7 +1787,7 @@ struct spi_dev_s *sam_spibus_initialize(int port) spics->rxdma = sam_dmachannel(0); if (!spics->rxdma) { - spidbg("ERROR: Failed to allocate the RX DMA channel\n"); + spierr("ERROR: Failed to allocate the RX DMA channel\n"); spics->candma = false; } } @@ -1797,7 +1797,7 @@ struct spi_dev_s *sam_spibus_initialize(int port) spics->txdma = sam_dmachannel(0); if (!spics->txdma) { - spidbg("ERROR: Failed to allocate the TX DMA channel\n"); + spierr("ERROR: Failed to allocate the TX DMA channel\n"); sam_dmafree(spics->rxdma); spics->rxdma = NULL; spics->candma = false; diff --git a/arch/arm/src/sam34/sam_tc.c b/arch/arm/src/sam34/sam_tc.c index f16894f788..d18da143a3 100644 --- a/arch/arm/src/sam34/sam_tc.c +++ b/arch/arm/src/sam34/sam_tc.c @@ -79,10 +79,10 @@ */ #ifdef CONFIG_DEBUG_TIMER -# define tcdbg llerr +# define tcerr llerr # define tcinfo llinfo #else -# define tcdbg(x...) +# define tcerr(x...) # define tcinfo(x...) #endif @@ -486,7 +486,7 @@ static int sam34_settimeout(FAR struct timer_lowerhalf_s *lower, if (timeout < 1 || timeout > TC_MAXTIMEOUT) { - tcdbg("Cannot represent timeout=%lu > %lu\n", + tcerr("Cannot represent timeout=%lu > %lu\n", timeout, TC_MAXTIMEOUT); return -ERANGE; } diff --git a/arch/arm/src/sam34/sam_twi.c b/arch/arm/src/sam34/sam_twi.c index 6a720f181c..dcf324770b 100644 --- a/arch/arm/src/sam34/sam_twi.c +++ b/arch/arm/src/sam34/sam_twi.c @@ -99,12 +99,12 @@ /* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */ #ifdef CONFIG_DEBUG_I2C -# define i2cdbg dbg +# define i2cerr err # define i2cinfo info # define i2cllerr llerr # define i2cllinfo llinfo #else -# define i2cdbg(x...) +# define i2cerr(x...) # define i2cinfo(x...) # define i2cllerr(x...) # define i2cllinfo(x...) @@ -742,7 +742,7 @@ static int twi_transfer(FAR struct i2c_master_s *dev, ret = twi_wait(priv); if (ret < 0) { - i2cdbg("ERROR: Transfer failed: %d\n", ret); + i2cerr("ERROR: Transfer failed: %d\n", ret); } leave_critical_section(flags); @@ -985,7 +985,7 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) #endif { leave_critical_section(flags); - i2cdbg("ERROR: Unsupported bus: TWI%d\n", bus); + i2cerr("ERROR: Unsupported bus: TWI%d\n", bus); return NULL; } diff --git a/arch/arm/src/sam34/sam_wdt.c b/arch/arm/src/sam34/sam_wdt.c index 37ae65e5bf..8fc5abf70c 100644 --- a/arch/arm/src/sam34/sam_wdt.c +++ b/arch/arm/src/sam34/sam_wdt.c @@ -88,10 +88,10 @@ */ #ifdef CONFIG_DEBUG_WATCHDOG -# define wddbg llerr +# define wderr llerr # define wdinfo llinfo #else -# define wddbg(x...) +# define wderr(x...) # define wdinfo(x...) #endif @@ -477,7 +477,7 @@ static int sam34_settimeout(FAR struct watchdog_lowerhalf_s *lower, if (timeout < 1 || timeout > WDT_MAXTIMEOUT) { - wddbg("Cannot represent timeout=%d > %d\n", + wderr("Cannot represent timeout=%d > %d\n", timeout, WDT_MAXTIMEOUT); return -ERANGE; } diff --git a/arch/arm/src/sama5/sam_adc.c b/arch/arm/src/sama5/sam_adc.c index e92091db05..35bb4ea9fe 100644 --- a/arch/arm/src/sama5/sam_adc.c +++ b/arch/arm/src/sama5/sam_adc.c @@ -1285,7 +1285,7 @@ static int sam_adc_settimer(struct sam_adc_s *priv, uint32_t frequency, ret = sam_tc_divisor(frequency, &div, &tcclks); if (ret < 0) { - adbg("ERROR: sam_tc_divisor failed: %d\n", ret); + aerr("ERROR: sam_tc_divisor failed: %d\n", ret); return ret; } @@ -1304,7 +1304,7 @@ static int sam_adc_settimer(struct sam_adc_s *priv, uint32_t frequency, priv->tc = sam_tc_allocate(channel, mode); if (!priv->tc) { - adbg("ERROR: Failed to allocate channel %d mode %08x\n", channel, mode); + aerr("ERROR: Failed to allocate channel %d mode %08x\n", channel, mode); return -EINVAL; } @@ -1436,7 +1436,7 @@ static int sam_adc_trigger(struct sam_adc_s *priv) #endif if (ret < 0) { - adbg("ERROR: sam_adc_settimer failed: %d\n", ret); + aerr("ERROR: sam_adc_settimer failed: %d\n", ret); return ret; } @@ -2056,7 +2056,7 @@ struct adc_dev_s *sam_adc_initialize(void) } else { - adbg("ERROR: Cannot realize ADC input frequency\n"); + aerr("ERROR: Cannot realize ADC input frequency\n"); return NULL; } @@ -2108,7 +2108,7 @@ struct adc_dev_s *sam_adc_initialize(void) ret = irq_attach(SAM_IRQ_ADC, sam_adc_interrupt); if (ret < 0) { - adbg("ERROR: Failed to attach IRQ %d: %d\n", SAM_IRQ_ADC, ret); + aerr("ERROR: Failed to attach IRQ %d: %d\n", SAM_IRQ_ADC, ret); return NULL; } diff --git a/arch/arm/src/sama5/sam_can.c b/arch/arm/src/sama5/sam_can.c index bda4b8b4dc..d563f8d0f3 100644 --- a/arch/arm/src/sama5/sam_can.c +++ b/arch/arm/src/sama5/sam_can.c @@ -127,12 +127,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -722,7 +722,7 @@ static int can_recvsetup(FAR struct sam_can_s *priv) mbndx = can_mballoc(priv); if (mbndx < 0) { - candbg("ERROR: Failed to allocate mailbox %d: %d\n", mbno, mbndx); + canerr("ERROR: Failed to allocate mailbox %d: %d\n", mbno, mbndx); return mbndx; } @@ -1119,7 +1119,7 @@ static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) mbndx = can_mballoc(priv); if (mbndx < 0) { - candbg("ERROR: CAN%d failed to allocate a mailbox: %d\n", + canerr("ERROR: CAN%d failed to allocate a mailbox: %d\n", priv->config->port, mbndx); return mbndx; } @@ -1708,7 +1708,7 @@ static int can_bittiming(struct sam_can_s *priv) { /* The BRP field must be within the range 1 - 0x7f */ - candbg("CAN%d: baud %d too high\n", config->port, config->baud); + canerr("CAN%d: baud %d too high\n", config->port, config->baud); return -EINVAL; } @@ -1756,7 +1756,7 @@ static int can_bittiming(struct sam_can_s *priv) if ((propag + phase1 + phase2) != (uint32_t)(tq - 4)) { - candbg("CAN%d: Could not realize baud %d\n", config->port, config->baud); + canerr("CAN%d: Could not realize baud %d\n", config->port, config->baud); return -EINVAL; } @@ -1890,7 +1890,7 @@ static int can_hwinitialize(struct sam_can_s *priv) } else { - candbg("ERROR: Cannot realize CAN input frequency\n"); + canerr("ERROR: Cannot realize CAN input frequency\n"); return -EINVAL; } @@ -1912,7 +1912,7 @@ static int can_hwinitialize(struct sam_can_s *priv) ret = can_bittiming(priv); if (ret < 0) { - candbg("ERROR: Failed to set bit timing: %d\n", ret); + canerr("ERROR: Failed to set bit timing: %d\n", ret); return ret; } @@ -1922,7 +1922,7 @@ static int can_hwinitialize(struct sam_can_s *priv) ret = can_autobaud(priv); if (ret < 0) { - candbg("ERROR: can_autobaud failed: %d\n", ret); + canerr("ERROR: can_autobaud failed: %d\n", ret); return ret; } #endif @@ -1999,7 +1999,7 @@ FAR struct can_dev_s *sam_caninitialize(int port) else #endif { - candbg("ERROR: Unsupported port %d\n", port); + canerr("ERROR: Unsupported port %d\n", port); return NULL; } diff --git a/arch/arm/src/sama5/sam_dmac.c b/arch/arm/src/sama5/sam_dmac.c index 794cac2373..db6bad2ce6 100644 --- a/arch/arm/src/sama5/sam_dmac.c +++ b/arch/arm/src/sama5/sam_dmac.c @@ -657,7 +657,7 @@ static uint8_t sam_channel(uint8_t pid, const struct sam_pidmap_s *table, } } - dmadbg("No channel found for pid %d\n", pid); + dmaerr("No channel found for pid %d\n", pid); DEBUGPANIC(); return 0x3f; } @@ -2002,7 +2002,7 @@ DMA_HANDLE sam_dmachannel(uint8_t dmacno, uint32_t chflags) #endif { - dmadbg("ERROR: Bad DMAC number: %d\n", dmacno); + dmaerr("ERROR: Bad DMAC number: %d\n", dmacno); DEBUGPANIC(); return (DMA_HANDLE)NULL; } @@ -2051,7 +2051,7 @@ DMA_HANDLE sam_dmachannel(uint8_t dmacno, uint32_t chflags) } else { - dmadbg("ERROR: Failed allocate DMAC%d channel\n", (int)dmacno); + dmaerr("ERROR: Failed allocate DMAC%d channel\n", (int)dmacno); } return (DMA_HANDLE)dmach; @@ -2414,27 +2414,27 @@ void sam_dmadump(DMA_HANDLE handle, const struct sam_dmaregs_s *regs, struct sam_dmach_s *dmach = (struct sam_dmach_s *)handle; struct sam_dmac_s *dmac = sam_controller(dmach); - dmadbg("%s\n", msg); - dmadbg(" DMA Global Registers:\n"); - dmadbg(" GCFG[%08x]: %08x\n", dmac->base + SAM_DMAC_GCFG_OFFSET, regs->gcfg); - dmadbg(" EN[%08x]: %08x\n", dmac->base + SAM_DMAC_EN_OFFSET, regs->en); - dmadbg(" SREQ[%08x]: %08x\n", dmac->base + SAM_DMAC_SREQ_OFFSET, regs->sreq); - dmadbg(" CREQ[%08x]: %08x\n", dmac->base + SAM_DMAC_CREQ_OFFSET, regs->creq); - dmadbg(" LAST[%08x]: %08x\n", dmac->base + SAM_DMAC_LAST_OFFSET, regs->last); - dmadbg(" EBCIMR[%08x]: %08x\n", dmac->base + SAM_DMAC_EBCIMR_OFFSET, regs->ebcimr); - dmadbg(" EBCISR[%08x]: %08x\n", dmac->base + SAM_DMAC_EBCISR_OFFSET, regs->ebcisr); - dmadbg(" CHSR[%08x]: %08x\n", dmac->base + SAM_DMAC_CHSR_OFFSET, regs->chsr); - dmadbg(" WPMR[%08x]: %08x\n", dmac->base + SAM_DMAC_WPMR_OFFSET, regs->wpmr); - dmadbg(" WPSR[%08x]: %08x\n", dmac->base + SAM_DMAC_WPSR_OFFSET, regs->wpsr); - dmadbg(" DMA Channel Registers:\n"); - dmadbg(" SADDR[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_SADDR_OFFSET, regs->saddr); - dmadbg(" DADDR[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_DADDR_OFFSET, regs->daddr); - dmadbg(" DSCR[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_DSCR_OFFSET, regs->dscr); - dmadbg(" CTRLA[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_CTRLA_OFFSET, regs->ctrla); - dmadbg(" CTRLB[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_CTRLB_OFFSET, regs->ctrlb); - dmadbg(" CFG[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_CFG_OFFSET, regs->cfg); - dmadbg(" SPIP[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_SPIP_OFFSET, regs->spip); - dmadbg(" DPIP[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_DPIP_OFFSET, regs->dpip); + dmaerr("%s\n", msg); + dmaerr(" DMA Global Registers:\n"); + dmaerr(" GCFG[%08x]: %08x\n", dmac->base + SAM_DMAC_GCFG_OFFSET, regs->gcfg); + dmaerr(" EN[%08x]: %08x\n", dmac->base + SAM_DMAC_EN_OFFSET, regs->en); + dmaerr(" SREQ[%08x]: %08x\n", dmac->base + SAM_DMAC_SREQ_OFFSET, regs->sreq); + dmaerr(" CREQ[%08x]: %08x\n", dmac->base + SAM_DMAC_CREQ_OFFSET, regs->creq); + dmaerr(" LAST[%08x]: %08x\n", dmac->base + SAM_DMAC_LAST_OFFSET, regs->last); + dmaerr(" EBCIMR[%08x]: %08x\n", dmac->base + SAM_DMAC_EBCIMR_OFFSET, regs->ebcimr); + dmaerr(" EBCISR[%08x]: %08x\n", dmac->base + SAM_DMAC_EBCISR_OFFSET, regs->ebcisr); + dmaerr(" CHSR[%08x]: %08x\n", dmac->base + SAM_DMAC_CHSR_OFFSET, regs->chsr); + dmaerr(" WPMR[%08x]: %08x\n", dmac->base + SAM_DMAC_WPMR_OFFSET, regs->wpmr); + dmaerr(" WPSR[%08x]: %08x\n", dmac->base + SAM_DMAC_WPSR_OFFSET, regs->wpsr); + dmaerr(" DMA Channel Registers:\n"); + dmaerr(" SADDR[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_SADDR_OFFSET, regs->saddr); + dmaerr(" DADDR[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_DADDR_OFFSET, regs->daddr); + dmaerr(" DSCR[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_DSCR_OFFSET, regs->dscr); + dmaerr(" CTRLA[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_CTRLA_OFFSET, regs->ctrla); + dmaerr(" CTRLB[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_CTRLB_OFFSET, regs->ctrlb); + dmaerr(" CFG[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_CFG_OFFSET, regs->cfg); + dmaerr(" SPIP[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_SPIP_OFFSET, regs->spip); + dmaerr(" DPIP[%08x]: %08x\n", dmach->base + SAM_DMAC_CH_DPIP_OFFSET, regs->dpip); } #endif /* CONFIG_DEBUG_DMA */ #endif /* CONFIG_SAMA5_DMAC0 || CONFIG_SAMA5_DMAC1 */ diff --git a/arch/arm/src/sama5/sam_ehci.c b/arch/arm/src/sama5/sam_ehci.c index 7773652fc3..9dc19e57ab 100644 --- a/arch/arm/src/sama5/sam_ehci.c +++ b/arch/arm/src/sama5/sam_ehci.c @@ -1275,11 +1275,11 @@ static int sam_qh_flush(struct sam_qh_s *qh) #ifdef CONFIG_SAMA5_EHCI_REGDEBUG static void sam_qtd_print(struct sam_qtd_s *qtd) { - udbg(" QTD[%p]:\n", qtd); - udbg(" hw:\n"); - udbg(" nqp: %08x alt: %08x token: %08x\n", + uerr(" QTD[%p]:\n", qtd); + uerr(" hw:\n"); + uerr(" nqp: %08x alt: %08x token: %08x\n", qtd->hw.nqp, qtd->hw.alt, qtd->hw.token); - udbg(" bpl: %08x %08x %08x %08x %08x\n", + uerr(" bpl: %08x %08x %08x %08x %08x\n", qtd->hw.bpl[0], qtd->hw.bpl[1], qtd->hw.bpl[2], qtd->hw.bpl[3], qtd->hw.bpl[4]); } @@ -1299,29 +1299,29 @@ static void sam_qh_print(struct sam_qh_s *qh) struct sam_epinfo_s *epinfo; struct ehci_overlay_s *overlay; - udbg("QH[%p]:\n", qh); - udbg(" hw:\n"); - udbg(" hlp: %08x epchar: %08x epcaps: %08x cqp: %08x\n", + uerr("QH[%p]:\n", qh); + uerr(" hw:\n"); + uerr(" hlp: %08x epchar: %08x epcaps: %08x cqp: %08x\n", qh->hw.hlp, qh->hw.epchar, qh->hw.epcaps, qh->hw.cqp); overlay = &qh->hw.overlay; - udbg(" overlay:\n"); - udbg(" nqp: %08x alt: %08x token: %08x\n", + uerr(" overlay:\n"); + uerr(" nqp: %08x alt: %08x token: %08x\n", overlay->nqp, overlay->alt, overlay->token); - udbg(" bpl: %08x %08x %08x %08x %08x\n", + uerr(" bpl: %08x %08x %08x %08x %08x\n", overlay->bpl[0], overlay->bpl[1], overlay->bpl[2], overlay->bpl[3], overlay->bpl[4]); - udbg(" fqp:\n", qh->fqp); + uerr(" fqp:\n", qh->fqp); epinfo = qh->epinfo; - udbg(" epinfo[%p]:\n", epinfo); + uerr(" epinfo[%p]:\n", epinfo); if (epinfo) { - udbg(" EP%d DIR=%s FA=%08x TYPE=%d MaxPacket=%d\n", + uerr(" EP%d DIR=%s FA=%08x TYPE=%d MaxPacket=%d\n", epinfo->epno, epinfo->dirin ? "IN" : "OUT", epinfo->devaddr, epinfo->xfrtype, epinfo->maxpacket); - udbg(" Toggle=%d iocwait=%d speed=%d result=%d\n", + uerr(" Toggle=%d iocwait=%d speed=%d result=%d\n", epinfo->toggle, epinfo->iocwait, epinfo->speed, epinfo->result); } } @@ -4042,7 +4042,7 @@ static int sam_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0, ret = sam_async_setup(rhport, ep0info, req, buffer, len); if (ret < 0) { - udbg("ERROR: sam_async_setup failed: %d\n", ret); + uerr("ERROR: sam_async_setup failed: %d\n", ret); goto errout_with_iocwait; } @@ -4160,7 +4160,7 @@ static ssize_t sam_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, if (ret < 0) { - udbg("ERROR: Transfer setup failed: %d\n", ret); + uerr("ERROR: Transfer setup failed: %d\n", ret); goto errout_with_iocwait; } diff --git a/arch/arm/src/sama5/sam_emaca.c b/arch/arm/src/sama5/sam_emaca.c index 5f263b8b69..86d0b5ffa1 100644 --- a/arch/arm/src/sama5/sam_emaca.c +++ b/arch/arm/src/sama5/sam_emaca.c @@ -2996,7 +2996,7 @@ static int sam_phyinit(struct sam_emac_s *priv) mck = BOARD_MCK_FREQUENCY; if (mck > (160*1000*1000)) { - ndbg("ERROR: Cannot realize PHY clock\n"); + nerr("ERROR: Cannot realize PHY clock\n"); return -EINVAL; } else if (mck > (80*1000*1000)) @@ -3501,7 +3501,7 @@ int sam_emac_initialize(void) priv->txpoll = wd_create(); if (!priv->txpoll) { - ndbg("ERROR: Failed to create periodic poll timer\n"); + nerr("ERROR: Failed to create periodic poll timer\n"); ret = -EAGAIN; goto errout; } @@ -3509,7 +3509,7 @@ int sam_emac_initialize(void) priv->txtimeout = wd_create(); /* Create TX timeout timer */ if (!priv->txtimeout) { - ndbg("ERROR: Failed to create periodic poll timer\n"); + nerr("ERROR: Failed to create periodic poll timer\n"); ret = -EAGAIN; goto errout_with_txpoll; } @@ -3523,7 +3523,7 @@ int sam_emac_initialize(void) ret = sam_buffer_initialize(priv); if (ret < 0) { - ndbg("ERROR: sam_buffer_initialize failed: %d\n", ret); + nerr("ERROR: sam_buffer_initialize failed: %d\n", ret); goto errout_with_txtimeout; } @@ -3534,7 +3534,7 @@ int sam_emac_initialize(void) ret = irq_attach(SAM_IRQ_EMAC, sam_emac_interrupt); if (ret < 0) { - ndbg("ERROR: Failed to attach the handler to the IRQ%d\n", SAM_IRQ_EMAC); + nerr("ERROR: Failed to attach the handler to the IRQ%d\n", SAM_IRQ_EMAC); goto errout_with_buffers; } @@ -3547,7 +3547,7 @@ int sam_emac_initialize(void) ret = sam_ifdown(&priv->dev); if (ret < 0) { - ndbg("ERROR: Failed to put the interface in the down state: %d\n", ret); + nerr("ERROR: Failed to put the interface in the down state: %d\n", ret); goto errout_with_buffers; } @@ -3559,7 +3559,7 @@ int sam_emac_initialize(void) return ret; } - ndbg("ERROR: netdev_register() failed: %d\n", ret); + nerr("ERROR: netdev_register() failed: %d\n", ret); errout_with_buffers: sam_buffer_free(priv); diff --git a/arch/arm/src/sama5/sam_emacb.c b/arch/arm/src/sama5/sam_emacb.c index 5452e8d0f8..f36722abb8 100644 --- a/arch/arm/src/sama5/sam_emacb.c +++ b/arch/arm/src/sama5/sam_emacb.c @@ -2377,12 +2377,12 @@ static int sam_ifup(struct net_driver_s *dev) int ret; #ifdef CONFIG_NET_IPv4 - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); #endif #ifdef CONFIG_NET_IPv6 - ndbg("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + nerr("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2], dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5], dev->d_ipv6addr[6], dev->d_ipv6addr[7]); @@ -3198,7 +3198,7 @@ static int sam_phyintenable(struct sam_emac_s *priv) else #endif { - ndbg("ERROR: Unsupported PHY type: %d\n", priv->phytype); + nerr("ERROR: Unsupported PHY type: %d\n", priv->phytype); ret = -ENOSYS; } @@ -3869,7 +3869,7 @@ static int sam_phyinit(struct sam_emac_s *priv) mck = BOARD_MCK_FREQUENCY; if (mck > (160*1000*1000)) { - ndbg("ERROR: Cannot realize PHY clock\n"); + nerr("ERROR: Cannot realize PHY clock\n"); return -EINVAL; } else if (mck > (80*1000*1000)) @@ -4545,7 +4545,7 @@ int sam_emac_initialize(int intf) else #endif { - ndbg("ERROR: Interface %d not supported\n", intf); + nerr("ERROR: Interface %d not supported\n", intf); return -EINVAL; } @@ -4574,7 +4574,7 @@ int sam_emac_initialize(int intf) priv->txpoll = wd_create(); if (!priv->txpoll) { - ndbg("ERROR: Failed to create periodic poll timer\n"); + nerr("ERROR: Failed to create periodic poll timer\n"); ret = -EAGAIN; goto errout; } @@ -4582,7 +4582,7 @@ int sam_emac_initialize(int intf) priv->txtimeout = wd_create(); /* Create TX timeout timer */ if (!priv->txtimeout) { - ndbg("ERROR: Failed to create periodic poll timer\n"); + nerr("ERROR: Failed to create periodic poll timer\n"); ret = -EAGAIN; goto errout_with_txpoll; } @@ -4596,7 +4596,7 @@ int sam_emac_initialize(int intf) ret = sam_buffer_initialize(priv); if (ret < 0) { - ndbg("ERROR: sam_buffer_initialize failed: %d\n", ret); + nerr("ERROR: sam_buffer_initialize failed: %d\n", ret); goto errout_with_txtimeout; } @@ -4607,7 +4607,7 @@ int sam_emac_initialize(int intf) ret = irq_attach(priv->attr->irq, priv->attr->handler); if (ret < 0) { - ndbg("ERROR: Failed to attach the handler to the IRQ%d\n", priv->attr->irq); + nerr("ERROR: Failed to attach the handler to the IRQ%d\n", priv->attr->irq); goto errout_with_buffers; } @@ -4620,7 +4620,7 @@ int sam_emac_initialize(int intf) ret = sam_ifdown(&priv->dev); if (ret < 0) { - ndbg("ERROR: Failed to put the interface in the down state: %d\n", ret); + nerr("ERROR: Failed to put the interface in the down state: %d\n", ret); goto errout_with_buffers; } @@ -4632,7 +4632,7 @@ int sam_emac_initialize(int intf) return ret; } - ndbg("ERROR: netdev_register() failed: %d\n", ret); + nerr("ERROR: netdev_register() failed: %d\n", ret); errout_with_buffers: sam_buffer_free(priv); diff --git a/arch/arm/src/sama5/sam_freerun.c b/arch/arm/src/sama5/sam_freerun.c index 0828660151..dfc5f7a62b 100644 --- a/arch/arm/src/sama5/sam_freerun.c +++ b/arch/arm/src/sama5/sam_freerun.c @@ -150,7 +150,7 @@ int sam_freerun_initialize(struct sam_freerun_s *freerun, int chan, ret = sam_tc_divisor(frequency, &divisor, &cmr); if (ret < 0) { - tcdbg("ERROR: sam_tc_divisor failed: %d\n", ret); + tcerr("ERROR: sam_tc_divisor failed: %d\n", ret); return ret; } @@ -189,7 +189,7 @@ int sam_freerun_initialize(struct sam_freerun_s *freerun, int chan, freerun->tch = sam_tc_allocate(chan, cmr); if (!freerun->tch) { - tcdbg("ERROR: Failed to allocate timer channel %d\n", chan); + tcerr("ERROR: Failed to allocate timer channel %d\n", chan); return -EBUSY; } diff --git a/arch/arm/src/sama5/sam_hsmci.c b/arch/arm/src/sama5/sam_hsmci.c index b33eaa9c6a..5bb44bec4d 100644 --- a/arch/arm/src/sama5/sam_hsmci.c +++ b/arch/arm/src/sama5/sam_hsmci.c @@ -1003,23 +1003,23 @@ static void sam_hsmcisample(struct sam_dev_s *priv, static void sam_hsmcidump(struct sam_dev_s *priv, struct sam_hsmciregs_s *regs, const char *msg) { - fdbg("HSMCI Registers: %s\n", msg); - fdbg(" MR[%08x]: %08x\n", priv->base + SAM_HSMCI_MR_OFFSET, regs->mr); - fdbg(" DTOR[%08x]: %08x\n", priv->base + SAM_HSMCI_DTOR_OFFSET, regs->dtor); - fdbg(" SDCR[%08x]: %08x\n", priv->base + SAM_HSMCI_SDCR_OFFSET, regs->sdcr); - fdbg(" ARGR[%08x]: %08x\n", priv->base + SAM_HSMCI_ARGR_OFFSET, regs->argr); - fdbg(" BLKR[%08x]: %08x\n", priv->base + SAM_HSMCI_BLKR_OFFSET, regs->blkr); - fdbg(" CSTOR[%08x]: %08x\n", priv->base + SAM_HSMCI_CSTOR_OFFSET, regs->cstor); - fdbg(" RSPR0[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR0_OFFSET, regs->rsp0); - fdbg(" RSPR1[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR1_OFFSET, regs->rsp1); - fdbg(" RSPR2[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR2_OFFSET, regs->rsp2); - fdbg(" RSPR3[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR3_OFFSET, regs->rsp3); - fdbg(" SR[%08x]: %08x\n", priv->base + SAM_HSMCI_SR_OFFSET, regs->sr); - fdbg(" IMR[%08x]: %08x\n", priv->base + SAM_HSMCI_IMR_OFFSET, regs->imr); - fdbg(" DMA[%08x]: %08x\n", priv->base + SAM_HSMCI_DMA_OFFSET, regs->dma); - fdbg(" CFG[%08x]: %08x\n", priv->base + SAM_HSMCI_CFG_OFFSET, regs->cfg); - fdbg(" WPMR[%08x]: %08x\n", priv->base + SAM_HSMCI_WPMR_OFFSET, regs->wpmr); - fdbg(" WPSR[%08x]: %08x\n", priv->base + SAM_HSMCI_WPSR_OFFSET, regs->wpsr); + ferr("HSMCI Registers: %s\n", msg); + ferr(" MR[%08x]: %08x\n", priv->base + SAM_HSMCI_MR_OFFSET, regs->mr); + ferr(" DTOR[%08x]: %08x\n", priv->base + SAM_HSMCI_DTOR_OFFSET, regs->dtor); + ferr(" SDCR[%08x]: %08x\n", priv->base + SAM_HSMCI_SDCR_OFFSET, regs->sdcr); + ferr(" ARGR[%08x]: %08x\n", priv->base + SAM_HSMCI_ARGR_OFFSET, regs->argr); + ferr(" BLKR[%08x]: %08x\n", priv->base + SAM_HSMCI_BLKR_OFFSET, regs->blkr); + ferr(" CSTOR[%08x]: %08x\n", priv->base + SAM_HSMCI_CSTOR_OFFSET, regs->cstor); + ferr(" RSPR0[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR0_OFFSET, regs->rsp0); + ferr(" RSPR1[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR1_OFFSET, regs->rsp1); + ferr(" RSPR2[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR2_OFFSET, regs->rsp2); + ferr(" RSPR3[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR3_OFFSET, regs->rsp3); + ferr(" SR[%08x]: %08x\n", priv->base + SAM_HSMCI_SR_OFFSET, regs->sr); + ferr(" IMR[%08x]: %08x\n", priv->base + SAM_HSMCI_IMR_OFFSET, regs->imr); + ferr(" DMA[%08x]: %08x\n", priv->base + SAM_HSMCI_DMA_OFFSET, regs->dma); + ferr(" CFG[%08x]: %08x\n", priv->base + SAM_HSMCI_CFG_OFFSET, regs->cfg); + ferr(" WPMR[%08x]: %08x\n", priv->base + SAM_HSMCI_WPMR_OFFSET, regs->wpmr); + ferr(" WPSR[%08x]: %08x\n", priv->base + SAM_HSMCI_WPSR_OFFSET, regs->wpsr); } #endif @@ -1093,7 +1093,7 @@ static void sam_xfrdumpone(struct sam_dev_s *priv, int index, } else { - fdbg("%s: Not collected\n", msg); + ferr("%s: Not collected\n", msg); } } #endif @@ -2253,7 +2253,7 @@ static int sam_sendsetup(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer, { /* Some fatal error has occurred */ - fdbg("ERROR: sr %08x\n", sr); + ferr("ERROR: sr %08x\n", sr); return -EIO; } else if ((sr & HSMCI_INT_TXRDY) != 0) @@ -2388,7 +2388,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { /* Yes.. Was the error some kind of timeout? */ - fdbg("ERROR: cmd: %08x events: %08x SR: %08x\n", + ferr("ERROR: cmd: %08x events: %08x SR: %08x\n", cmd, priv->cmdrmask, sr); if ((pending & HSMCI_RESPONSE_TIMEOUT_ERRORS) != 0) @@ -2418,7 +2418,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) } else if (--timeout <= 0) { - fdbg("ERROR: Timeout cmd: %08x events: %08x SR: %08x\n", + ferr("ERROR: Timeout cmd: %08x events: %08x SR: %08x\n", cmd, priv->cmdrmask, sr); priv->wkupevent = SDIOWAIT_TIMEOUT; @@ -2493,7 +2493,7 @@ static int sam_recvshort(FAR struct sdio_dev_s *dev, #ifdef CONFIG_DEBUG_FEATURES if (!rshort) { - fdbg("ERROR: rshort=NULL\n"); + ferr("ERROR: rshort=NULL\n"); ret = -EINVAL; } @@ -2505,7 +2505,7 @@ static int sam_recvshort(FAR struct sdio_dev_s *dev, (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R3_RESPONSE && (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R7_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2555,7 +2555,7 @@ static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlong if ((cmd & MMCSD_RESPONSE_MASK) != MMCSD_R2_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2746,7 +2746,7 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, 1, (uint32_t)priv); if (ret != OK) { - fdbg("ERROR: wd_start failed: %d\n", ret); + ferr("ERROR: wd_start failed: %d\n", ret); } } @@ -3150,7 +3150,7 @@ static void sam_callback(void *arg) { /* NOTE: Currently, work_cancel only returns success */ - fdbg("ERROR: Failed to cancel work: %d\n", ret); + ferr("ERROR: Failed to cancel work: %d\n", ret); } fllinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); @@ -3160,7 +3160,7 @@ static void sam_callback(void *arg) { /* NOTE: Currently, work_queue only returns success */ - fdbg("ERROR: Failed to schedule work: %d\n", ret); + ferr("ERROR: Failed to schedule work: %d\n", ret); } } @@ -3199,7 +3199,7 @@ FAR struct sdio_dev_s *sdio_initialize(int slotno) * for now, an* HSMCI peripheral does correspond to a slot. */ - fdbg("slotno: %d\n", slotno); + ferr("slotno: %d\n", slotno); #ifdef CONFIG_SAMA5_HSMCI0 if (slotno == 0) diff --git a/arch/arm/src/sama5/sam_lcd.c b/arch/arm/src/sama5/sam_lcd.c index fe5b77b568..b1a0fd9760 100644 --- a/arch/arm/src/sama5/sam_lcd.c +++ b/arch/arm/src/sama5/sam_lcd.c @@ -1108,7 +1108,7 @@ static int sam_base_getvideoinfo(struct fb_vtable_s *vtable, return OK; } - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } @@ -1130,7 +1130,7 @@ static int sam_base_getplaneinfo(struct fb_vtable_s *vtable, int planeno, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -1186,7 +1186,7 @@ static int sam_hcr_getcursor(struct fb_vtable_s *vtable, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } #endif @@ -1226,7 +1226,7 @@ static int sam_hcr_setcursor(struct fb_vtable_s *vtable, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } #endif @@ -1391,7 +1391,7 @@ static int sam_setclut(struct sam_layer_s *layer, if (offset >= SAM_LCDC_NCLUT) { - gdbg("ERROR: CLUT offset is out of range: %d\n", offset); + gerr("ERROR: CLUT offset is out of range: %d\n", offset); return -EINVAL; } diff --git a/arch/arm/src/sama5/sam_memories.c b/arch/arm/src/sama5/sam_memories.c index 231545ed55..d6b18aa792 100644 --- a/arch/arm/src/sama5/sam_memories.c +++ b/arch/arm/src/sama5/sam_memories.c @@ -766,7 +766,7 @@ uintptr_t sam_physregaddr(uintptr_t virtregaddr) * address */ - dbg("Bad virtual address: %08lx\n", virtregaddr); + err("Bad virtual address: %08lx\n", virtregaddr); DEBUGPANIC(); return virtregaddr; } @@ -925,7 +925,7 @@ uintptr_t sam_physramaddr(uintptr_t virtramaddr) if (virtramaddr != 0) { - dbg("Bad virtual address: %08lx\n", virtramaddr); + err("Bad virtual address: %08lx\n", virtramaddr); DEBUGPANIC(); } @@ -1058,7 +1058,7 @@ uintptr_t sam_virtramaddr(uintptr_t physramaddr) if (physramaddr != 0) { - dbg("Bad physical address: %08lx\n|", physramaddr); + err("Bad physical address: %08lx\n|", physramaddr); DEBUGPANIC(); } diff --git a/arch/arm/src/sama5/sam_nand.c b/arch/arm/src/sama5/sam_nand.c index bb8b63645a..425120b8d3 100644 --- a/arch/arm/src/sama5/sam_nand.c +++ b/arch/arm/src/sama5/sam_nand.c @@ -1325,7 +1325,7 @@ static int nand_dma_read(struct sam_nandcs_s *priv, ret = sam_dmarxsetup(priv->dma, psrc, pdest, nbytes); if (ret < 0) { - fdbg("ERROR: sam_dmarxsetup failed: %d\n", ret); + ferr("ERROR: sam_dmarxsetup failed: %d\n", ret); return ret; } @@ -1344,7 +1344,7 @@ static int nand_dma_read(struct sam_nandcs_s *priv, ret = nand_wait_dma(priv); if (ret < 0) { - fdbg("ERROR: DMA failed: %d\n", ret); + ferr("ERROR: DMA failed: %d\n", ret); } nand_dma_sample(priv, DMA_END_TRANSFER); @@ -1410,7 +1410,7 @@ static int nand_dma_write(struct sam_nandcs_s *priv, ret = sam_dmatxsetup(priv->dma, pdest, psrc, nbytes); if (ret < 0) { - fdbg("ERROR: sam_dmatxsetup failed: %d\n", ret); + ferr("ERROR: sam_dmatxsetup failed: %d\n", ret); return ret; } @@ -1429,7 +1429,7 @@ static int nand_dma_write(struct sam_nandcs_s *priv, ret = nand_wait_dma(priv); if (ret < 0) { - fdbg("ERROR: DMA failed: %d\n", ret); + ferr("ERROR: DMA failed: %d\n", ret); } nand_dma_sample(priv, DMA_END_TRANSFER); @@ -1655,7 +1655,7 @@ static int nand_read_pmecc(struct sam_nandcs_s *priv, off_t block, break; default: - fdbg("ERROR: Unsupported page size: %d\n", pagesize); + ferr("ERROR: Unsupported page size: %d\n", pagesize); return -EINVAL; } @@ -1719,7 +1719,7 @@ static int nand_read_pmecc(struct sam_nandcs_s *priv, off_t block, #endif if (ret < 0) { - fdbg("ERROR: nand_read for data region failed: %d\n", ret); + ferr("ERROR: nand_read for data region failed: %d\n", ret); return ret; } @@ -1732,7 +1732,7 @@ static int nand_read_pmecc(struct sam_nandcs_s *priv, off_t block, #endif if (ret < 0) { - fdbg("ERROR: nand_read for spare region failed: %d\n", ret); + ferr("ERROR: nand_read for spare region failed: %d\n", ret); return ret; } @@ -1957,7 +1957,7 @@ static int nand_readpage_noecc(struct sam_nandcs_s *priv, off_t block, break; default: - fdbg("ERROR: Unsupported page size: %d\n", pagesize); + ferr("ERROR: Unsupported page size: %d\n", pagesize); return -EINVAL; } @@ -1987,7 +1987,7 @@ static int nand_readpage_noecc(struct sam_nandcs_s *priv, off_t block, ret = nand_nfcsram_read(priv, (uint8_t *)data, pagesize, 0); if (ret < 0) { - fdbg("ERROR: nand_nfcsram_read for data region failed: %d\n", ret); + ferr("ERROR: nand_nfcsram_read for data region failed: %d\n", ret); return ret; } } @@ -2003,7 +2003,7 @@ static int nand_readpage_noecc(struct sam_nandcs_s *priv, off_t block, ret = nand_nfcsram_read(priv, (uint8_t *)spare, sparesize, offset); if (ret < 0) { - fdbg("ERROR: nand_nfcsram_read for spare region failed: %d\n", ret); + ferr("ERROR: nand_nfcsram_read for spare region failed: %d\n", ret); return ret; } } @@ -2049,7 +2049,7 @@ static int nand_readpage_pmecc(struct sam_nandcs_s *priv, off_t block, ret = pmecc_configure(priv, false); if (ret < 0) { - fdbg("ERROR: pmecc_configure failed: %d\n", ret); + ferr("ERROR: pmecc_configure failed: %d\n", ret); goto errout; } @@ -2060,7 +2060,7 @@ static int nand_readpage_pmecc(struct sam_nandcs_s *priv, off_t block, ret = nand_read_pmecc(priv, block, page, data); if (ret < 0) { - fdbg("ERROR: Block %d page %d Failed to read page\n", + ferr("ERROR: Block %d page %d Failed to read page\n", block, page, ret); goto errout; } @@ -2076,7 +2076,7 @@ static int nand_readpage_pmecc(struct sam_nandcs_s *priv, off_t block, ret = nand_readpage_noecc(priv, block, page, NULL, priv->raw.spare); if (ret < 0) { - fdbg("ERROR: Block %d page %d Failed to re-read spare area: %d\n", + ferr("ERROR: Block %d page %d Failed to re-read spare area: %d\n", block, page, ret); goto errout; } @@ -2098,13 +2098,13 @@ static int nand_readpage_pmecc(struct sam_nandcs_s *priv, off_t block, { /* Yes.. clear sector errors */ - fdbg("Block=%d page=%d has been erased: %08x\n", + ferr("Block=%d page=%d has been erased: %08x\n", block, page, regval); regval = 0; } else { - fdbg("ERROR: block=%d page=%d Corrupted sectors: %08x\n", + ferr("ERROR: block=%d page=%d Corrupted sectors: %08x\n", block, page, regval); } } @@ -2114,7 +2114,7 @@ static int nand_readpage_pmecc(struct sam_nandcs_s *priv, off_t block, ret = pmecc_correction(regval, (uintptr_t)data); if (ret < 0) { - fdbg("ERROR: block=%d page=%d Unrecoverable data error: %d\n", + ferr("ERROR: block=%d page=%d Unrecoverable data error: %d\n", block, page, ret); } @@ -2191,7 +2191,7 @@ static int nand_writepage_noecc(struct sam_nandcs_s *priv, off_t block, break; default: - fdbg("ERROR: Unsupported page size: %d\n", pagesize); + ferr("ERROR: Unsupported page size: %d\n", pagesize); return -EINVAL; } @@ -2220,7 +2220,7 @@ static int nand_writepage_noecc(struct sam_nandcs_s *priv, off_t block, ret = nand_nfcsram_write(priv, (uint8_t *)data, pagesize, 0); if (ret < 0) { - fdbg("ERROR: nand_nfcsram_write for data region failed: %d\n", ret); + ferr("ERROR: nand_nfcsram_write for data region failed: %d\n", ret); return ret; } @@ -2229,7 +2229,7 @@ static int nand_writepage_noecc(struct sam_nandcs_s *priv, off_t block, ret = nand_nfcsram_write(priv, (uint8_t *)spare, sparesize, pagesize); if (ret < 0) { - fdbg("ERROR: nand_nfcsram_write for data region failed: %d\n", ret); + ferr("ERROR: nand_nfcsram_write for data region failed: %d\n", ret); return ret; } } @@ -2257,7 +2257,7 @@ static int nand_writepage_noecc(struct sam_nandcs_s *priv, off_t block, ret = nand_operation_complete(priv); if (ret < 0) { - fdbg("ERROR: Failed writing data area: %d\n", ret); + ferr("ERROR: Failed writing data area: %d\n", ret); } } @@ -2272,7 +2272,7 @@ static int nand_writepage_noecc(struct sam_nandcs_s *priv, off_t block, ret = nand_write(priv, (uint8_t *)spare, sparesize, 0); if (ret < 0) { - fdbg("ERROR: nand_write for spare region failed: %d\n", ret); + ferr("ERROR: nand_write for spare region failed: %d\n", ret); ret = -EPERM; } @@ -2331,7 +2331,7 @@ static int nand_writepage_pmecc(struct sam_nandcs_s *priv, off_t block, ret = pmecc_configure(priv, false); if (ret < 0) { - fdbg("ERROR: pmecc_configure failed: %d\n", ret); + ferr("ERROR: pmecc_configure failed: %d\n", ret); goto errout; } @@ -2352,7 +2352,7 @@ static int nand_writepage_pmecc(struct sam_nandcs_s *priv, off_t block, ret = nand_nfcsram_write(priv, (uint8_t *)data, pagesize, 0); if (ret < 0) { - fdbg("ERROR: Block %d page %d nand_nfcsram_write for data region failed: %d\n", + ferr("ERROR: Block %d page %d nand_nfcsram_write for data region failed: %d\n", block, page, ret); goto errout; } @@ -2417,7 +2417,7 @@ static int nand_writepage_pmecc(struct sam_nandcs_s *priv, off_t block, ret = nand_write(priv, (uint8_t *)data, pagesize, 0); if (ret < 0) { - fdbg("ERROR: Block %d page %d nand_write for data region failed: %d\n", + ferr("ERROR: Block %d page %d nand_write for data region failed: %d\n", block, page, ret); goto errout; } @@ -2474,7 +2474,7 @@ static int nand_writepage_pmecc(struct sam_nandcs_s *priv, off_t block, ret = nand_write(priv, (uint8_t *)g_nand.ecctab, eccsize, 0); if (ret < 0) { - fdbg("ERROR: Block %d page %d nand_write for spare region failed: %d\n", + ferr("ERROR: Block %d page %d nand_write for spare region failed: %d\n", block, page, ret); goto errout; } @@ -2487,7 +2487,7 @@ static int nand_writepage_pmecc(struct sam_nandcs_s *priv, off_t block, ret = nand_operation_complete(priv); if (ret < 0) { - fdbg("ERROR: Block %d page %d Failed writing data area: %d\n", + ferr("ERROR: Block %d page %d Failed writing data area: %d\n", block, page, ret); } @@ -2536,7 +2536,7 @@ static inline int nand_tryeraseblock(struct sam_nandcs_s *priv, off_t block) ret = nand_operation_complete(priv); if (ret < 0) { - fdbg("ERROR: Block %d Could not erase: %d\n", block, ret); + ferr("ERROR: Block %d Could not erase: %d\n", block, ret); } return ret; @@ -2572,7 +2572,7 @@ static int nand_eraseblock(struct nand_raw_s *raw, off_t block) retries--; } - fdbg("ERROR: Block %d Failed to erase after %d tries\n", + ferr("ERROR: Block %d Failed to erase after %d tries\n", (int)block, NAND_ERASE_NRETRIES); nand_unlock(); @@ -2923,7 +2923,7 @@ struct mtd_dev_s *sam_nand_initialize(int cs) else #endif { - fdbg("ERROR: CS%d unsupported or invalid\n", cs); + ferr("ERROR: CS%d unsupported or invalid\n", cs); return NULL; } @@ -2983,7 +2983,7 @@ struct mtd_dev_s *sam_nand_initialize(int cs) ret = irq_attach(SAM_IRQ_HSMC, hsmc_interrupt); if (ret < 0) { - fdbg("Failed to attach HSMC IRQ (%d)", SAM_IRQ_HSMC); + ferr("Failed to attach HSMC IRQ (%d)", SAM_IRQ_HSMC); return NULL; } #endif @@ -3013,7 +3013,7 @@ struct mtd_dev_s *sam_nand_initialize(int cs) ret = board_nandflash_config(cs); if (ret < 0) { - fdbg("ERROR: board_nandflash_config failed for CS%d: %d\n", + ferr("ERROR: board_nandflash_config failed for CS%d: %d\n", cs, ret); return NULL; } @@ -3029,7 +3029,7 @@ struct mtd_dev_s *sam_nand_initialize(int cs) mtd = nand_initialize(&priv->raw); if (!mtd) { - fdbg("ERROR: CS%d nand_initialize failed %d\n", cs); + ferr("ERROR: CS%d nand_initialize failed %d\n", cs); return NULL; } @@ -3043,7 +3043,7 @@ struct mtd_dev_s *sam_nand_initialize(int cs) priv->dma = sam_dmachannel(NAND_DMAC, 0); if (!priv->dma) { - fdbg("ERROR: Failed to allocate the DMA channel for CS%d\n", cs); + ferr("ERROR: Failed to allocate the DMA channel for CS%d\n", cs); } #endif diff --git a/arch/arm/src/sama5/sam_ohci.c b/arch/arm/src/sama5/sam_ohci.c index 1dd7dcb9eb..9996dd18f8 100644 --- a/arch/arm/src/sama5/sam_ohci.c +++ b/arch/arm/src/sama5/sam_ohci.c @@ -3342,7 +3342,7 @@ static ssize_t sam_transfer(struct usbhost_driver_s *drvr, usbhost_ep_t ep, ret = sam_transfer_common(rhport, eplist, buffer, buflen); if (ret < 0) { - udbg("ERROR: sam_transfer_common failed: %d\n", ret); + uerr("ERROR: sam_transfer_common failed: %d\n", ret); goto errout; } @@ -3593,7 +3593,7 @@ static int sam_asynch(struct usbhost_driver_s *drvr, usbhost_ep_t ep, ret = sam_transfer_common(rhport, eplist, buffer, buflen); if (ret < 0) { - udbg("ERROR: sam_transfer_common failed: %d\n", ret); + uerr("ERROR: sam_transfer_common failed: %d\n", ret); goto errout; } diff --git a/arch/arm/src/sama5/sam_oneshot.c b/arch/arm/src/sama5/sam_oneshot.c index cb53ea11f7..62872ea4dd 100644 --- a/arch/arm/src/sama5/sam_oneshot.c +++ b/arch/arm/src/sama5/sam_oneshot.c @@ -177,7 +177,7 @@ int sam_oneshot_initialize(struct sam_oneshot_s *oneshot, int chan, ret = sam_tc_divisor(frequency, &divisor, &cmr); if (ret < 0) { - tcdbg("ERROR: sam_tc_divisor failed: %d\n", ret); + tcerr("ERROR: sam_tc_divisor failed: %d\n", ret); return ret; } @@ -217,7 +217,7 @@ int sam_oneshot_initialize(struct sam_oneshot_s *oneshot, int chan, oneshot->tch = sam_tc_allocate(chan, cmr); if (!oneshot->tch) { - tcdbg("ERROR: Failed to allocate timer channel %d\n", chan); + tcerr("ERROR: Failed to allocate timer channel %d\n", chan); return -EBUSY; } diff --git a/arch/arm/src/sama5/sam_pck.c b/arch/arm/src/sama5/sam_pck.c index 11202c5d56..9b7e406a38 100644 --- a/arch/arm/src/sama5/sam_pck.c +++ b/arch/arm/src/sama5/sam_pck.c @@ -151,7 +151,7 @@ uint32_t sam_pck_configure(enum pckid_e pckid, enum pckid_clksrc_e clksrc, break; default: - dbg("ERROR: Unknown clock source\n"); + err("ERROR: Unknown clock source\n"); return 0; } @@ -213,8 +213,8 @@ uint32_t sam_pck_configure(enum pckid_e pckid, enum pckid_clksrc_e clksrc, } else { - sdbg("ERROR: frequency cannot be realized.\n"); - sdbg(" frequency=%lu clkin=%lu\n", + serr("ERROR: frequency cannot be realized.\n"); + serr(" frequency=%lu clkin=%lu\n", (unsigned long)frequency, (unsigned long)clkin); return 0; } diff --git a/arch/arm/src/sama5/sam_pmecc.c b/arch/arm/src/sama5/sam_pmecc.c index c1f42478a3..d055d0b6b3 100644 --- a/arch/arm/src/sama5/sam_pmecc.c +++ b/arch/arm/src/sama5/sam_pmecc.c @@ -632,7 +632,7 @@ static uint32_t pmecc_errorcorrection(uintptr_t sectorbase, if (bytepos < sectorsz + nand_getreg(SAM_HSMC_PMECCSADDR)) { - fdbg("Correct error bit @[Byte %d, Bit %d]\n", + ferr("Correct error bit @[Byte %d, Bit %d]\n", (int)bytepos, (int)bitpos); if (*(uint8_t *)(sectorbase + bytepos) & (1 << bitpos)) @@ -870,7 +870,7 @@ static int pmecc_pagelayout(uint16_t datasize, uint16_t eccsize) bcherr512 = pmecc_bcherr512(nsectors512, eccsize); if (bcherr512 < 0) { - fdbg("WARNING: Cannot realize 512B sectors\n"); + ferr("WARNING: Cannot realize 512B sectors\n"); } else { @@ -895,7 +895,7 @@ static int pmecc_pagelayout(uint16_t datasize, uint16_t eccsize) if (bcherr1k < 0) { - fdbg("WARNING: Cannot realize 1KB sectors\n"); + ferr("WARNING: Cannot realize 1KB sectors\n"); } else { @@ -1059,7 +1059,7 @@ int pmecc_configure(struct sam_nandcs_s *priv, bool protected) ret = pmecc_pagelayout(priv->raw.model.pagesize, eccsize); if (ret < 0) { - fdbg("ERROR: pmecc_pagelayout failed: %d\n", ret); + ferr("ERROR: pmecc_pagelayout failed: %d\n", ret); return ret; } @@ -1114,7 +1114,7 @@ int pmecc_configure(struct sam_nandcs_s *priv, bool protected) g_pmecc.desc.pagesize = HSMC_PMECCFG_PAGESIZE_8SEC; break; default: - fdbg("ERROR: Unsupported sectors per page: %d\n", sectorsperpage); + ferr("ERROR: Unsupported sectors per page: %d\n", sectorsperpage); return -EINVAL; } @@ -1148,7 +1148,7 @@ int pmecc_configure(struct sam_nandcs_s *priv, bool protected) if (g_pmecc.desc.eccend > priv->raw.model.sparesize) { - fdbg("ERROR: No room for ECC in spare bytes %d > %d\n", + ferr("ERROR: No room for ECC in spare bytes %d > %d\n", g_pmecc.desc.eccend, priv->raw.model.sparesize); return -ENOSPC; diff --git a/arch/arm/src/sama5/sam_pwm.c b/arch/arm/src/sama5/sam_pwm.c index aacfc21f6c..ea53643377 100644 --- a/arch/arm/src/sama5/sam_pwm.c +++ b/arch/arm/src/sama5/sam_pwm.c @@ -401,7 +401,7 @@ #endif #ifdef CONFIG_DEBUG_PWM -# define pwmdbg dbg +# define pwmerr err # define pwmllerr llerr # ifdef CONFIG_DEBUG_INFO # define pwminfo info @@ -411,7 +411,7 @@ # define pwmllinfo(x...) # endif #else -# define pwmdbg(x...) +# define pwmerr(x...) # define pwmllerr(x...) # define pwminfo(x...) # define pwmllinfo(x...) @@ -1124,7 +1124,7 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev, #endif default: - pwmdbg("ERROR: Invalid or unsupported clock source value: %d\n", chan->clksrc); + pwmerr("ERROR: Invalid or unsupported clock source value: %d\n", chan->clksrc); return -EINVAL; } @@ -1336,7 +1336,7 @@ FAR struct pwm_lowerhalf_s *sam_pwminitialize(int channel) #endif default: - pwmdbg("ERROR: Channel invalid or not configured: %d\n", channel); + pwmerr("ERROR: Channel invalid or not configured: %d\n", channel); return NULL; } @@ -1366,7 +1366,7 @@ FAR struct pwm_lowerhalf_s *sam_pwminitialize(int channel) ret = irq_attach(SAM_IRQ_PWM, pwm_interrupt); if (ret < 0) { - pwmdbg("ERROR: Failed to attach IRQ%d\n", channel); + pwmerr("ERROR: Failed to attach IRQ%d\n", channel); return NULL; } diff --git a/arch/arm/src/sama5/sam_rtc.c b/arch/arm/src/sama5/sam_rtc.c index d195cbc329..06fe78d4b1 100644 --- a/arch/arm/src/sama5/sam_rtc.c +++ b/arch/arm/src/sama5/sam_rtc.c @@ -86,12 +86,12 @@ /* Debug ****************************************************************************/ #ifdef CONFIG_DEBUG_RTC -# define rtcdbg dbg +# define rtcerr err # define rtcinfo info # define rtcllerr llerr # define rtcllinfo llinfo #else -# define rtcdbg(x...) +# define rtcerr(x...) # define rtcinfo(x...) # define rtcllerr(x...) # define rtcllinfo(x...) diff --git a/arch/arm/src/sama5/sam_spi.c b/arch/arm/src/sama5/sam_spi.c index e3cd70944d..920257f79f 100644 --- a/arch/arm/src/sama5/sam_spi.c +++ b/arch/arm/src/sama5/sam_spi.c @@ -141,14 +141,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -1065,7 +1065,7 @@ static uint32_t spi_setfrequency(struct spi_dev_s *dev, uint32_t frequency) spics->frequency = frequency; spics->actual = actual; - spidbg("Frequency %d->%d\n", frequency, actual); + spierr("Frequency %d->%d\n", frequency, actual); return actual; } @@ -1476,7 +1476,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, ret = sam_dmarxsetup(spics->rxdma, paddr, maddr, nwords); if (ret < 0) { - dmadbg("ERROR: sam_dmarxsetup failed: %d\n", ret); + dmaerr("ERROR: sam_dmarxsetup failed: %d\n", ret); return; } @@ -1488,7 +1488,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, ret = sam_dmatxsetup(spics->txdma, paddr, maddr, nwords); if (ret < 0) { - dmadbg("ERROR: sam_dmatxsetup failed: %d\n", ret); + dmaerr("ERROR: sam_dmatxsetup failed: %d\n", ret); return; } @@ -1500,7 +1500,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, ret = sam_dmastart(spics->rxdma, spi_rxcallback, (void *)spics); if (ret < 0) { - dmadbg("ERROR: RX sam_dmastart failed: %d\n", ret); + dmaerr("ERROR: RX sam_dmastart failed: %d\n", ret); return; } @@ -1509,7 +1509,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, ret = sam_dmastart(spics->txdma, spi_txcallback, (void *)spics); if (ret < 0) { - dmadbg("ERROR: RX sam_dmastart failed: %d\n", ret); + dmaerr("ERROR: RX sam_dmastart failed: %d\n", ret); sam_dmastop(spics->rxdma); return; } @@ -1531,7 +1531,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, (wdentry_t)spi_dmatimeout, 1, (uint32_t)spics); if (ret != OK) { - spidbg("ERROR: wd_start failed: %d\n", ret); + spierr("ERROR: wd_start failed: %d\n", ret); } /* Wait for the DMA complete */ @@ -1582,7 +1582,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, if (spics->result) { - spidbg("ERROR: DMA failed with result: %d\n", spics->result); + spierr("ERROR: DMA failed with result: %d\n", spics->result); } } #endif /* CONFIG_SAMA5_SPI_DMA */ @@ -1692,7 +1692,7 @@ struct spi_dev_s *sam_spibus_initialize(int port) spics = (struct sam_spics_s *)zalloc(sizeof(struct sam_spics_s)); if (!spics) { - spidbg("ERROR: Failed to allocate a chip select structure\n"); + spierr("ERROR: Failed to allocate a chip select structure\n"); return NULL; } @@ -1715,7 +1715,7 @@ struct spi_dev_s *sam_spibus_initialize(int port) spics->rxdma = sam_dmachannel(spino, 0); if (!spics->rxdma) { - spidbg("ERROR: Failed to allocate the RX DMA channel\n"); + spierr("ERROR: Failed to allocate the RX DMA channel\n"); spics->candma = false; } } @@ -1725,7 +1725,7 @@ struct spi_dev_s *sam_spibus_initialize(int port) spics->txdma = sam_dmachannel(spino, 0); if (!spics->txdma) { - spidbg("ERROR: Failed to allocate the TX DMA channel\n"); + spierr("ERROR: Failed to allocate the TX DMA channel\n"); sam_dmafree(spics->rxdma); spics->rxdma = NULL; spics->candma = false; diff --git a/arch/arm/src/sama5/sam_ssc.c b/arch/arm/src/sama5/sam_ssc.c index 8fdf222e04..61b790ad04 100644 --- a/arch/arm/src/sama5/sam_ssc.c +++ b/arch/arm/src/sama5/sam_ssc.c @@ -414,16 +414,16 @@ #endif #ifdef CONFIG_DEBUG_I2S -# define i2sdbg dbg +# define i2serr err # define i2sllerr llerr # ifdef CONFIG_DEBUG_INFO -# define i2sinfo dbg +# define i2sinfo err # define i2sllinfo llerr # else # define i2sinfo(x...) # endif #else -# define i2sdbg(x...) +# define i2serr(x...) # define i2sllerr(x...) # define i2sinfo(x...) # define i2sllinfo(x...) @@ -2077,7 +2077,7 @@ static int ssc_checkwidth(struct sam_ssc_s *priv, int bits) break; default: - i2sdbg("ERROR: Unsupported or invalid data width: %d\n", bits); + i2serr("ERROR: Unsupported or invalid data width: %d\n", bits); return (bits < 2 || bits > 32) ? -EINVAL : -ENOSYS; } @@ -2155,7 +2155,7 @@ static uint32_t ssc_rxdatawidth(struct i2s_dev_s *dev, int bits) ret = ssc_checkwidth(priv, bits); if (ret < 0) { - i2sdbg("ERROR: ssc_checkwidth failed: %d\n", ret); + i2serr("ERROR: ssc_checkwidth failed: %d\n", ret); return 0; } @@ -2164,7 +2164,7 @@ static uint32_t ssc_rxdatawidth(struct i2s_dev_s *dev, int bits) ret = ssc_dma_flags(priv, &dmaflags); if (ret < 0) { - i2sdbg("ERROR: ssc_dma_flags failed: %d\n", ret); + i2serr("ERROR: ssc_dma_flags failed: %d\n", ret); return 0; } @@ -2253,7 +2253,7 @@ static int ssc_receive(struct i2s_dev_s *dev, struct ap_buffer_s *apb, if (!priv->rxenab) { - i2sdbg("ERROR: SSC%d has no receiver\n", priv->sscno); + i2serr("ERROR: SSC%d has no receiver\n", priv->sscno); ret = -EAGAIN; goto errout_with_exclsem; } @@ -2292,7 +2292,7 @@ errout_with_exclsem: return ret; #else - i2sdbg("ERROR: SSC%d has no receiver\n", priv->sscno); + i2serr("ERROR: SSC%d has no receiver\n", priv->sscno); UNUSED(priv); return -ENOSYS; #endif @@ -2366,7 +2366,7 @@ static uint32_t ssc_txdatawidth(struct i2s_dev_s *dev, int bits) ret = ssc_checkwidth(priv, bits); if (ret < 0) { - i2sdbg("ERROR: ssc_checkwidth failed: %d\n", ret); + i2serr("ERROR: ssc_checkwidth failed: %d\n", ret); return 0; } @@ -2375,7 +2375,7 @@ static uint32_t ssc_txdatawidth(struct i2s_dev_s *dev, int bits) ret = ssc_dma_flags(priv, &dmaflags); if (ret < 0) { - i2sdbg("ERROR: ssc_dma_flags failed: %d\n", ret); + i2serr("ERROR: ssc_dma_flags failed: %d\n", ret); return 0; } @@ -2470,7 +2470,7 @@ static int ssc_send(struct i2s_dev_s *dev, struct ap_buffer_s *apb, if (!priv->txenab) { - i2sdbg("ERROR: SSC%d has no transmitter\n", priv->sscno); + i2serr("ERROR: SSC%d has no transmitter\n", priv->sscno); ret = -EAGAIN; goto errout_with_exclsem; } @@ -2509,7 +2509,7 @@ errout_with_exclsem: return ret; #else - i2sdbg("ERROR: SSC%d has no transmitter\n", priv->sscno); + i2serr("ERROR: SSC%d has no transmitter\n", priv->sscno); UNUSED(priv); return -ENOSYS; #endif @@ -2563,7 +2563,7 @@ static int ssc_rx_configure(struct sam_ssc_s *priv) case SSC_CLKSRC_NONE: /* No clock */ default: - i2sdbg("ERROR: No receiver clock\n"); + i2serr("ERROR: No receiver clock\n"); return -EINVAL; } @@ -2584,7 +2584,7 @@ static int ssc_rx_configure(struct sam_ssc_s *priv) break; default: - i2sdbg("ERROR: Invalid clock output selection\n"); + i2serr("ERROR: Invalid clock output selection\n"); return -EINVAL; } @@ -2688,7 +2688,7 @@ static int ssc_tx_configure(struct sam_ssc_s *priv) case SSC_CLKSRC_NONE: /* No clock */ default: - i2sdbg("ERROR: No transmitter clock\n"); + i2serr("ERROR: No transmitter clock\n"); return -EINVAL; } @@ -2709,7 +2709,7 @@ static int ssc_tx_configure(struct sam_ssc_s *priv) break; default: - i2sdbg("ERROR: Invalid clock output selection\n"); + i2serr("ERROR: Invalid clock output selection\n"); return -EINVAL; } @@ -2968,7 +2968,7 @@ static int ssc_dma_flags(struct sam_ssc_s *priv, uint32_t *dmaflags) break; default: - i2sdbg("ERROR: Unsupported data width: %d\n", priv->datalen); + i2serr("ERROR: Unsupported data width: %d\n", priv->datalen); return -ENOSYS; } @@ -3001,7 +3001,7 @@ static int ssc_dma_allocate(struct sam_ssc_s *priv) ret = ssc_dma_flags(priv, &dmaflags); if (ret < 0) { - i2sdbg("ERROR: ssc_dma_flags failed: %d\n", ret); + i2serr("ERROR: ssc_dma_flags failed: %d\n", ret); return ret; } @@ -3018,7 +3018,7 @@ static int ssc_dma_allocate(struct sam_ssc_s *priv) priv->rx.dma = sam_dmachannel(priv->sscno, dmaflags); if (!priv->rx.dma) { - i2sdbg("ERROR: Failed to allocate the RX DMA channel\n"); + i2serr("ERROR: Failed to allocate the RX DMA channel\n"); goto errout; } @@ -3027,7 +3027,7 @@ static int ssc_dma_allocate(struct sam_ssc_s *priv) priv->rx.dog = wd_create(); if (!priv->rx.dog) { - i2sdbg("ERROR: Failed to create the RX DMA watchdog\n"); + i2serr("ERROR: Failed to create the RX DMA watchdog\n"); goto errout; } } @@ -3041,7 +3041,7 @@ static int ssc_dma_allocate(struct sam_ssc_s *priv) priv->tx.dma = sam_dmachannel(priv->sscno, dmaflags); if (!priv->tx.dma) { - i2sdbg("ERROR: Failed to allocate the TX DMA channel\n"); + i2serr("ERROR: Failed to allocate the TX DMA channel\n"); goto errout; } @@ -3050,7 +3050,7 @@ static int ssc_dma_allocate(struct sam_ssc_s *priv) priv->tx.dog = wd_create(); if (!priv->tx.dog) { - i2sdbg("ERROR: Failed to create the TX DMA watchdog\n"); + i2serr("ERROR: Failed to create the TX DMA watchdog\n"); goto errout; } } @@ -3441,7 +3441,7 @@ struct i2s_dev_s *sam_ssc_initialize(int port) priv = (struct sam_ssc_s *)zalloc(sizeof(struct sam_ssc_s)); if (!priv) { - i2sdbg("ERROR: Failed to allocate a chip select structure\n"); + i2serr("ERROR: Failed to allocate a chip select structure\n"); return NULL; } @@ -3475,7 +3475,7 @@ struct i2s_dev_s *sam_ssc_initialize(int port) else #endif /* CONFIG_SAMA5_SSC1 */ { - i2sdbg("ERROR: Unsupported I2S port: %d\n", port); + i2serr("ERROR: Unsupported I2S port: %d\n", port); goto errout_with_alloc; } @@ -3496,7 +3496,7 @@ struct i2s_dev_s *sam_ssc_initialize(int port) ret = ssc_rx_configure(priv); if (ret < 0) { - i2sdbg("ERROR: Failed to configure the receiver: %d\n", ret); + i2serr("ERROR: Failed to configure the receiver: %d\n", ret); goto errout_with_clocking; } @@ -3505,7 +3505,7 @@ struct i2s_dev_s *sam_ssc_initialize(int port) ret = ssc_tx_configure(priv); if (ret < 0) { - i2sdbg("ERROR: Failed to configure the transmitter: %d\n", ret); + i2serr("ERROR: Failed to configure the transmitter: %d\n", ret); goto errout_with_clocking; } diff --git a/arch/arm/src/sama5/sam_tc.c b/arch/arm/src/sama5/sam_tc.c index 9a6c091ede..6ce38f0ee2 100644 --- a/arch/arm/src/sama5/sam_tc.c +++ b/arch/arm/src/sama5/sam_tc.c @@ -953,7 +953,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) { /* Timer/counter is not invalid or not enabled */ - tcdbg("ERROR: Bad channel number: %d\n", channel); + tcerr("ERROR: Bad channel number: %d\n", channel); return NULL; } @@ -976,7 +976,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) for (i = 0, ch = tcconfig->chfirst; i < SAM_TC_NCHANNELS; i++) { - tcdbg("Initializing TC%d channel %d\n", tcconfig->tc, ch); + tcerr("Initializing TC%d channel %d\n", tcconfig->tc, ch); /* Initialize the channel data structure */ @@ -1057,7 +1057,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) { /* No.. return a failure */ - tcdbg("Channel %d is in-used\n", channel); + tcerr("Channel %d is in-used\n", channel); sam_givesem(tc); return NULL; } @@ -1478,7 +1478,7 @@ int sam_tc_divisor(uint32_t frequency, uint32_t *div, uint32_t *tcclks) { /* If no divisor can be found, return -ERANGE */ - tcdbg("Lower bound search failed\n"); + tcerr("Lower bound search failed\n"); return -ERANGE; } } diff --git a/arch/arm/src/sama5/sam_tc.h b/arch/arm/src/sama5/sam_tc.h index 8d19b5566c..dec7b783e4 100644 --- a/arch/arm/src/sama5/sam_tc.h +++ b/arch/arm/src/sama5/sam_tc.h @@ -86,12 +86,12 @@ /* Timer/counter debug output */ #ifdef CONFIG_SAMA5_TC_DEBUG -# define tcdbg dbg +# define tcerr err # define tcinfo info # define tcllerr llerr # define tcllinfo llinfo #else -# define tcdbg(x...) +# define tcerr(x...) # define tcinfo(x...) # define tcllerr(x...) # define tcllinfo(x...) diff --git a/arch/arm/src/sama5/sam_trng.c b/arch/arm/src/sama5/sam_trng.c index eb9ee65c27..a3eb102640 100644 --- a/arch/arm/src/sama5/sam_trng.c +++ b/arch/arm/src/sama5/sam_trng.c @@ -362,7 +362,7 @@ void up_rnginitialize(void) if (irq_attach(SAM_IRQ_TRNG, sam_interrupt)) { - fdbg("ERROR: Failed to attach to IRQ%d\n", SAM_IRQ_TRNG); + ferr("ERROR: Failed to attach to IRQ%d\n", SAM_IRQ_TRNG); return; } @@ -379,7 +379,7 @@ void up_rnginitialize(void) ret = register_driver("/dev/random", &g_trngops, 0644, NULL); if (ret < 0) { - fdbg("ERROR: Failed to register /dev/random\n"); + ferr("ERROR: Failed to register /dev/random\n"); return; } diff --git a/arch/arm/src/sama5/sam_tsd.c b/arch/arm/src/sama5/sam_tsd.c index ce1e2f67be..de28c0a953 100644 --- a/arch/arm/src/sama5/sam_tsd.c +++ b/arch/arm/src/sama5/sam_tsd.c @@ -391,7 +391,7 @@ static int sam_tsd_waitsample(struct sam_tsd_s *priv, struct sam_sample_s *sampl * the failure now. */ - idbg("ERROR: sem_wait: %d\n", errno); + ierr("ERROR: sem_wait: %d\n", errno); DEBUGASSERT(errno == EINTR); ret = -EINTR; goto errout; @@ -644,7 +644,7 @@ static void sam_tsd_bottomhalf(void *arg) if (xraw == 0 || xraw >= xscale || yraw == 0 || yraw > yscale) { - idbg("Discarding: x %d:%d y %d:%d\n", xraw, xscale); + ierr("Discarding: x %d:%d y %d:%d\n", xraw, xscale); goto ignored; } @@ -936,7 +936,7 @@ static ssize_t sam_tsd_read(struct file *filep, char *buffer, size_t len) * handle smaller reads... but why? */ - idbg("ERROR: Unsupported read size: %d\n", len); + ierr("ERROR: Unsupported read size: %d\n", len); return -ENOSYS; } @@ -968,7 +968,7 @@ static ssize_t sam_tsd_read(struct file *filep, char *buffer, size_t len) { /* We might have been awakened by a signal */ - idbg("ERROR: sam_tsd_waitsample: %d\n", ret); + ierr("ERROR: sam_tsd_waitsample: %d\n", ret); goto errout; } } @@ -1679,7 +1679,7 @@ int sam_tsd_register(struct sam_adc_s *adc, int minor) ret = register_driver(devname, &g_tsdops, 0666, priv); if (ret < 0) { - idbg("ERROR: register_driver() failed: %d\n", ret); + ierr("ERROR: register_driver() failed: %d\n", ret); goto errout_with_priv; } @@ -1724,7 +1724,7 @@ void sam_tsd_interrupt(uint32_t pending) ret = sam_tsd_schedule(priv); if (ret < 0) { - idbg("ERROR: sam_tsd_schedule failed: %d\n", ret); + ierr("ERROR: sam_tsd_schedule failed: %d\n", ret); } } } diff --git a/arch/arm/src/sama5/sam_twi.c b/arch/arm/src/sama5/sam_twi.c index 8f813afe4b..c08135a1ce 100644 --- a/arch/arm/src/sama5/sam_twi.c +++ b/arch/arm/src/sama5/sam_twi.c @@ -127,12 +127,12 @@ /* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */ #ifdef CONFIG_DEBUG_I2C -# define i2cdbg dbg +# define i2cerr err # define i2cinfo info # define i2cllerr llerr # define i2cllinfo llinfo #else -# define i2cdbg(x...) +# define i2cerr(x...) # define i2cinfo(x...) # define i2cllerr(x...) # define i2cllinfo(x...) @@ -887,7 +887,7 @@ static int twi_transfer(FAR struct i2c_master_s *dev, ret = twi_wait(priv, size); if (ret < 0) { - i2cdbg("ERROR: Transfer failed: %d\n", ret); + i2cerr("ERROR: Transfer failed: %d\n", ret); } leave_critical_section(flags); @@ -1287,7 +1287,7 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) else #endif { - i2cdbg("ERROR: Unsupported bus: TWI%d\n", bus); + i2cerr("ERROR: Unsupported bus: TWI%d\n", bus); return NULL; } @@ -1300,7 +1300,7 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) priv->timeout = wd_create(); if (priv->timeout == NULL) { - idbg("ERROR: Failed to allocate a timer\n"); + ierr("ERROR: Failed to allocate a timer\n"); goto errout_with_irq; } @@ -1309,7 +1309,7 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) ret = irq_attach(priv->attr->irq, priv->attr->handler); if (ret < 0) { - idbg("ERROR: Failed to attach irq %d\n", priv->attr->irq); + ierr("ERROR: Failed to attach irq %d\n", priv->attr->irq); goto errout_with_wdog; } diff --git a/arch/arm/src/sama5/sam_udphs.c b/arch/arm/src/sama5/sam_udphs.c index baf24cdb58..00f85e6381 100644 --- a/arch/arm/src/sama5/sam_udphs.c +++ b/arch/arm/src/sama5/sam_udphs.c @@ -4300,7 +4300,7 @@ static void sam_sw_setup(struct sam_usbdev_s *priv) kmm_memalign(16, CONFIG_SAMA5_UDPHS_NDTDS * sizeof(struct sam_dtd_s)); if (!priv->dtdpool) { - udbg("ERROR: Failed to allocate the DMA transfer descriptor pool\n"); + uerr("ERROR: Failed to allocate the DMA transfer descriptor pool\n"); return NULL; } diff --git a/arch/arm/src/sama5/sam_wdt.c b/arch/arm/src/sama5/sam_wdt.c index 88546618d9..60b079df58 100644 --- a/arch/arm/src/sama5/sam_wdt.c +++ b/arch/arm/src/sama5/sam_wdt.c @@ -87,10 +87,10 @@ */ #ifdef CONFIG_DEBUG_WATCHDOG -# define wddbg llerr +# define wderr llerr # define wdinfo llinfo #else -# define wddbg(x...) +# define wderr(x...) # define wdinfo(x...) #endif @@ -463,7 +463,7 @@ static int sam_settimeout(FAR struct watchdog_lowerhalf_s *lower, if (timeout < WDT_MINTIMEOUT || timeout >= WDT_MAXTIMEOUT) { - wddbg("Cannot represent timeout: %d < %d > %d\n", + wderr("Cannot represent timeout: %d < %d > %d\n", WDT_MINTIMEOUT, timeout, WDT_MAXTIMEOUT); return -ERANGE; } @@ -574,7 +574,7 @@ static xcpt_t sam_capture(FAR struct watchdog_lowerhalf_s *lower, xcpt_t handler) { #ifndef CONFIG_SAMA5_WDT_INTERRUPT - wddbg("ERROR: Not configured for this mode\n"); + wderr("ERROR: Not configured for this mode\n"); return NULL; #else FAR struct sam_lowerhalf_s *priv = (FAR struct sam_lowerhalf_s *)lower; diff --git a/arch/arm/src/sama5/sam_xdmac.c b/arch/arm/src/sama5/sam_xdmac.c index 74105e6147..93989db63a 100644 --- a/arch/arm/src/sama5/sam_xdmac.c +++ b/arch/arm/src/sama5/sam_xdmac.c @@ -807,7 +807,7 @@ static uint8_t sam_channel(uint8_t pid, const struct sam_pidmap_s *table, } } - dmadbg("No channel found for pid %d\n", pid); + dmaerr("No channel found for pid %d\n", pid); DEBUGPANIC(); return 0x3f; } @@ -2039,7 +2039,7 @@ DMA_HANDLE sam_dmachannel(uint8_t dmacno, uint32_t chflags) #endif { - dmadbg("ERROR: Bad XDMAC number: %d\n", dmacno); + dmaerr("ERROR: Bad XDMAC number: %d\n", dmacno); DEBUGPANIC(); return (DMA_HANDLE)NULL; } @@ -2088,7 +2088,7 @@ DMA_HANDLE sam_dmachannel(uint8_t dmacno, uint32_t chflags) } else { - dmadbg("ERROR: Failed allocate XDMAC%d channel\n", (int)dmacno); + dmaerr("ERROR: Failed allocate XDMAC%d channel\n", (int)dmacno); } return (DMA_HANDLE)xdmach; @@ -2465,30 +2465,30 @@ void sam_dmadump(DMA_HANDLE handle, const struct sam_dmaregs_s *regs, struct sam_xdmach_s *xdmach = (struct sam_xdmach_s *)handle; struct sam_xdmac_s *xdmac = sam_controller(xdmach); - dmadbg("%s\n", msg); - dmadbg(" DMA Global Registers:\n"); - dmadbg(" GTYPE[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GTYPE_OFFSET, regs->gtype); - dmadbg(" GCFG[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GCFG_OFFSET, regs->gcfg); - dmadbg(" GWAC[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GWAC_OFFSET, regs->gwac); - dmadbg(" GIM[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GIM_OFFSET, regs->gim); - dmadbg(" GIS[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GIS_OFFSET, regs->gis); - dmadbg(" GS[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GS_OFFSET, regs->gs); - dmadbg(" GRS[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GRS_OFFSET, regs->grs); - dmadbg(" GWS[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GWS_OFFSET, regs->gws); - dmadbg(" GSWS[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GSWS_OFFSET, regs->gsws); - dmadbg(" DMA Channel Registers:\n"); - dmadbg(" CIM[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CIM_OFFSET, regs->cim); - dmadbg(" CIS[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CIS_OFFSET, regs->cis); - dmadbg(" CSA[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CSA_OFFSET, regs->csa); - dmadbg(" CDA[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CDA_OFFSET, regs->cda); - dmadbg(" CNDA[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CNDA_OFFSET, regs->cnda); - dmadbg(" CNDC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CNDC_OFFSET, regs->cndc); - dmadbg(" CUBC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CUBC_OFFSET, regs->cubc); - dmadbg(" CBC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CBC_OFFSET, regs->cbc); - dmadbg(" CC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CC_OFFSET, regs->cc); - dmadbg(" CDSMSP[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CDSMSP_OFFSET, regs->cdsmsp); - dmadbg(" CSUS[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CSUS_OFFSET, regs->csus); - dmadbg(" CDUS[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CDUS_OFFSET, regs->cdus); + dmaerr("%s\n", msg); + dmaerr(" DMA Global Registers:\n"); + dmaerr(" GTYPE[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GTYPE_OFFSET, regs->gtype); + dmaerr(" GCFG[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GCFG_OFFSET, regs->gcfg); + dmaerr(" GWAC[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GWAC_OFFSET, regs->gwac); + dmaerr(" GIM[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GIM_OFFSET, regs->gim); + dmaerr(" GIS[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GIS_OFFSET, regs->gis); + dmaerr(" GS[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GS_OFFSET, regs->gs); + dmaerr(" GRS[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GRS_OFFSET, regs->grs); + dmaerr(" GWS[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GWS_OFFSET, regs->gws); + dmaerr(" GSWS[%08x]: %08x\n", xdmac->base + SAM_XDMAC_GSWS_OFFSET, regs->gsws); + dmaerr(" DMA Channel Registers:\n"); + dmaerr(" CIM[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CIM_OFFSET, regs->cim); + dmaerr(" CIS[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CIS_OFFSET, regs->cis); + dmaerr(" CSA[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CSA_OFFSET, regs->csa); + dmaerr(" CDA[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CDA_OFFSET, regs->cda); + dmaerr(" CNDA[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CNDA_OFFSET, regs->cnda); + dmaerr(" CNDC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CNDC_OFFSET, regs->cndc); + dmaerr(" CUBC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CUBC_OFFSET, regs->cubc); + dmaerr(" CBC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CBC_OFFSET, regs->cbc); + dmaerr(" CC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CC_OFFSET, regs->cc); + dmaerr(" CDSMSP[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CDSMSP_OFFSET, regs->cdsmsp); + dmaerr(" CSUS[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CSUS_OFFSET, regs->csus); + dmaerr(" CDUS[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CDUS_OFFSET, regs->cdus); } #endif /* CONFIG_DEBUG_DMA */ #endif /* CONFIG_SAMA5_XDMAC0 || CONFIG_SAMA5_XDMAC1 */ diff --git a/arch/arm/src/samdl/sam_dmac.c b/arch/arm/src/samdl/sam_dmac.c index 4eafd93790..f1afd24ff0 100644 --- a/arch/arm/src/samdl/sam_dmac.c +++ b/arch/arm/src/samdl/sam_dmac.c @@ -1274,7 +1274,7 @@ void sam_dmasample(DMA_HANDLE handle, struct sam_dmaregs_s *regs) regs->crcdatain = getreg32(SAM_DMAC_CRCDATAIN); /* CRC Data Input Register */ regs->crcchksum = getreg32(SAM_DMAC_CRCCHKSUM); /* CRC Checksum Register */ regs->crcstatus = getreg8(SAM_DMAC_CRCSTATUS); /* CRC Status Register */ - regs->dbgctrl = getreg8(SAM_DMAC_DBGCTRL); /* Debug Control Register */ + regs->errctrl = getreg8(SAM_DMAC_DBGCTRL); /* Debug Control Register */ regs->qosctrl = getreg8(SAM_DMAC_QOSCTRL); /* Quality of Service Control Register */ regs->swtrigctrl = getreg32(SAM_DMAC_SWTRIGCTRL); /* Software Trigger Control Register */ regs->prictrl0 = getreg32(SAM_DMAC_PRICTRL0); /* Priority Control 0 Register */ @@ -1310,19 +1310,19 @@ void sam_dmadump(DMA_HANDLE handle, const struct sam_dmaregs_s *regs, { struct sam_dmach_s *dmach = (struct sam_dmach_s *)handle; - dmadbg("%s\n", msg); - dmadbg(" DMAC Registers:\n"); - dmadbg(" CTRL: %04x CRCCTRL: %04x CRCDATAIN: %08x CRCCHKSUM: %08x\n", + dmaerr("%s\n", msg); + dmaerr(" DMAC Registers:\n"); + dmaerr(" CTRL: %04x CRCCTRL: %04x CRCDATAIN: %08x CRCCHKSUM: %08x\n", regs->ctrl, regs->crcctrl, regs->crcdatain, regs->crcchksum); - dmadbg(" CRCSTATUS: %02x DBGCTRL: %02x QOSCTRL: %02x SWTRIGCTRL: %08x\n", - regs->crcstatus, regs->dbgctrl, regs->qosctrl, regs->swtrigctrl); - dmadbg(" PRICTRL0: %08x INTPEND: %04x INSTSTATUS: %08x BUSYCH: %08x\n", + dmaerr(" CRCSTATUS: %02x DBGCTRL: %02x QOSCTRL: %02x SWTRIGCTRL: %08x\n", + regs->crcstatus, regs->errctrl, regs->qosctrl, regs->swtrigctrl); + dmaerr(" PRICTRL0: %08x INTPEND: %04x INSTSTATUS: %08x BUSYCH: %08x\n", regs->prictrl0, regs->intpend, regs->intstatus, regs->busych); - dmadbg(" PENDCH: %08x ACTIVE: %08x BASEADDR: %08x WRBADDR: %08x\n", + dmaerr(" PENDCH: %08x ACTIVE: %08x BASEADDR: %08x WRBADDR: %08x\n", regs->pendch, regs->active, regs->baseaddr, regs->wrbaddr); - dmadbg(" CHID: %02x CHCRTRLA: %02x CHCRTRLB: %08x CHINFLAG: %02x\n", + dmaerr(" CHID: %02x CHCRTRLA: %02x CHCRTRLB: %08x CHINFLAG: %02x\n", regs->chid, regs->chctrla, regs->chctrlb, regs->chintflag, - dmadbg(" CHSTATUS: %02x\n", + dmaerr(" CHSTATUS: %02x\n", regs->chstatus); } #endif /* CONFIG_DEBUG_DMA */ diff --git a/arch/arm/src/samdl/sam_irq.c b/arch/arm/src/samdl/sam_irq.c index a67f403b53..9fc2469883 100644 --- a/arch/arm/src/samdl/sam_irq.c +++ b/arch/arm/src/samdl/sam_irq.c @@ -84,7 +84,7 @@ volatile uint32_t *g_current_regs[1]; /**************************************************************************** * Name: sam_nmi, sam_busfault, sam_usagefault, sam_pendsv, - * sam_dbgmonitor, sam_pendsv, sam_reserved + * sam_errmonitor, sam_pendsv, sam_reserved * * Description: * Handlers for various execptions. None are handled and all are fatal @@ -97,7 +97,7 @@ volatile uint32_t *g_current_regs[1]; static int sam_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -105,7 +105,7 @@ static int sam_nmi(int irq, FAR void *context) static int sam_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } @@ -113,7 +113,7 @@ static int sam_pendsv(int irq, FAR void *context) static int sam_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } diff --git a/arch/arm/src/samdl/sam_spi.c b/arch/arm/src/samdl/sam_spi.c index e16f4cd730..9a58a954ee 100644 --- a/arch/arm/src/samdl/sam_spi.c +++ b/arch/arm/src/samdl/sam_spi.c @@ -91,14 +91,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -944,7 +944,7 @@ static uint32_t spi_setfrequency(struct spi_dev_s *dev, uint32_t frequency) { /* Set the frequency to the maximum */ - spidbg("ERROR: Cannot realize frequency: %ld\n", (long)frequency); + spierr("ERROR: Cannot realize frequency: %ld\n", (long)frequency); frequency = maxfreq; } @@ -975,7 +975,7 @@ static uint32_t spi_setfrequency(struct spi_dev_s *dev, uint32_t frequency) if (baud > 255) { - spidbg("ERROR: BAUD is out of range: %ld\n", (long)baud); + spierr("ERROR: BAUD is out of range: %ld\n", (long)baud); baud = 255; } @@ -1281,7 +1281,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, data = spi_getreg16(priv, SAM_SPI_STATUS_OFFSET); if ((data & SPI_STATUS_BUFOVF) != 0) { - spidbg("ERROR: Buffer overflow!\n"); + spierr("ERROR: Buffer overflow!\n"); /* Clear the buffer overflow flag */ @@ -1488,7 +1488,7 @@ struct spi_dev_s *sam_spibus_initialize(int port) else #endif { - spidbg("ERROR: Unsupported port: %d\n", port); + spierr("ERROR: Unsupported port: %d\n", port); return NULL; } @@ -1570,7 +1570,7 @@ struct spi_dev_s *sam_spibus_initialize(int port) ret = irq_attach(priv->irq, priv->handler); if (ret < 0) { - spidbg("ERROR: Failed to attach interrupt: %d\n", irq); + spierr("ERROR: Failed to attach interrupt: %d\n", irq); return NULL; } diff --git a/arch/arm/src/samv7/sam_emac.c b/arch/arm/src/samv7/sam_emac.c index 1e5e80a840..b11150ffaa 100644 --- a/arch/arm/src/samv7/sam_emac.c +++ b/arch/arm/src/samv7/sam_emac.c @@ -2824,12 +2824,12 @@ static int sam_ifup(struct net_driver_s *dev) int ret; #ifdef CONFIG_NET_IPv4 - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); #endif #ifdef CONFIG_NET_IPv6 - ndbg("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + nerr("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2], dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5], dev->d_ipv6addr[6], dev->d_ipv6addr[7]); @@ -3652,7 +3652,7 @@ static int sam_phyintenable(struct sam_emac_s *priv) else #endif { - ndbg("ERROR: Unsupported PHY type: %d\n", priv->phytype); + nerr("ERROR: Unsupported PHY type: %d\n", priv->phytype); ret = -ENOSYS; } @@ -4329,7 +4329,7 @@ static int sam_phyinit(struct sam_emac_s *priv) mck = BOARD_MCK_FREQUENCY; if (mck > (240*1000*1000)) { - ndbg("ERROR: Cannot realize PHY clock\n"); + nerr("ERROR: Cannot realize PHY clock\n"); return -EINVAL; } else if (mck > (160*1000*1000)) @@ -5111,7 +5111,7 @@ int sam_emac_initialize(int intf) else #endif { - ndbg("ERROR: Interface %d not supported\n", intf); + nerr("ERROR: Interface %d not supported\n", intf); return -EINVAL; } @@ -5140,7 +5140,7 @@ int sam_emac_initialize(int intf) priv->txpoll = wd_create(); if (!priv->txpoll) { - ndbg("ERROR: Failed to create periodic poll timer\n"); + nerr("ERROR: Failed to create periodic poll timer\n"); ret = -EAGAIN; goto errout; } @@ -5148,7 +5148,7 @@ int sam_emac_initialize(int intf) priv->txtimeout = wd_create(); /* Create TX timeout timer */ if (!priv->txtimeout) { - ndbg("ERROR: Failed to create periodic poll timer\n"); + nerr("ERROR: Failed to create periodic poll timer\n"); ret = -EAGAIN; goto errout_with_txpoll; } @@ -5162,7 +5162,7 @@ int sam_emac_initialize(int intf) ret = sam_buffer_allocate(priv); if (ret < 0) { - ndbg("ERROR: sam_buffer_allocate failed: %d\n", ret); + nerr("ERROR: sam_buffer_allocate failed: %d\n", ret); goto errout_with_txtimeout; } @@ -5173,7 +5173,7 @@ int sam_emac_initialize(int intf) ret = irq_attach(priv->attr->irq, priv->attr->handler); if (ret < 0) { - ndbg("ERROR: Failed to attach the handler to the IRQ%d\n", priv->attr->irq); + nerr("ERROR: Failed to attach the handler to the IRQ%d\n", priv->attr->irq); goto errout_with_buffers; } @@ -5186,7 +5186,7 @@ int sam_emac_initialize(int intf) ret = sam_ifdown(&priv->dev); if (ret < 0) { - ndbg("ERROR: Failed to put the interface in the down state: %d\n", ret); + nerr("ERROR: Failed to put the interface in the down state: %d\n", ret); goto errout_with_buffers; } @@ -5198,7 +5198,7 @@ int sam_emac_initialize(int intf) return ret; } - ndbg("ERROR: netdev_register() failed: %d\n", ret); + nerr("ERROR: netdev_register() failed: %d\n", ret); errout_with_buffers: sam_buffer_free(priv); @@ -5261,7 +5261,7 @@ int sam_emac_setmacaddr(int intf, uint8_t mac[6]) else #endif { - ndbg("ERROR: Interface %d not supported\n", intf); + nerr("ERROR: Interface %d not supported\n", intf); return -EINVAL; } diff --git a/arch/arm/src/samv7/sam_freerun.c b/arch/arm/src/samv7/sam_freerun.c index b4c438781b..70747f867a 100644 --- a/arch/arm/src/samv7/sam_freerun.c +++ b/arch/arm/src/samv7/sam_freerun.c @@ -136,7 +136,7 @@ int sam_freerun_initialize(struct sam_freerun_s *freerun, int chan, ret = sam_tc_clockselect(frequency, &cmr, &actual); if (ret < 0) { - tcdbg("ERROR: sam_tc_clockselect failed: %d\n", ret); + tcerr("ERROR: sam_tc_clockselect failed: %d\n", ret); return ret; } @@ -175,7 +175,7 @@ int sam_freerun_initialize(struct sam_freerun_s *freerun, int chan, freerun->tch = sam_tc_allocate(chan, cmr); if (!freerun->tch) { - tcdbg("ERROR: Failed to allocate timer channel %d\n", chan); + tcerr("ERROR: Failed to allocate timer channel %d\n", chan); return -EBUSY; } diff --git a/arch/arm/src/samv7/sam_hsmci.c b/arch/arm/src/samv7/sam_hsmci.c index 836af1f394..8c487a75fd 100644 --- a/arch/arm/src/samv7/sam_hsmci.c +++ b/arch/arm/src/samv7/sam_hsmci.c @@ -933,25 +933,25 @@ static void sam_hsmcisample(struct sam_dev_s *priv, static void sam_hsmcidump(struct sam_dev_s *priv, struct sam_hsmciregs_s *regs, const char *msg) { - fdbg("HSMCI Registers: %s\n", msg); - fdbg(" MR[%08x]: %08x\n", priv->base + SAM_HSMCI_MR_OFFSET, regs->mr); - fdbg(" DTOR[%08x]: %08x\n", priv->base + SAM_HSMCI_DTOR_OFFSET, regs->dtor); - fdbg(" SDCR[%08x]: %08x\n", priv->base + SAM_HSMCI_SDCR_OFFSET, regs->sdcr); - fdbg(" ARGR[%08x]: %08x\n", priv->base + SAM_HSMCI_ARGR_OFFSET, regs->argr); - fdbg(" BLKR[%08x]: %08x\n", priv->base + SAM_HSMCI_BLKR_OFFSET, regs->blkr); - fdbg(" CSTOR[%08x]: %08x\n", priv->base + SAM_HSMCI_CSTOR_OFFSET, regs->cstor); + ferr("HSMCI Registers: %s\n", msg); + ferr(" MR[%08x]: %08x\n", priv->base + SAM_HSMCI_MR_OFFSET, regs->mr); + ferr(" DTOR[%08x]: %08x\n", priv->base + SAM_HSMCI_DTOR_OFFSET, regs->dtor); + ferr(" SDCR[%08x]: %08x\n", priv->base + SAM_HSMCI_SDCR_OFFSET, regs->sdcr); + ferr(" ARGR[%08x]: %08x\n", priv->base + SAM_HSMCI_ARGR_OFFSET, regs->argr); + ferr(" BLKR[%08x]: %08x\n", priv->base + SAM_HSMCI_BLKR_OFFSET, regs->blkr); + ferr(" CSTOR[%08x]: %08x\n", priv->base + SAM_HSMCI_CSTOR_OFFSET, regs->cstor); #if 0 /* Reading these can cause loss of response data */ - fdbg(" RSPR0[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR0_OFFSET, regs->rsp0); - fdbg(" RSPR1[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR1_OFFSET, regs->rsp1); - fdbg(" RSPR2[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR2_OFFSET, regs->rsp2); - fdbg(" RSPR3[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR3_OFFSET, regs->rsp3); -#endif - fdbg(" SR[%08x]: %08x\n", priv->base + SAM_HSMCI_SR_OFFSET, regs->sr); - fdbg(" IMR[%08x]: %08x\n", priv->base + SAM_HSMCI_IMR_OFFSET, regs->imr); - fdbg(" DMA[%08x]: %08x\n", priv->base + SAM_HSMCI_DMA_OFFSET, regs->dma); - fdbg(" CFG[%08x]: %08x\n", priv->base + SAM_HSMCI_CFG_OFFSET, regs->cfg); - fdbg(" WPMR[%08x]: %08x\n", priv->base + SAM_HSMCI_WPMR_OFFSET, regs->wpmr); - fdbg(" WPSR[%08x]: %08x\n", priv->base + SAM_HSMCI_WPSR_OFFSET, regs->wpsr); + ferr(" RSPR0[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR0_OFFSET, regs->rsp0); + ferr(" RSPR1[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR1_OFFSET, regs->rsp1); + ferr(" RSPR2[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR2_OFFSET, regs->rsp2); + ferr(" RSPR3[%08x]: %08x\n", priv->base + SAM_HSMCI_RSPR3_OFFSET, regs->rsp3); +#endif + ferr(" SR[%08x]: %08x\n", priv->base + SAM_HSMCI_SR_OFFSET, regs->sr); + ferr(" IMR[%08x]: %08x\n", priv->base + SAM_HSMCI_IMR_OFFSET, regs->imr); + ferr(" DMA[%08x]: %08x\n", priv->base + SAM_HSMCI_DMA_OFFSET, regs->dma); + ferr(" CFG[%08x]: %08x\n", priv->base + SAM_HSMCI_CFG_OFFSET, regs->cfg); + ferr(" WPMR[%08x]: %08x\n", priv->base + SAM_HSMCI_WPMR_OFFSET, regs->wpmr); + ferr(" WPSR[%08x]: %08x\n", priv->base + SAM_HSMCI_WPSR_OFFSET, regs->wpsr); } #endif @@ -1025,7 +1025,7 @@ static void sam_xfrdumpone(struct sam_dev_s *priv, int index, } else { - fdbg("%s: Not collected\n", msg); + ferr("%s: Not collected\n", msg); } } #endif @@ -2239,7 +2239,7 @@ static int sam_sendsetup(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer, { /* Some fatal error has occurred */ - fdbg("ERROR: sr %08x\n", sr); + ferr("ERROR: sr %08x\n", sr); return -EIO; } else if ((sr & HSMCI_INT_TXRDY) != 0) @@ -2419,7 +2419,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { /* Yes.. Was the error some kind of timeout? */ - fdbg("ERROR: cmd: %08x events: %08x SR: %08x\n", + ferr("ERROR: cmd: %08x events: %08x SR: %08x\n", cmd, priv->cmdrmask, sr); if ((pending & HSMCI_RESPONSE_TIMEOUT_ERRORS) != 0) @@ -2449,7 +2449,7 @@ static int sam_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) } else if (--timeout <= 0) { - fdbg("ERROR: Timeout cmd: %08x events: %08x SR: %08x\n", + ferr("ERROR: Timeout cmd: %08x events: %08x SR: %08x\n", cmd, priv->cmdrmask, sr); priv->wkupevent = SDIOWAIT_TIMEOUT; @@ -2524,7 +2524,7 @@ static int sam_recvshort(FAR struct sdio_dev_s *dev, #ifdef CONFIG_DEBUG_FEATURES if (!rshort) { - fdbg("ERROR: rshort=NULL\n"); + ferr("ERROR: rshort=NULL\n"); ret = -EINVAL; } @@ -2536,7 +2536,7 @@ static int sam_recvshort(FAR struct sdio_dev_s *dev, (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R3_RESPONSE && (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R7_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2587,7 +2587,7 @@ static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, if ((cmd & MMCSD_RESPONSE_MASK) != MMCSD_R2_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2597,7 +2597,7 @@ static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, if ((priv->wkupevent & SDIOWAIT_TIMEOUT) != 0) { - fdbg("ERROR: timeout\n"); + ferr("ERROR: timeout\n"); ret = -EINVAL; } @@ -2605,7 +2605,7 @@ static int sam_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, else if ((priv->wkupevent & SDIOWAIT_ERROR) != 0) { - fdbg("ERROR: Other error\n"); + ferr("ERROR: Other error\n"); ret = -EIO; } @@ -2781,7 +2781,7 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev, 1, (uint32_t)priv); if (ret != OK) { - fdbg("ERROR: wd_start failed: %d\n", ret); + ferr("ERROR: wd_start failed: %d\n", ret); } } @@ -3213,7 +3213,7 @@ static void sam_callback(void *arg) { /* NOTE: Currently, work_cancel only returns success */ - fdbg("ERROR: Failed to cancel work: %d\n", ret); + ferr("ERROR: Failed to cancel work: %d\n", ret); } fllinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); @@ -3223,7 +3223,7 @@ static void sam_callback(void *arg) { /* NOTE: Currently, work_queue only returns success */ - fdbg("ERROR: Failed to schedule work: %d\n", ret); + ferr("ERROR: Failed to schedule work: %d\n", ret); } } diff --git a/arch/arm/src/samv7/sam_irq.c b/arch/arm/src/samv7/sam_irq.c index 2c0a1a54c5..dc5b013f61 100644 --- a/arch/arm/src/samv7/sam_irq.c +++ b/arch/arm/src/samv7/sam_irq.c @@ -161,7 +161,7 @@ static void sam_dumpnvic(const char *msg, int irq) #endif /**************************************************************************** - * Name: sam_nmi, sam_busfault, sam_usagefault, sam_pendsv, sam_dbgmonitor, + * Name: sam_nmi, sam_busfault, sam_usagefault, sam_pendsv, sam_errmonitor, * sam_pendsv, sam_reserved * * Description: @@ -175,7 +175,7 @@ static void sam_dumpnvic(const char *msg, int irq) static int sam_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -183,7 +183,7 @@ static int sam_nmi(int irq, FAR void *context) static int sam_busfault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); + err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; } @@ -191,7 +191,7 @@ static int sam_busfault(int irq, FAR void *context) static int sam_usagefault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); + err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; } @@ -199,15 +199,15 @@ static int sam_usagefault(int irq, FAR void *context) static int sam_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } -static int sam_dbgmonitor(int irq, FAR void *context) +static int sam_errmonitor(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Debug Monitor received\n"); + err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; } @@ -215,7 +215,7 @@ static int sam_dbgmonitor(int irq, FAR void *context) static int sam_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } @@ -464,7 +464,7 @@ void up_irqinitialize(void) irq_attach(SAM_IRQ_BUSFAULT, sam_busfault); irq_attach(SAM_IRQ_USAGEFAULT, sam_usagefault); irq_attach(SAM_IRQ_PENDSV, sam_pendsv); - irq_attach(SAM_IRQ_DBGMONITOR, sam_dbgmonitor); + irq_attach(SAM_IRQ_DBGMONITOR, sam_errmonitor); irq_attach(SAM_IRQ_RESERVED, sam_reserved); #endif diff --git a/arch/arm/src/samv7/sam_mcan.c b/arch/arm/src/samv7/sam_mcan.c index fe2dfb2c41..d02a094bdf 100644 --- a/arch/arm/src/samv7/sam_mcan.c +++ b/arch/arm/src/samv7/sam_mcan.c @@ -794,23 +794,23 @@ #endif #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo # ifdef CONFIG_SAMV7_MCAN_REGDEBUG -# define canregdbg llerr +# define canregerr llerr # else -# define canregdbg(x...) +# define canregerr(x...) # endif #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) -# define canregdbg(x...) +# define canregerr(x...) #endif /**************************************************************************** @@ -1502,7 +1502,7 @@ static void mcan_buffer_reserve(FAR struct sam_mcan_s *priv) if (sval > 0) { - candbg("ERROR: TX FIFOQ full but txfsem is %d\n", sval); + canerr("ERROR: TX FIFOQ full but txfsem is %d\n", sval); sem_reset(&priv->txfsem, 0); } } @@ -1520,7 +1520,7 @@ static void mcan_buffer_reserve(FAR struct sam_mcan_s *priv) else if (sval <= 0) { - candbg("ERROR: TX FIFOQ not full but txfsem is %d\n", sval); + canerr("ERROR: TX FIFOQ not full but txfsem is %d\n", sval); /* Less than zero means that another thread is waiting */ @@ -1551,7 +1551,7 @@ static void mcan_buffer_reserve(FAR struct sam_mcan_s *priv) if (tffl > priv->config->ntxfifoq) { - candbg("ERROR: TX FIFO reports %d but max is %d\n", + canerr("ERROR: TX FIFO reports %d but max is %d\n", tffl, priv->config->ntxfifoq); tffl = priv->config->ntxfifoq; } @@ -1564,7 +1564,7 @@ static void mcan_buffer_reserve(FAR struct sam_mcan_s *priv) if (sval != tffl) { - candbg("ERROR: TX FIFO reports %d but txfsem is %d\n", tffl, sval); + canerr("ERROR: TX FIFO reports %d but txfsem is %d\n", tffl, sval); /* Reset the semaphore count to the Tx FIFO free level. */ @@ -1620,7 +1620,7 @@ static void mcan_buffer_release(FAR struct sam_mcan_s *priv) } else { - candbg("ERROR: txfsem would increment beyond %d\n", + canerr("ERROR: txfsem would increment beyond %d\n", priv->config->ntxfifoq); } } @@ -2612,7 +2612,7 @@ static int mcan_ioctl(FAR struct can_dev_s *dev, int cmd, unsigned long arg) /* Unsupported/unrecognized command */ default: - candbg("ERROR: Unrecognized command: %04x\n", cmd); + canerr("ERROR: Unrecognized command: %04x\n", cmd); break; } @@ -2756,7 +2756,7 @@ static int mcan_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) } txbuffer[0] = regval; - canregdbg("T0: %08x\n", regval); + canregerr("T0: %08x\n", regval); /* Format word T1: * Data Length Code (DLC) - Value from message structure @@ -2765,7 +2765,7 @@ static int mcan_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) */ txbuffer[1] = BUFFER_R1_DLC(msg->cm_hdr.ch_dlc); - canregdbg("T1: %08x\n", txbuffer[1]); + canregerr("T1: %08x\n", txbuffer[1]); /* Followed by the amount of data corresponding to the DLC (T2..) */ @@ -3194,7 +3194,7 @@ static void mcan_receive(FAR struct can_dev_s *dev, FAR uint32_t *rxbuffer, /* Work R0 contains the CAN ID */ regval = *rxbuffer++; - canregdbg("R0: %08x\n", regval); + canregerr("R0: %08x\n", regval); #ifdef CONFIG_CAN_ERRORS hdr.ch_error = 0; @@ -3240,7 +3240,7 @@ static void mcan_receive(FAR struct can_dev_s *dev, FAR uint32_t *rxbuffer, /* Word R1 contains the DLC and timestamp */ regval = *rxbuffer++; - canregdbg("R1: %08x\n", regval); + canregerr("R1: %08x\n", regval); hdr.ch_dlc = (regval & BUFFER_R1_DLC_MASK) >> BUFFER_R1_DLC_SHIFT; @@ -3935,7 +3935,7 @@ FAR struct can_dev_s *sam_mcan_initialize(int port) else #endif { - candbg("ERROR: Unsupported port %d\n", port); + canerr("ERROR: Unsupported port %d\n", port); return NULL; } diff --git a/arch/arm/src/samv7/sam_oneshot.c b/arch/arm/src/samv7/sam_oneshot.c index bc0fb34015..4400c57d93 100644 --- a/arch/arm/src/samv7/sam_oneshot.c +++ b/arch/arm/src/samv7/sam_oneshot.c @@ -178,7 +178,7 @@ int sam_oneshot_initialize(struct sam_oneshot_s *oneshot, int chan, ret = sam_tc_clockselect(frequency, &cmr, &actual); if (ret < 0) { - tcdbg("ERROR: sam_tc_clockselect failed: %d\n", ret); + tcerr("ERROR: sam_tc_clockselect failed: %d\n", ret); return ret; } @@ -218,7 +218,7 @@ int sam_oneshot_initialize(struct sam_oneshot_s *oneshot, int chan, oneshot->tch = sam_tc_allocate(chan, cmr); if (!oneshot->tch) { - tcdbg("ERROR: Failed to allocate timer channel %d\n", chan); + tcerr("ERROR: Failed to allocate timer channel %d\n", chan); return -EBUSY; } diff --git a/arch/arm/src/samv7/sam_pck.c b/arch/arm/src/samv7/sam_pck.c index c4dc27d029..ddfc7371fa 100644 --- a/arch/arm/src/samv7/sam_pck.c +++ b/arch/arm/src/samv7/sam_pck.c @@ -128,7 +128,7 @@ uint32_t sam_pck_configure(enum pckid_e pckid, enum pckid_clksrc_e clksrc, break; default: - dbg("ERROR: Unknown clock source\n"); + err("ERROR: Unknown clock source\n"); return 0; } @@ -272,7 +272,7 @@ uint32_t sam_pck_frequency(enum pckid_e pckid) break; default: - dbg("ERROR: Unknown clock source\n"); + err("ERROR: Unknown clock source\n"); return 0; } diff --git a/arch/arm/src/samv7/sam_qspi.c b/arch/arm/src/samv7/sam_qspi.c index 6a19f5e83d..ac0446c2a0 100644 --- a/arch/arm/src/samv7/sam_qspi.c +++ b/arch/arm/src/samv7/sam_qspi.c @@ -154,14 +154,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define qspidbg llerr +# define qspierr llerr # ifdef CONFIG_DEBUG_INFO # define qspiinfo llerr # else # define qspiinfo(x...) # endif #else -# define qspidbg(x...) +# define qspierr(x...) # define qspiinfo(x...) #endif @@ -866,7 +866,7 @@ static int qspi_memory_dma(struct sam_qspidev_s *priv, if (ret < 0) { - qspidbg("ERROR: DMA setup failed: %d\n", ret); + qspierr("ERROR: DMA setup failed: %d\n", ret); return ret; } @@ -882,7 +882,7 @@ static int qspi_memory_dma(struct sam_qspidev_s *priv, ret = sam_dmastart(priv->dmach, qspi_dma_callback, (void *)priv); if (ret < 0) { - qspidbg("ERROR: sam_dmastart failed: %d\n", ret); + qspierr("ERROR: sam_dmastart failed: %d\n", ret); return ret; } @@ -903,7 +903,7 @@ static int qspi_memory_dma(struct sam_qspidev_s *priv, (wdentry_t)qspi_dma_timeout, 1, (uint32_t)priv); if (ret != OK) { - qspidbg("ERROR: wd_start failed: %d\n", ret); + qspierr("ERROR: wd_start failed: %d\n", ret); } /* Wait for the DMA complete */ @@ -961,7 +961,7 @@ static int qspi_memory_dma(struct sam_qspidev_s *priv, if (priv->result) { - qspidbg("ERROR: DMA failed with result: %d\n", priv->result); + qspierr("ERROR: DMA failed with result: %d\n", priv->result); } return priv->result; @@ -1778,7 +1778,7 @@ struct qspi_dev_s *sam_qspi_initialize(int intf) else #endif { - qspidbg("ERROR: QSPI%d not supported\n", intf); + qspierr("ERROR: QSPI%d not supported\n", intf); return NULL; } @@ -1801,7 +1801,7 @@ struct qspi_dev_s *sam_qspi_initialize(int intf) priv->dmach = sam_dmachannel(0, 0); if (!priv->dmach) { - qspidbg("ERROR: Failed to allocate the DMA channel\n"); + qspierr("ERROR: Failed to allocate the DMA channel\n"); priv->candma = false; } } @@ -1817,7 +1817,7 @@ struct qspi_dev_s *sam_qspi_initialize(int intf) priv->dmadog = wd_create(); if (priv->dmadog == NULL) { - qspidbg("ERROR: Failed to create wdog\n"); + qspierr("ERROR: Failed to create wdog\n"); goto errout_with_dmahandles; } #endif @@ -1828,7 +1828,7 @@ struct qspi_dev_s *sam_qspi_initialize(int intf) ret = irq_attach(priv->irq, priv->handler); if (ret < 0) { - qspidbg("ERROR: Failed to attach irq %d\n", priv->irq); + qspierr("ERROR: Failed to attach irq %d\n", priv->irq); goto errout_with_dmadog; } #endif @@ -1840,7 +1840,7 @@ struct qspi_dev_s *sam_qspi_initialize(int intf) ret = qspi_hw_initialize(priv); if (ret < 0) { - qspidbg("ERROR: Failed to initialize QSPI hardware\n"); + qspierr("ERROR: Failed to initialize QSPI hardware\n"); goto errout_with_irq; } diff --git a/arch/arm/src/samv7/sam_rswdt.c b/arch/arm/src/samv7/sam_rswdt.c index c241027a19..a176d22d9c 100644 --- a/arch/arm/src/samv7/sam_rswdt.c +++ b/arch/arm/src/samv7/sam_rswdt.c @@ -87,10 +87,10 @@ */ #ifdef CONFIG_DEBUG_WATCHDOG -# define wddbg llerr +# define wderr llerr # define wdinfo llinfo #else -# define wddbg(x...) +# define wderr(x...) # define wdinfo(x...) #endif @@ -463,7 +463,7 @@ static int sam_settimeout(FAR struct watchdog_lowerhalf_s *lower, if (timeout < RSWDT_MINTIMEOUT || timeout >= RSWDT_MAXTIMEOUT) { - wddbg("Cannot represent timeout: %d < %d > %d\n", + wderr("Cannot represent timeout: %d < %d > %d\n", RSWDT_MINTIMEOUT, timeout, RSWDT_MAXTIMEOUT); return -ERANGE; } @@ -574,7 +574,7 @@ static xcpt_t sam_capture(FAR struct watchdog_lowerhalf_s *lower, xcpt_t handler) { #ifndef CONFIG_SAMV7_RSWDT_INTERRUPT - wddbg("ERROR: Not configured for this mode\n"); + wderr("ERROR: Not configured for this mode\n"); return NULL; #else FAR struct sam_lowerhalf_s *priv = (FAR struct sam_lowerhalf_s *)lower; diff --git a/arch/arm/src/samv7/sam_spi.c b/arch/arm/src/samv7/sam_spi.c index 68d997440d..f9fee7548a 100644 --- a/arch/arm/src/samv7/sam_spi.c +++ b/arch/arm/src/samv7/sam_spi.c @@ -136,14 +136,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -1086,7 +1086,7 @@ static uint32_t spi_setfrequency(struct spi_dev_s *dev, uint32_t frequency) spics->frequency = frequency; spics->actual = actual; - spidbg("Frequency %d->%d\n", frequency, actual); + spierr("Frequency %d->%d\n", frequency, actual); return actual; } @@ -1549,7 +1549,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, ret = sam_dmarxsetup(spics->rxdma, regaddr, memaddr, nwords); if (ret < 0) { - dmadbg("ERROR: sam_dmarxsetup failed: %d\n", ret); + dmaerr("ERROR: sam_dmarxsetup failed: %d\n", ret); return; } @@ -1563,7 +1563,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, ret = sam_dmatxsetup(spics->txdma, regaddr, memaddr, nwords); if (ret < 0) { - dmadbg("ERROR: sam_dmatxsetup failed: %d\n", ret); + dmaerr("ERROR: sam_dmatxsetup failed: %d\n", ret); return; } @@ -1575,7 +1575,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, ret = sam_dmastart(spics->rxdma, spi_rxcallback, (void *)spics); if (ret < 0) { - dmadbg("ERROR: RX sam_dmastart failed: %d\n", ret); + dmaerr("ERROR: RX sam_dmastart failed: %d\n", ret); return; } @@ -1584,7 +1584,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, ret = sam_dmastart(spics->txdma, spi_txcallback, (void *)spics); if (ret < 0) { - dmadbg("ERROR: RX sam_dmastart failed: %d\n", ret); + dmaerr("ERROR: RX sam_dmastart failed: %d\n", ret); sam_dmastop(spics->rxdma); return; } @@ -1606,7 +1606,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, (wdentry_t)spi_dmatimeout, 1, (uint32_t)spics); if (ret != OK) { - spidbg("ERROR: wd_start failed: %d\n", ret); + spierr("ERROR: wd_start failed: %d\n", ret); } /* Wait for the DMA complete */ @@ -1657,7 +1657,7 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer, if (spics->result) { - spidbg("ERROR: DMA failed with result: %d\n", spics->result); + spierr("ERROR: DMA failed with result: %d\n", spics->result); } } #endif /* CONFIG_SAMV7_SPI_DMA */ @@ -1770,7 +1770,7 @@ FAR struct spi_dev_s *sam_spibus_initialize(int port) spics = (struct sam_spics_s *)zalloc(sizeof(struct sam_spics_s)); if (!spics) { - spidbg("ERROR: Failed to allocate a chip select structure\n"); + spierr("ERROR: Failed to allocate a chip select structure\n"); return NULL; } @@ -1790,7 +1790,7 @@ FAR struct spi_dev_s *sam_spibus_initialize(int port) spics->rxdma = sam_dmachannel(0, 0); if (!spics->rxdma) { - spidbg("ERROR: Failed to allocate the RX DMA channel\n"); + spierr("ERROR: Failed to allocate the RX DMA channel\n"); spics->candma = false; } } @@ -1800,7 +1800,7 @@ FAR struct spi_dev_s *sam_spibus_initialize(int port) spics->txdma = sam_dmachannel(0, 0); if (!spics->txdma) { - spidbg("ERROR: Failed to allocate the TX DMA channel\n"); + spierr("ERROR: Failed to allocate the TX DMA channel\n"); sam_dmafree(spics->rxdma); spics->rxdma = NULL; spics->candma = false; diff --git a/arch/arm/src/samv7/sam_spi_slave.c b/arch/arm/src/samv7/sam_spi_slave.c index 5d8d4987e6..f854b11ba0 100644 --- a/arch/arm/src/samv7/sam_spi_slave.c +++ b/arch/arm/src/samv7/sam_spi_slave.c @@ -85,14 +85,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -464,7 +464,7 @@ static int spi_interrupt(struct sam_spidev_s *priv) { /* If debug is enabled, report any overrun errors */ - spidbg("Error: Overrun (OVRES): %08x\n", pending); + spierr("Error: Overrun (OVRES): %08x\n", pending); /* OVRES was cleared by the status read. */ } @@ -531,7 +531,7 @@ static int spi_interrupt(struct sam_spidev_s *priv) { /* If debug is enabled, report any overrun errors */ - spidbg("Error: Underrun (UNDEX): %08x\n", pending); + spierr("Error: Underrun (UNDEX): %08x\n", pending); /* UNDES was cleared by the status read. */ } diff --git a/arch/arm/src/samv7/sam_ssc.c b/arch/arm/src/samv7/sam_ssc.c index bc3d7644e4..d83471706c 100644 --- a/arch/arm/src/samv7/sam_ssc.c +++ b/arch/arm/src/samv7/sam_ssc.c @@ -387,16 +387,16 @@ #endif #ifdef CONFIG_DEBUG_I2S -# define i2sdbg dbg +# define i2serr err # define i2sllerr llerr # ifdef CONFIG_DEBUG_INFO -# define i2sinfo dbg +# define i2sinfo err # define i2sllinfo llerr # else # define i2sinfo(x...) # endif #else -# define i2sdbg(x...) +# define i2serr(x...) # define i2sllerr(x...) # define i2sinfo(x...) # define i2sllinfo(x...) @@ -2054,7 +2054,7 @@ static int ssc_checkwidth(struct sam_ssc_s *priv, int bits) break; default: - i2sdbg("ERROR: Unsupported or invalid data width: %d\n", bits); + i2serr("ERROR: Unsupported or invalid data width: %d\n", bits); return (bits < 2 || bits > 32) ? -EINVAL : -ENOSYS; } @@ -2132,7 +2132,7 @@ static uint32_t ssc_rxdatawidth(struct i2s_dev_s *dev, int bits) ret = ssc_checkwidth(priv, bits); if (ret < 0) { - i2sdbg("ERROR: ssc_checkwidth failed: %d\n", ret); + i2serr("ERROR: ssc_checkwidth failed: %d\n", ret); return 0; } @@ -2141,7 +2141,7 @@ static uint32_t ssc_rxdatawidth(struct i2s_dev_s *dev, int bits) ret = ssc_dma_flags(priv, &dmaflags); if (ret < 0) { - i2sdbg("ERROR: ssc_dma_flags failed: %d\n", ret); + i2serr("ERROR: ssc_dma_flags failed: %d\n", ret); return 0; } @@ -2230,7 +2230,7 @@ static int ssc_receive(struct i2s_dev_s *dev, struct ap_buffer_s *apb, if (!priv->rxenab) { - i2sdbg("ERROR: SSC%d has no receiver\n", priv->sscno); + i2serr("ERROR: SSC%d has no receiver\n", priv->sscno); ret = -EAGAIN; goto errout_with_exclsem; } @@ -2269,7 +2269,7 @@ errout_with_exclsem: return ret; #else - i2sdbg("ERROR: SSC%d has no receiver\n", priv->sscno); + i2serr("ERROR: SSC%d has no receiver\n", priv->sscno); UNUSED(priv); return -ENOSYS; #endif @@ -2343,7 +2343,7 @@ static uint32_t ssc_txdatawidth(struct i2s_dev_s *dev, int bits) ret = ssc_checkwidth(priv, bits); if (ret < 0) { - i2sdbg("ERROR: ssc_checkwidth failed: %d\n", ret); + i2serr("ERROR: ssc_checkwidth failed: %d\n", ret); return 0; } @@ -2352,7 +2352,7 @@ static uint32_t ssc_txdatawidth(struct i2s_dev_s *dev, int bits) ret = ssc_dma_flags(priv, &dmaflags); if (ret < 0) { - i2sdbg("ERROR: ssc_dma_flags failed: %d\n", ret); + i2serr("ERROR: ssc_dma_flags failed: %d\n", ret); return 0; } @@ -2447,7 +2447,7 @@ static int ssc_send(struct i2s_dev_s *dev, struct ap_buffer_s *apb, if (!priv->txenab) { - i2sdbg("ERROR: SSC%d has no transmitter\n", priv->sscno); + i2serr("ERROR: SSC%d has no transmitter\n", priv->sscno); ret = -EAGAIN; goto errout_with_exclsem; } @@ -2486,7 +2486,7 @@ errout_with_exclsem: return ret; #else - i2sdbg("ERROR: SSC%d has no transmitter\n", priv->sscno); + i2serr("ERROR: SSC%d has no transmitter\n", priv->sscno); UNUSED(priv); return -ENOSYS; #endif @@ -2540,7 +2540,7 @@ static int ssc_rx_configure(struct sam_ssc_s *priv) case SSC_CLKSRC_NONE: /* No clock */ default: - i2sdbg("ERROR: No receiver clock\n"); + i2serr("ERROR: No receiver clock\n"); return -EINVAL; } @@ -2561,7 +2561,7 @@ static int ssc_rx_configure(struct sam_ssc_s *priv) break; default: - i2sdbg("ERROR: Invalid clock output selection\n"); + i2serr("ERROR: Invalid clock output selection\n"); return -EINVAL; } @@ -2665,7 +2665,7 @@ static int ssc_tx_configure(struct sam_ssc_s *priv) case SSC_CLKSRC_NONE: /* No clock */ default: - i2sdbg("ERROR: No transmitter clock\n"); + i2serr("ERROR: No transmitter clock\n"); return -EINVAL; } @@ -2686,7 +2686,7 @@ static int ssc_tx_configure(struct sam_ssc_s *priv) break; default: - i2sdbg("ERROR: Invalid clock output selection\n"); + i2serr("ERROR: Invalid clock output selection\n"); return -EINVAL; } @@ -2945,7 +2945,7 @@ static int ssc_dma_flags(struct sam_ssc_s *priv, uint32_t *dmaflags) break; default: - i2sdbg("ERROR: Unsupported data width: %d\n", priv->datalen); + i2serr("ERROR: Unsupported data width: %d\n", priv->datalen); return -ENOSYS; } @@ -2978,7 +2978,7 @@ static int ssc_dma_allocate(struct sam_ssc_s *priv) ret = ssc_dma_flags(priv, &dmaflags); if (ret < 0) { - i2sdbg("ERROR: ssc_dma_flags failed: %d\n", ret); + i2serr("ERROR: ssc_dma_flags failed: %d\n", ret); return ret; } @@ -2992,7 +2992,7 @@ static int ssc_dma_allocate(struct sam_ssc_s *priv) priv->rx.dma = sam_dmachannel(0, dmaflags); if (!priv->rx.dma) { - i2sdbg("ERROR: Failed to allocate the RX DMA channel\n"); + i2serr("ERROR: Failed to allocate the RX DMA channel\n"); goto errout; } @@ -3001,7 +3001,7 @@ static int ssc_dma_allocate(struct sam_ssc_s *priv) priv->rx.dog = wd_create(); if (!priv->rx.dog) { - i2sdbg("ERROR: Failed to create the RX DMA watchdog\n"); + i2serr("ERROR: Failed to create the RX DMA watchdog\n"); goto errout; } } @@ -3015,7 +3015,7 @@ static int ssc_dma_allocate(struct sam_ssc_s *priv) priv->tx.dma = sam_dmachannel(0, dmaflags); if (!priv->tx.dma) { - i2sdbg("ERROR: Failed to allocate the TX DMA channel\n"); + i2serr("ERROR: Failed to allocate the TX DMA channel\n"); goto errout; } @@ -3024,7 +3024,7 @@ static int ssc_dma_allocate(struct sam_ssc_s *priv) priv->tx.dog = wd_create(); if (!priv->tx.dog) { - i2sdbg("ERROR: Failed to create the TX DMA watchdog\n"); + i2serr("ERROR: Failed to create the TX DMA watchdog\n"); goto errout; } } @@ -3415,7 +3415,7 @@ struct i2s_dev_s *sam_ssc_initialize(int port) priv = (struct sam_ssc_s *)zalloc(sizeof(struct sam_ssc_s)); if (!priv) { - i2sdbg("ERROR: Failed to allocate a chip select structure\n"); + i2serr("ERROR: Failed to allocate a chip select structure\n"); return NULL; } @@ -3449,7 +3449,7 @@ struct i2s_dev_s *sam_ssc_initialize(int port) else #endif /* CONFIG_SAMV7_SSC1 */ { - i2sdbg("ERROR: Unsupported I2S port: %d\n", port); + i2serr("ERROR: Unsupported I2S port: %d\n", port); goto errout_with_alloc; } @@ -3470,7 +3470,7 @@ struct i2s_dev_s *sam_ssc_initialize(int port) ret = ssc_rx_configure(priv); if (ret < 0) { - i2sdbg("ERROR: Failed to configure the receiver: %d\n", ret); + i2serr("ERROR: Failed to configure the receiver: %d\n", ret); goto errout_with_clocking; } @@ -3479,7 +3479,7 @@ struct i2s_dev_s *sam_ssc_initialize(int port) ret = ssc_tx_configure(priv); if (ret < 0) { - i2sdbg("ERROR: Failed to configure the transmitter: %d\n", ret); + i2serr("ERROR: Failed to configure the transmitter: %d\n", ret); goto errout_with_clocking; } diff --git a/arch/arm/src/samv7/sam_tc.c b/arch/arm/src/samv7/sam_tc.c index 30ac1a8fb6..50f2bad062 100644 --- a/arch/arm/src/samv7/sam_tc.c +++ b/arch/arm/src/samv7/sam_tc.c @@ -1066,7 +1066,7 @@ static int sam_tc_mcksrc(uint32_t frequency, uint32_t *tcclks, { /* If no divisor can be found, return -ERANGE */ - tcdbg("Lower bound search failed\n"); + tcerr("Lower bound search failed\n"); return -ERANGE; } @@ -1169,7 +1169,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) { /* Timer/counter is not invalid or not enabled */ - tcdbg("ERROR: Bad channel number: %d\n", channel); + tcerr("ERROR: Bad channel number: %d\n", channel); return NULL; } @@ -1225,7 +1225,7 @@ static inline struct sam_chan_s *sam_tc_initialize(int channel) { /* Yes.. return a failure */ - tcdbg("Channel %d is in-use\n", channel); + tcerr("Channel %d is in-use\n", channel); sam_givesem(tc); return NULL; } diff --git a/arch/arm/src/samv7/sam_tc.h b/arch/arm/src/samv7/sam_tc.h index bf6f279703..508b297f09 100644 --- a/arch/arm/src/samv7/sam_tc.h +++ b/arch/arm/src/samv7/sam_tc.h @@ -87,12 +87,12 @@ /* Timer/counter debug output */ #ifdef CONFIG_SAMV7_TC_DEBUG -# define tcdbg dbg +# define tcerr err # define tcinfo info # define tcllerr llerr # define tcllinfo llinfo #else -# define tcdbg(x...) +# define tcerr(x...) # define tcinfo(x...) # define tcllerr(x...) # define tcllinfo(x...) diff --git a/arch/arm/src/samv7/sam_trng.c b/arch/arm/src/samv7/sam_trng.c index 392e6af70f..7dc29a77d8 100644 --- a/arch/arm/src/samv7/sam_trng.c +++ b/arch/arm/src/samv7/sam_trng.c @@ -363,7 +363,7 @@ void up_rnginitialize(void) if (irq_attach(SAM_IRQ_TRNG, sam_interrupt)) { - fdbg("ERROR: Failed to attach to IRQ%d\n", SAM_IRQ_TRNG); + ferr("ERROR: Failed to attach to IRQ%d\n", SAM_IRQ_TRNG); return; } @@ -380,7 +380,7 @@ void up_rnginitialize(void) ret = register_driver("/dev/random", &g_trngops, 0644, NULL); if (ret < 0) { - fdbg("ERROR: Failed to register /dev/random\n"); + ferr("ERROR: Failed to register /dev/random\n"); return; } diff --git a/arch/arm/src/samv7/sam_twihs.c b/arch/arm/src/samv7/sam_twihs.c index 9319b2b65f..67f989d842 100644 --- a/arch/arm/src/samv7/sam_twihs.c +++ b/arch/arm/src/samv7/sam_twihs.c @@ -124,12 +124,12 @@ /* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */ #ifdef CONFIG_DEBUG_I2C -# define i2cdbg dbg +# define i2cerr err # define i2cinfo info # define i2cllerr llerr # define i2cllinfo llinfo #else -# define i2cdbg(x...) +# define i2cerr(x...) # define i2cinfo(x...) # define i2cllerr(x...) # define i2cllinfo(x...) @@ -917,7 +917,7 @@ static int twi_transfer(FAR struct i2c_master_s *dev, ret = twi_wait(priv, size); if (ret < 0) { - i2cdbg("ERROR: Transfer failed: %d\n", ret); + i2cerr("ERROR: Transfer failed: %d\n", ret); } leave_critical_section(flags); @@ -1303,7 +1303,7 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) else #endif { - i2cdbg("ERROR: Unsupported bus: TWIHS%d\n", bus); + i2cerr("ERROR: Unsupported bus: TWIHS%d\n", bus); return NULL; } @@ -1320,7 +1320,7 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) priv->timeout = wd_create(); if (priv->timeout == NULL) { - idbg("ERROR: Failed to allocate a timer\n"); + ierr("ERROR: Failed to allocate a timer\n"); goto errout_with_irq; } @@ -1329,7 +1329,7 @@ struct i2c_master_s *sam_i2cbus_initialize(int bus) ret = irq_attach(priv->attr->irq, priv->attr->handler); if (ret < 0) { - idbg("ERROR: Failed to attach irq %d\n", priv->attr->irq); + ierr("ERROR: Failed to attach irq %d\n", priv->attr->irq); goto errout_with_wdog; } diff --git a/arch/arm/src/samv7/sam_usbdevhs.c b/arch/arm/src/samv7/sam_usbdevhs.c index cb58f3bff1..8c8cde272a 100644 --- a/arch/arm/src/samv7/sam_usbdevhs.c +++ b/arch/arm/src/samv7/sam_usbdevhs.c @@ -4692,7 +4692,7 @@ static void sam_sw_setup(struct sam_usbdev_s *priv) kmm_memalign(16, CONFIG_SAMV7_USBDEVHS_NDTDS * sizeof(struct sam_dtd_s)); if (!priv->dtdpool) { - udbg("ERROR: Failed to allocate the DMA transfer descriptor pool\n"); + uerr("ERROR: Failed to allocate the DMA transfer descriptor pool\n"); return NULL; } diff --git a/arch/arm/src/samv7/sam_wdt.c b/arch/arm/src/samv7/sam_wdt.c index b8d59b9363..e55405785c 100644 --- a/arch/arm/src/samv7/sam_wdt.c +++ b/arch/arm/src/samv7/sam_wdt.c @@ -87,10 +87,10 @@ */ #ifdef CONFIG_DEBUG_WATCHDOG -# define wddbg llerr +# define wderr llerr # define wdinfo llinfo #else -# define wddbg(x...) +# define wderr(x...) # define wdinfo(x...) #endif @@ -463,7 +463,7 @@ static int sam_settimeout(FAR struct watchdog_lowerhalf_s *lower, if (timeout < WDT_MINTIMEOUT || timeout >= WDT_MAXTIMEOUT) { - wddbg("Cannot represent timeout: %d < %d > %d\n", + wderr("Cannot represent timeout: %d < %d > %d\n", WDT_MINTIMEOUT, timeout, WDT_MAXTIMEOUT); return -ERANGE; } @@ -574,7 +574,7 @@ static xcpt_t sam_capture(FAR struct watchdog_lowerhalf_s *lower, xcpt_t handler) { #ifndef CONFIG_SAMV7_WDT_INTERRUPT - wddbg("ERROR: Not configured for this mode\n"); + wderr("ERROR: Not configured for this mode\n"); return NULL; #else FAR struct sam_lowerhalf_s *priv = (FAR struct sam_lowerhalf_s *)lower; diff --git a/arch/arm/src/samv7/sam_xdmac.c b/arch/arm/src/samv7/sam_xdmac.c index c9a2591f37..24a5eaf9fa 100644 --- a/arch/arm/src/samv7/sam_xdmac.c +++ b/arch/arm/src/samv7/sam_xdmac.c @@ -551,7 +551,7 @@ static uint8_t sam_channel(uint8_t pid, const struct sam_pidmap_s *table, } } - dmadbg("No channel found for pid %d\n", pid); + dmaerr("No channel found for pid %d\n", pid); DEBUGPANIC(); return 0x3f; } @@ -1702,7 +1702,7 @@ DMA_HANDLE sam_dmachannel(uint8_t dmacno, uint32_t chflags) } else { - dmadbg("ERROR: Failed allocate XDMAC%d channel\n", (int)dmacno); + dmaerr("ERROR: Failed allocate XDMAC%d channel\n", (int)dmacno); } return (DMA_HANDLE)xdmach; @@ -2076,28 +2076,28 @@ void sam_dmadump(DMA_HANDLE handle, const struct sam_dmaregs_s *regs, { struct sam_xdmach_s *xdmach = (struct sam_xdmach_s *)handle; - dmadbg("%s\n", msg); - dmadbg(" DMA Global Registers:\n"); - dmadbg(" GTYPE[%08x]: %08x\n", SAM_XDMAC_GTYPE, regs->gtype); - dmadbg(" GCFG[%08x]: %08x\n", SAM_XDMAC_GCFG, regs->gcfg); - dmadbg(" GWAC[%08x]: %08x\n", SAM_XDMAC_GWAC, regs->gwac); - dmadbg(" GIM[%08x]: %08x\n", SAM_XDMAC_GIM, regs->gim); - dmadbg(" GS[%08x]: %08x\n", SAM_XDMAC_GS, regs->gs); - dmadbg(" GRS[%08x]: %08x\n", SAM_XDMAC_GRS, regs->grs); - dmadbg(" GWS[%08x]: %08x\n", SAM_XDMAC_GWS, regs->gws); - dmadbg(" GSWS[%08x]: %08x\n", SAM_XDMAC_GSWS, regs->gsws); - dmadbg(" DMA Channel Registers:\n"); - dmadbg(" CIM[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CIM_OFFSET, regs->cim); - dmadbg(" CSA[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CSA_OFFSET, regs->csa); - dmadbg(" CDA[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CDA_OFFSET, regs->cda); - dmadbg(" CNDA[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CNDA_OFFSET, regs->cnda); - dmadbg(" CNDC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CNDC_OFFSET, regs->cndc); - dmadbg(" CUBC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CUBC_OFFSET, regs->cubc); - dmadbg(" CBC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CBC_OFFSET, regs->cbc); - dmadbg(" CC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CC_OFFSET, regs->cc); - dmadbg(" CDSMSP[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CDSMSP_OFFSET, regs->cdsmsp); - dmadbg(" CSUS[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CSUS_OFFSET, regs->csus); - dmadbg(" CDUS[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CDUS_OFFSET, regs->cdus); + dmaerr("%s\n", msg); + dmaerr(" DMA Global Registers:\n"); + dmaerr(" GTYPE[%08x]: %08x\n", SAM_XDMAC_GTYPE, regs->gtype); + dmaerr(" GCFG[%08x]: %08x\n", SAM_XDMAC_GCFG, regs->gcfg); + dmaerr(" GWAC[%08x]: %08x\n", SAM_XDMAC_GWAC, regs->gwac); + dmaerr(" GIM[%08x]: %08x\n", SAM_XDMAC_GIM, regs->gim); + dmaerr(" GS[%08x]: %08x\n", SAM_XDMAC_GS, regs->gs); + dmaerr(" GRS[%08x]: %08x\n", SAM_XDMAC_GRS, regs->grs); + dmaerr(" GWS[%08x]: %08x\n", SAM_XDMAC_GWS, regs->gws); + dmaerr(" GSWS[%08x]: %08x\n", SAM_XDMAC_GSWS, regs->gsws); + dmaerr(" DMA Channel Registers:\n"); + dmaerr(" CIM[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CIM_OFFSET, regs->cim); + dmaerr(" CSA[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CSA_OFFSET, regs->csa); + dmaerr(" CDA[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CDA_OFFSET, regs->cda); + dmaerr(" CNDA[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CNDA_OFFSET, regs->cnda); + dmaerr(" CNDC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CNDC_OFFSET, regs->cndc); + dmaerr(" CUBC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CUBC_OFFSET, regs->cubc); + dmaerr(" CBC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CBC_OFFSET, regs->cbc); + dmaerr(" CC[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CC_OFFSET, regs->cc); + dmaerr(" CDSMSP[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CDSMSP_OFFSET, regs->cdsmsp); + dmaerr(" CSUS[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CSUS_OFFSET, regs->csus); + dmaerr(" CDUS[%08x]: %08x\n", xdmach->base + SAM_XDMACH_CDUS_OFFSET, regs->cdus); } #endif /* CONFIG_DEBUG_DMA */ #endif /* CONFIG_SAMV7_XDMAC */ diff --git a/arch/arm/src/stm32/stm32_adc.c b/arch/arm/src/stm32/stm32_adc.c index ac8d4636c2..d730923a22 100644 --- a/arch/arm/src/stm32/stm32_adc.c +++ b/arch/arm/src/stm32/stm32_adc.c @@ -906,7 +906,7 @@ static int adc_timinit(FAR struct stm32_dev_s *priv) if (prescaler < 1) { - adbg("WARNING: Prescaler underflowed.\n"); + aerr("WARNING: Prescaler underflowed.\n"); prescaler = 1; } @@ -914,7 +914,7 @@ static int adc_timinit(FAR struct stm32_dev_s *priv) else if (prescaler > 65536) { - adbg("WARNING: Prescaler overflowed.\n"); + aerr("WARNING: Prescaler overflowed.\n"); prescaler = 65536; } @@ -923,12 +923,12 @@ static int adc_timinit(FAR struct stm32_dev_s *priv) reload = timclk / priv->freq; if (reload < 1) { - adbg("WARNING: Reload value underflowed.\n"); + aerr("WARNING: Reload value underflowed.\n"); reload = 1; } else if (reload > 65535) { - adbg("WARNING: Reload value overflowed.\n"); + aerr("WARNING: Reload value overflowed.\n"); reload = 65535; } @@ -1070,7 +1070,7 @@ static int adc_timinit(FAR struct stm32_dev_s *priv) break; default: - adbg("No such trigger: %d\n", priv->trigger); + aerr("No such trigger: %d\n", priv->trigger); return -EINVAL; } @@ -2002,7 +2002,7 @@ static void adc_reset(FAR struct adc_dev_s *dev) ret = adc_timinit(priv); if (ret < 0) { - adbg("adc_timinit failed: %d\n", ret); + aerr("adc_timinit failed: %d\n", ret); } } #ifndef CONFIG_ADC_NO_STARTUP_CONV @@ -2680,7 +2680,7 @@ static int adc_ioctl(FAR struct adc_dev_s *dev, int cmd, unsigned long arg) #endif /* CONFIG_STM32_STM32L15XX */ default: - adbg("ERROR: Unknown cmd: %d\n", cmd); + aerr("ERROR: Unknown cmd: %d\n", cmd); ret = -ENOTTY; break; } @@ -3012,7 +3012,7 @@ struct adc_dev_s *stm32_adcinitialize(int intf, FAR const uint8_t *chanlist, break; #endif default: - adbg("No ADC interface defined\n"); + aerr("No ADC interface defined\n"); return NULL; } diff --git a/arch/arm/src/stm32/stm32_can.c b/arch/arm/src/stm32/stm32_can.c index 73feb048c7..34c326cfe8 100644 --- a/arch/arm/src/stm32/stm32_can.c +++ b/arch/arm/src/stm32/stm32_can.c @@ -85,12 +85,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -1745,7 +1745,7 @@ FAR struct can_dev_s *stm32_caninitialize(int port) else #endif { - candbg("ERROR: Unsupported port %d\n", port); + canerr("ERROR: Unsupported port %d\n", port); return NULL; } diff --git a/arch/arm/src/stm32/stm32_dac.c b/arch/arm/src/stm32/stm32_dac.c index 9f879f3166..a2cfcea92f 100644 --- a/arch/arm/src/stm32/stm32_dac.c +++ b/arch/arm/src/stm32/stm32_dac.c @@ -852,7 +852,7 @@ static int dac_timinit(FAR struct stm32_chan_s *chan) break; #endif default: - adbg("Could not enable timer\n"); + aerr("Could not enable timer\n"); break; } @@ -1016,7 +1016,7 @@ static int dac_chaninit(FAR struct stm32_chan_s *chan) chan->dma = stm32_dmachannel(chan->dmachan); if (!chan->dma) { - adbg("Failed to allocate a DMA channel\n"); + aerr("Failed to allocate a DMA channel\n"); return -EBUSY; } @@ -1025,7 +1025,7 @@ static int dac_chaninit(FAR struct stm32_chan_s *chan) ret = dac_timinit(chan); if (ret < 0) { - adbg("Failed to initialize the DMA timer: %d\n", ret); + aerr("Failed to initialize the DMA timer: %d\n", ret); return ret; } } @@ -1128,7 +1128,7 @@ FAR struct dac_dev_s *stm32_dacinitialize(int intf) else #endif { - adbg("No such DAC interface: %d\n", intf); + aerr("No such DAC interface: %d\n", intf); errno = ENODEV; return NULL; } @@ -1138,7 +1138,7 @@ FAR struct dac_dev_s *stm32_dacinitialize(int intf) ret = dac_blockinit(); if (ret < 0) { - adbg("Failed to initialize the DAC block: %d\n", ret); + aerr("Failed to initialize the DAC block: %d\n", ret); errno = -ret; return NULL; } @@ -1149,7 +1149,7 @@ FAR struct dac_dev_s *stm32_dacinitialize(int intf) ret = dac_chaninit(chan); if (ret < 0) { - adbg("Failed to initialize DAC channel %d: %d\n", intf, ret); + aerr("Failed to initialize DAC channel %d: %d\n", intf, ret); errno = -ret; return NULL; } diff --git a/arch/arm/src/stm32/stm32_dma2d.c b/arch/arm/src/stm32/stm32_dma2d.c index 213e4bfa67..06325fe28d 100644 --- a/arch/arm/src/stm32/stm32_dma2d.c +++ b/arch/arm/src/stm32/stm32_dma2d.c @@ -137,10 +137,10 @@ /* Debug option */ #ifdef CONFIG_STM32_DMA2D_REGDEBUG -# define regdbg dbg +# define regerr err # define reginfo info #else -# define regdbg(x...) +# define regerr(x...) # define reginfo(x...) #endif @@ -469,7 +469,7 @@ static int stm32_dma2dirq(int irq, void *context) if (ret != OK) { - dbg("sem_post() failed\n"); + err("sem_post() failed\n"); return ret; } } @@ -512,7 +512,7 @@ static int stm32_dma2d_waitforirq(void) if (ret != OK) { - dbg("sem_wait() failed\n"); + err("sem_wait() failed\n"); return ret; } } @@ -711,7 +711,7 @@ static int stm32_dma2d_pixelformat(uint8_t fmt, uint8_t *fmtmap) break; #endif default: - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } @@ -756,7 +756,7 @@ static int stm32_dma2d_bpp(uint8_t fmt, uint8_t *bpp) break; #endif default: - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } @@ -1055,7 +1055,7 @@ static int stm32_dma2d_loutpfc(FAR const struct stm32_dma2d_s *layer) { /* Destination layer doesn't support CLUT output */ - gdbg("ERROR: Returning ENOSYS, " + gerr("ERROR: Returning ENOSYS, " "output to layer with CLUT format not supported.\n"); return -ENOSYS; } @@ -1183,7 +1183,7 @@ static int stm32_dma2dgetvideoinfo(FAR struct dma2d_layer_s *layer, return OK; } - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -ENOSYS; } @@ -1220,7 +1220,7 @@ static int stm32_dma2dgetplaneinfo(FAR struct dma2d_layer_s *layer, int planeno, return OK; } - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } @@ -1254,7 +1254,7 @@ static int stm32_dma2dgetlid(FAR struct dma2d_layer_s *layer, int *lid) return OK; } - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } @@ -1320,13 +1320,13 @@ static int stm32_dma2dsetclut(FAR struct dma2d_layer_s *layer, if (priv->fmt != DMA2D_PF_L8) { - gdbg("Error: CLUT is not supported for the pixel format: %d\n", + gerr("Error: CLUT is not supported for the pixel format: %d\n", priv->vinfo.fmt); ret = -EINVAL; } else if (cmap->first >= STM32_DMA2D_NCLUT) { - gdbg("Error: only %d color table entries supported\n", + gerr("Error: only %d color table entries supported\n", STM32_DMA2D_NCLUT); ret = -EINVAL; } @@ -1374,7 +1374,7 @@ static int stm32_dma2dsetclut(FAR struct dma2d_layer_s *layer, return ret; } - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } @@ -1409,13 +1409,13 @@ static int stm32_dma2dgetclut(FAR struct dma2d_layer_s *layer, if (priv->fmt != DMA2D_PF_L8) { - gdbg("Error: CLUT is not supported for the pixel format: %d\n", + gerr("Error: CLUT is not supported for the pixel format: %d\n", priv->vinfo.fmt); ret = -EINVAL; } else if (cmap->first >= STM32_DMA2D_NCLUT) { - gdbg("Error: only %d color table entries supported\n", + gerr("Error: only %d color table entries supported\n", STM32_DMA2D_NCLUT); ret = -EINVAL; } @@ -1461,7 +1461,7 @@ static int stm32_dma2dgetclut(FAR struct dma2d_layer_s *layer, return ret; } - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } #endif @@ -1502,7 +1502,7 @@ static int stm32_dma2dsetalpha(FAR struct dma2d_layer_s *layer, uint8_t alpha) return OK; } - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } @@ -1537,7 +1537,7 @@ static int stm32_dma2dgetalpha(FAR struct dma2d_layer_s *layer, uint8_t *alpha) return OK; } - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } @@ -1588,7 +1588,7 @@ static int stm32_dma2dsetblendmode(FAR struct dma2d_layer_s *layer, return OK; } - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } @@ -1624,7 +1624,7 @@ static int stm32_dma2dgetblendmode(FAR struct dma2d_layer_s *layer, return OK; } - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } @@ -1718,7 +1718,7 @@ static int stm32_dma2dblit(FAR struct dma2d_layer_s *dest, if (ret != OK) { ret = -ECANCELED; - gdbg("ERROR: Returning ECANCELED\n"); + gerr("ERROR: Returning ECANCELED\n"); } } @@ -1727,7 +1727,7 @@ static int stm32_dma2dblit(FAR struct dma2d_layer_s *dest, else { ret = -EINVAL; - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); } return ret; @@ -1832,7 +1832,7 @@ static int stm32_dma2dblend(FAR struct dma2d_layer_s *dest, if (ret != OK) { ret = -ECANCELED; - gdbg("ERROR: Returning ECANCELED\n"); + gerr("ERROR: Returning ECANCELED\n"); } } @@ -1841,7 +1841,7 @@ static int stm32_dma2dblend(FAR struct dma2d_layer_s *dest, else { ret = -EINVAL; - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); } return ret; @@ -1912,7 +1912,7 @@ static int stm32_dma2dfillarea(FAR struct dma2d_layer_s *layer, if (ret != OK) { ret = -ECANCELED; - gdbg("ERROR: Returning ECANCELED\n"); + gerr("ERROR: Returning ECANCELED\n"); } } @@ -1921,7 +1921,7 @@ static int stm32_dma2dfillarea(FAR struct dma2d_layer_s *layer, else { ret = -EINVAL; - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); } return ret; @@ -1954,7 +1954,7 @@ FAR struct dma2d_layer_s * up_dma2dgetlayer(int lid) return &priv->dma2d; } - gdbg("ERROR: EINVAL, Unknown layer identifier\n"); + gerr("ERROR: EINVAL, Unknown layer identifier\n"); errno = EINVAL; return NULL; } @@ -2069,19 +2069,19 @@ FAR struct dma2d_layer_s *up_dma2dcreatelayer(fb_coord_t width, /* free the layer struture */ kmm_free(layer); - gdbg("ERROR: ENOMEM, Unable to allocate layer buffer\n"); + gerr("ERROR: ENOMEM, Unable to allocate layer buffer\n"); errno = ENOMEM; } } else { - gdbg("ERROR: ENOMEM, unable to allocate layer structure\n"); + gerr("ERROR: ENOMEM, unable to allocate layer structure\n"); errno = ENOMEM; } } else { - gdbg("ERROR: EINVAL, no free layer available\n"); + gerr("ERROR: EINVAL, no free layer available\n"); errno = EINVAL; } @@ -2148,7 +2148,7 @@ int up_dma2dremovelayer(FAR struct dma2d_layer_s *layer) int up_dma2dinitialize(void) { - dbg("Initialize DMA2D driver\n"); + err("Initialize DMA2D driver\n"); if (g_initialized == false) { @@ -2272,7 +2272,7 @@ FAR struct dma2d_layer_s * stm32_dma2dinitltdc(FAR struct stm32_ltdc_s *layer) if (ret != OK) { - dbg("Returning -EINVAL, unsupported pixel format: %d\n", + err("Returning -EINVAL, unsupported pixel format: %d\n", layer->vinfo.fmt); errno = -EINVAL; return NULL; diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index 837289db1e..e2708372ba 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -2447,12 +2447,12 @@ static int stm32_ifup(struct net_driver_s *dev) int ret; #ifdef CONFIG_NET_IPv4 - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); #endif #ifdef CONFIG_NET_IPv6 - ndbg("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + nerr("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2], dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5], dev->d_ipv6addr[6], dev->d_ipv6addr[7]); @@ -2500,7 +2500,7 @@ static int stm32_ifdown(struct net_driver_s *dev) FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)dev->d_private; irqstate_t flags; - ndbg("Taking the network down\n"); + nerr("Taking the network down\n"); /* Disable the Ethernet interrupt */ @@ -3129,7 +3129,7 @@ static int stm32_phyread(uint16_t phydevaddr, uint16_t phyregaddr, uint16_t *val } } - ndbg("MII transfer timed out: phydevaddr: %04x phyregaddr: %04x\n", + nerr("MII transfer timed out: phydevaddr: %04x phyregaddr: %04x\n", phydevaddr, phyregaddr); return -ETIMEDOUT; @@ -3188,7 +3188,7 @@ static int stm32_phywrite(uint16_t phydevaddr, uint16_t phyregaddr, uint16_t val } } - ndbg("MII transfer timed out: phydevaddr: %04x phyregaddr: %04x value: %04x\n", + nerr("MII transfer timed out: phydevaddr: %04x phyregaddr: %04x value: %04x\n", phydevaddr, phyregaddr, value); return -ETIMEDOUT; @@ -3225,7 +3225,7 @@ static inline int stm32_dm9161(FAR struct stm32_ethmac_s *priv) ret = stm32_phyread(CONFIG_STM32_PHYADDR, MII_PHYID1, &phyval); if (ret < 0) { - ndbg("Failed to read the PHY ID1: %d\n", ret); + nerr("Failed to read the PHY ID1: %d\n", ret); return ret; } @@ -3243,7 +3243,7 @@ static inline int stm32_dm9161(FAR struct stm32_ethmac_s *priv) ret = stm32_phyread(CONFIG_STM32_PHYADDR, 16, &phyval); if (ret < 0) { - ndbg("Failed to read the PHY Register 0x10: %d\n", ret); + nerr("Failed to read the PHY Register 0x10: %d\n", ret); return ret; } @@ -3300,7 +3300,7 @@ static int stm32_phyinit(FAR struct stm32_ethmac_s *priv) ret = stm32_phywrite(CONFIG_STM32_PHYADDR, MII_MCR, MII_MCR_RESET); if (ret < 0) { - ndbg("Failed to reset the PHY: %d\n", ret); + nerr("Failed to reset the PHY: %d\n", ret); return ret; } up_mdelay(PHY_RESET_DELAY); @@ -3311,7 +3311,7 @@ static int stm32_phyinit(FAR struct stm32_ethmac_s *priv) ret = stm32_phy_boardinitialize(0); if (ret < 0) { - ndbg("Failed to initialize the PHY: %d\n", ret); + nerr("Failed to initialize the PHY: %d\n", ret); return ret; } #endif @@ -3336,7 +3336,7 @@ static int stm32_phyinit(FAR struct stm32_ethmac_s *priv) ret = stm32_phyread(CONFIG_STM32_PHYADDR, MII_MSR, &phyval); if (ret < 0) { - ndbg("Failed to read the PHY MSR: %d\n", ret); + nerr("Failed to read the PHY MSR: %d\n", ret); return ret; } else if ((phyval & MII_MSR_LINKSTATUS) != 0) @@ -3347,7 +3347,7 @@ static int stm32_phyinit(FAR struct stm32_ethmac_s *priv) if (timeout >= PHY_RETRY_TIMEOUT) { - ndbg("Timed out waiting for link status: %04x\n", phyval); + nerr("Timed out waiting for link status: %04x\n", phyval); return -ETIMEDOUT; } @@ -3356,7 +3356,7 @@ static int stm32_phyinit(FAR struct stm32_ethmac_s *priv) ret = stm32_phywrite(CONFIG_STM32_PHYADDR, MII_MCR, MII_MCR_ANENABLE); if (ret < 0) { - ndbg("Failed to enable auto-negotiation: %d\n", ret); + nerr("Failed to enable auto-negotiation: %d\n", ret); return ret; } @@ -3367,7 +3367,7 @@ static int stm32_phyinit(FAR struct stm32_ethmac_s *priv) ret = stm32_phyread(CONFIG_STM32_PHYADDR, MII_MSR, &phyval); if (ret < 0) { - ndbg("Failed to read the PHY MSR: %d\n", ret); + nerr("Failed to read the PHY MSR: %d\n", ret); return ret; } else if ((phyval & MII_MSR_ANEGCOMPLETE) != 0) @@ -3378,7 +3378,7 @@ static int stm32_phyinit(FAR struct stm32_ethmac_s *priv) if (timeout >= PHY_RETRY_TIMEOUT) { - ndbg("Timed out waiting for auto-negotiation\n"); + nerr("Timed out waiting for auto-negotiation\n"); return -ETIMEDOUT; } @@ -3387,7 +3387,7 @@ static int stm32_phyinit(FAR struct stm32_ethmac_s *priv) ret = stm32_phyread(CONFIG_STM32_PHYADDR, CONFIG_STM32_PHYSR, &phyval); if (ret < 0) { - ndbg("Failed to read PHY status register\n"); + nerr("Failed to read PHY status register\n"); return ret; } @@ -3457,7 +3457,7 @@ static int stm32_phyinit(FAR struct stm32_ethmac_s *priv) ret = stm32_phywrite(CONFIG_STM32_PHYADDR, MII_MCR, phyval); if (ret < 0) { - ndbg("Failed to write the PHY MCR: %d\n", ret); + nerr("Failed to write the PHY MCR: %d\n", ret); return ret; } up_mdelay(PHY_CONFIG_DELAY); @@ -3472,7 +3472,7 @@ static int stm32_phyinit(FAR struct stm32_ethmac_s *priv) #endif #endif - ndbg("Duplex: %s Speed: %d MBps\n", + nerr("Duplex: %s Speed: %d MBps\n", priv->fduplex ? "FULL" : "HALF", priv->mbps100 ? 100 : 10); diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c index 6b4728cf6a..0b81465f4a 100644 --- a/arch/arm/src/stm32/stm32_i2c.c +++ b/arch/arm/src/stm32/stm32_i2c.c @@ -165,10 +165,10 @@ /* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */ #ifdef CONFIG_DEBUG_I2C -# define i2cdbg dbg +# define i2cerr err # define i2cinfo info #else -# define i2cdbg(x...) +# define i2cerr(x...) # define i2cinfo(x...) #endif @@ -859,7 +859,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv, uint32_t statu if (priv->tndx >= (CONFIG_I2C_NTRACE-1)) { - i2cdbg("Trace table overflow\n"); + i2cerr("Trace table overflow\n"); return; } @@ -900,7 +900,7 @@ static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv, if (priv->tndx >= (CONFIG_I2C_NTRACE-1)) { - i2cdbg("Trace table overflow\n"); + i2cerr("Trace table overflow\n"); return; } @@ -1695,7 +1695,7 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s status = stm32_i2c_getstatus(priv); ret = -ETIMEDOUT; - i2cdbg("Timed out: CR1: 0x%04x status: 0x%08x\n", + i2cerr("Timed out: CR1: 0x%04x status: 0x%08x\n", stm32_i2c_getreg(priv, STM32_I2C_CR1_OFFSET), status); /* "Note: When the STOP, START or PEC bit is set, the software must diff --git a/arch/arm/src/stm32/stm32_i2c_alt.c b/arch/arm/src/stm32/stm32_i2c_alt.c index 3ed1e6939d..4ea697320a 100644 --- a/arch/arm/src/stm32/stm32_i2c_alt.c +++ b/arch/arm/src/stm32/stm32_i2c_alt.c @@ -172,10 +172,10 @@ /* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */ #ifdef CONFIG_DEBUG_I2C -# define i2cdbg dbg +# define i2cerr err # define i2cinfo info #else -# define i2cdbg(x...) +# define i2cerr(x...) # define i2cinfo(x...) #endif @@ -867,7 +867,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv, uint16_t statu if (priv->tndx >= (CONFIG_I2C_NTRACE-1)) { - i2cdbg("Trace table overflow\n"); + i2cerr("Trace table overflow\n"); return; } @@ -908,7 +908,7 @@ static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv, if (priv->tndx >= (CONFIG_I2C_NTRACE-1)) { - i2cdbg("Trace table overflow\n"); + i2cerr("Trace table overflow\n"); return; } @@ -1382,7 +1382,7 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) { /* TODO: untested!! */ - i2cdbg(" An empty message has been detected, ignoring and passing to next message.\n"); + i2cerr(" An empty message has been detected, ignoring and passing to next message.\n"); /* Trace event */ @@ -1609,14 +1609,14 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) } else { - i2cdbg("Write mode: next message has an unrecognized flag.\n"); + i2cerr("Write mode: next message has an unrecognized flag.\n"); stm32_i2c_traceevent(priv, I2CEVENT_WRITE_FLAG_ERROR, priv->msgv->flags); } } else { - i2cdbg("Write mode error.\n"); + i2cerr("Write mode error.\n"); stm32_i2c_traceevent(priv, I2CEVENT_WRITE_ERROR, 0); } } @@ -1783,8 +1783,8 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) else { - i2cdbg("I2C read mode no correct state detected\n"); - i2cdbg(" state %i, dcnt=%i\n", status, priv->dcnt); + i2cerr("I2C read mode no correct state detected\n"); + i2cerr(" state %i, dcnt=%i\n", status, priv->dcnt); /* set condition to terminate ISR and wake waiting thread */ @@ -1809,7 +1809,7 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) /* Read rest of the state */ status |= (stm32_i2c_getreg(priv, STM32_I2C_SR2_OFFSET) << 16); - i2cdbg("Empty call to ISR: Stopping ISR\n"); + i2cerr("Empty call to ISR: Stopping ISR\n"); stm32_i2c_traceevent(priv, I2CEVENT_ISR_EMPTY_CALL, 0); } @@ -1833,8 +1833,8 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) status |= (stm32_i2c_getreg(priv, STM32_I2C_SR2_OFFSET) << 16); - i2cdbg(" No correct state detected(start bit, read or write) \n"); - i2cdbg(" state %i\n", status); + i2cerr(" No correct state detected(start bit, read or write) \n"); + i2cerr(" state %i\n", status); /* set condition to terminate ISR and wake waiting thread */ @@ -2126,7 +2126,7 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s status = stm32_i2c_getstatus(priv); ret = -ETIMEDOUT; - i2cdbg("Timed out: CR1: 0x%04x status: 0x%08x\n", + i2cerr("Timed out: CR1: 0x%04x status: 0x%08x\n", stm32_i2c_getreg(priv, STM32_I2C_CR1_OFFSET), status); /* "Note: When the STOP, START or PEC bit is set, the software must @@ -2156,7 +2156,7 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s * Note: this commentary is found in both places. * */ - i2cdbg("Check if the address was valid\n"); + i2cerr("Check if the address was valid\n"); stm32_i2c_sendstop(priv); #endif /* Clear busy flag in case of timeout */ diff --git a/arch/arm/src/stm32/stm32_irq.c b/arch/arm/src/stm32/stm32_irq.c index f79a045b5c..8b6f57db6a 100644 --- a/arch/arm/src/stm32/stm32_irq.c +++ b/arch/arm/src/stm32/stm32_irq.c @@ -149,7 +149,7 @@ static void stm32_dumpnvic(const char *msg, int irq) /**************************************************************************** * Name: stm32_nmi, stm32_busfault, stm32_usagefault, stm32_pendsv, - * stm32_dbgmonitor, stm32_pendsv, stm32_reserved + * stm32_errmonitor, stm32_pendsv, stm32_reserved * * Description: * Handlers for various execptions. None are handled and all are fatal @@ -162,7 +162,7 @@ static void stm32_dumpnvic(const char *msg, int irq) static int stm32_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -170,7 +170,7 @@ static int stm32_nmi(int irq, FAR void *context) static int stm32_busfault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); + err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; } @@ -178,7 +178,7 @@ static int stm32_busfault(int irq, FAR void *context) static int stm32_usagefault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); + err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; } @@ -186,15 +186,15 @@ static int stm32_usagefault(int irq, FAR void *context) static int stm32_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } -static int stm32_dbgmonitor(int irq, FAR void *context) +static int stm32_errmonitor(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Debug Monitor received\n"); + err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; } @@ -202,7 +202,7 @@ static int stm32_dbgmonitor(int irq, FAR void *context) static int stm32_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } @@ -416,7 +416,7 @@ void up_irqinitialize(void) irq_attach(STM32_IRQ_BUSFAULT, stm32_busfault); irq_attach(STM32_IRQ_USAGEFAULT, stm32_usagefault); irq_attach(STM32_IRQ_PENDSV, stm32_pendsv); - irq_attach(STM32_IRQ_DBGMONITOR, stm32_dbgmonitor); + irq_attach(STM32_IRQ_DBGMONITOR, stm32_errmonitor); irq_attach(STM32_IRQ_RESERVED, stm32_reserved); #endif diff --git a/arch/arm/src/stm32/stm32_iwdg.c b/arch/arm/src/stm32/stm32_iwdg.c index 72489e6002..a4fda31c89 100644 --- a/arch/arm/src/stm32/stm32_iwdg.c +++ b/arch/arm/src/stm32/stm32_iwdg.c @@ -51,7 +51,7 @@ #include "up_arch.h" #include "stm32_rcc.h" -#include "chip/stm32_dbgmcu.h" +#include "chip/stm32_errmcu.h" #include "stm32_wdg.h" #if defined(CONFIG_WATCHDOG) && defined(CONFIG_STM32_IWDG) @@ -112,10 +112,10 @@ */ #ifdef CONFIG_DEBUG_WATCHDOG -# define wddbg llerr +# define wderr llerr # define wdinfo llinfo #else -# define wddbg(x...) +# define wderr(x...) # define wdinfo(x...) #endif @@ -523,7 +523,7 @@ static int stm32_settimeout(FAR struct watchdog_lowerhalf_s *lower, if (timeout < 1 || timeout > IWDG_MAXTIMEOUT) { - wddbg("Cannot represent timeout=%d > %d\n", + wderr("Cannot represent timeout=%d > %d\n", timeout, IWDG_MAXTIMEOUT); return -ERANGE; } @@ -536,7 +536,7 @@ static int stm32_settimeout(FAR struct watchdog_lowerhalf_s *lower, #ifdef CONFIG_STM32_IWDG_ONETIMESETUP if (priv->started) { - wddbg("Timer is already started\n"); + wderr("Timer is already started\n"); return -EBUSY; } #endif diff --git a/arch/arm/src/stm32/stm32_ltdc.c b/arch/arm/src/stm32/stm32_ltdc.c index 678aceda7e..9ad25dfeed 100644 --- a/arch/arm/src/stm32/stm32_ltdc.c +++ b/arch/arm/src/stm32/stm32_ltdc.c @@ -283,10 +283,10 @@ /* Debug option */ #ifdef CONFIG_STM32_LTDC_REGDEBUG -# define regdbg dbg +# define regerr err # define reginfo info #else -# define regdbg(x...) +# define regerr(x...) # define reginfo(x...) #endif @@ -1155,7 +1155,7 @@ static int stm32_ltdcirq(int irq, void *context) if (ret != OK) { - dbg("sem_post() failed\n"); + err("sem_post() failed\n"); return ret; } } @@ -1202,7 +1202,7 @@ static int stm32_ltdc_waitforirq(void) if (ret != OK) { - dbg("sem_wait() failed\n"); + err("sem_wait() failed\n"); } } @@ -1519,7 +1519,7 @@ static int stm32_ltdc_lvalidatearea(FAR struct stm32_layer_s *layer, (srcypos > ypos + yres - 1)) { - gdbg("layer coordinates out of valid area: xpos = %d > %d, \ + gerr("layer coordinates out of valid area: xpos = %d > %d, \ ypos = %d > %d, width = %d > %d, height = %d > %d, \ srcxpos = %d > %d, srcypos = %d > %d", xpos, vinfo->xres - 1, @@ -1529,7 +1529,7 @@ static int stm32_ltdc_lvalidatearea(FAR struct stm32_layer_s *layer, srcxpos, xpos + xres - 1, srcypos, ypos + yres - 1); - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -2203,7 +2203,7 @@ static int stm32_getvideoinfo(struct fb_vtable_s *vtable, return stm32_lgetvideoinfo(ltdc, vinfo); } - gdbg("ERROR: Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } @@ -2238,7 +2238,7 @@ static int stm32_getplaneinfo(struct fb_vtable_s *vtable, int planeno, return stm32_lgetplaneinfo(ltdc, planeno, pinfo); } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -2325,7 +2325,7 @@ static int stm32_lgetvideoinfo(struct ltdc_layer_s *layer, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -2358,7 +2358,7 @@ static int stm32_lgetplaneinfo(struct ltdc_layer_s *layer, int planeno, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -2394,13 +2394,13 @@ static int stm32_setclut(struct ltdc_layer_s *layer, if (priv->state.vinfo.fmt != FB_FMT_RGB8) { - gdbg("Error: CLUT is not supported for the pixel format: %d\n", + gerr("Error: CLUT is not supported for the pixel format: %d\n", priv->state.vinfo.fmt); ret = -EINVAL; } else if (cmap->first >= STM32_LTDC_NCLUT) { - gdbg("Error: only %d color table entries supported\n", + gerr("Error: only %d color table entries supported\n", STM32_LTDC_NCLUT); ret = -EINVAL; } @@ -2418,7 +2418,7 @@ static int stm32_setclut(struct ltdc_layer_s *layer, return ret; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -2460,13 +2460,13 @@ static int stm32_getclut(struct ltdc_layer_s *layer, #else if (priv->state.vinfo.fmt != FB_FMT_RGB8) { - gdbg("Error: CLUT is not supported for the pixel format: %d\n", + gerr("Error: CLUT is not supported for the pixel format: %d\n", priv->state.vinfo.fmt); ret = -EINVAL; } else if (cmap->first >= STM32_LTDC_NCLUT) { - gdbg("Error: only %d color table entries supported\n", + gerr("Error: only %d color table entries supported\n", STM32_LTDC_NCLUT); ret = -EINVAL; } @@ -2512,7 +2512,7 @@ static int stm32_getclut(struct ltdc_layer_s *layer, return ret; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } #endif /* STM32_LAYER_CLUT_SIZE */ @@ -2583,7 +2583,7 @@ static int stm32_getlid(FAR struct ltdc_layer_s *layer, int *lid, #endif default: ret = EINVAL; - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); break; } @@ -2592,7 +2592,7 @@ static int stm32_getlid(FAR struct ltdc_layer_s *layer, int *lid, return ret; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -2629,7 +2629,7 @@ static int stm32_setcolor(FAR struct ltdc_layer_s *layer, uint32_t argb) return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -2663,7 +2663,7 @@ static int stm32_getcolor(FAR struct ltdc_layer_s *layer, uint32_t *argb) return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -2700,7 +2700,7 @@ static int stm32_setcolorkey(FAR struct ltdc_layer_s *layer, uint32_t rgb) return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -2734,7 +2734,7 @@ static int stm32_getcolorkey(FAR struct ltdc_layer_s *layer, uint32_t *rgb) return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -2775,7 +2775,7 @@ static int stm32_setalpha(FAR struct ltdc_layer_s *layer, uint8_t alpha) return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -2809,7 +2809,7 @@ static int stm32_getalpha(FAR struct ltdc_layer_s *layer, uint8_t *alpha) return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -2926,7 +2926,7 @@ static int stm32_setblendmode(FAR struct ltdc_layer_s *layer, uint32_t mode) } if (blendmode) { - gdbg("Unknown blendmode %02x\n", blendmode); + gerr("Unknown blendmode %02x\n", blendmode); ret = -EINVAL; } @@ -2942,7 +2942,7 @@ static int stm32_setblendmode(FAR struct ltdc_layer_s *layer, uint32_t mode) return ret; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -2975,7 +2975,7 @@ static int stm32_getblendmode(FAR struct ltdc_layer_s *layer, uint32_t *mode) return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -3039,7 +3039,7 @@ static int stm32_setarea(FAR struct ltdc_layer_s *layer, return ret; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -3080,7 +3080,7 @@ static int stm32_getarea(FAR struct ltdc_layer_s *layer, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -3156,7 +3156,7 @@ static int stm32_update(FAR struct ltdc_layer_s *layer, uint32_t mode) if (stm32_ltdc_waitforirq() != OK) { - gdbg("Returning ECANCELED\n"); + gerr("Returning ECANCELED\n"); return -ECANCELED; } @@ -3238,7 +3238,7 @@ static int stm32_update(FAR struct ltdc_layer_s *layer, uint32_t mode) return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -3286,7 +3286,7 @@ static int stm32_blit(FAR struct ltdc_layer_s *dest, return ret; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -3342,7 +3342,7 @@ static int stm32_blend(FAR struct ltdc_layer_s *dest, return ret; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -3383,7 +3383,7 @@ static int stm32_fillarea(FAR struct ltdc_layer_s *layer, return ret; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } #endif @@ -3413,7 +3413,7 @@ FAR struct ltdc_layer_s *stm32_ltdcgetlayer(int lid) return (FAR struct ltdc_layer_s *) &LAYER(lid); } - gdbg("EINVAL\n"); + gerr("EINVAL\n"); errno = EINVAL; return NULL; } @@ -3436,7 +3436,7 @@ int stm32_ltdcinitialize(void) int ret; #endif - dbg("Initialize LTDC driver\n"); + err("Initialize LTDC driver\n"); if (g_initialized == true) { @@ -3600,6 +3600,6 @@ void stm32_backlight(bool blon) { /* Set default backlight level CONFIG_STM32_LTDC_DEFBACKLIGHT */ - gdbg("Not supported\n"); + gerr("Not supported\n"); } #endif diff --git a/arch/arm/src/stm32/stm32_otgfsdev.c b/arch/arm/src/stm32/stm32_otgfsdev.c index 82b6a9fb83..8481142f88 100644 --- a/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/arch/arm/src/stm32/stm32_otgfsdev.c @@ -3801,7 +3801,7 @@ static int stm32_epout_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, break; default: - udbg("Unsupported maxpacket: %d\n", maxpacket); + uerr("Unsupported maxpacket: %d\n", maxpacket); return -EINVAL; } } @@ -3896,7 +3896,7 @@ static int stm32_epin_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, break; default: - udbg("Unsupported maxpacket: %d\n", maxpacket); + uerr("Unsupported maxpacket: %d\n", maxpacket); return -EINVAL; } } @@ -5447,7 +5447,7 @@ void up_usbinitialize(void) ret = irq_attach(STM32_IRQ_OTGFS, stm32_usbinterrupt); if (ret < 0) { - udbg("irq_attach failed\n", ret); + uerr("irq_attach failed\n", ret); goto errout; } diff --git a/arch/arm/src/stm32/stm32_otgfshost.c b/arch/arm/src/stm32/stm32_otgfshost.c index 113c7c2551..912919a940 100644 --- a/arch/arm/src/stm32/stm32_otgfshost.c +++ b/arch/arm/src/stm32/stm32_otgfshost.c @@ -1284,7 +1284,7 @@ static int stm32_ctrlep_alloc(FAR struct stm32_usbhost_s *priv, ctrlep = (FAR struct stm32_ctrlinfo_s *)kmm_malloc(sizeof(struct stm32_ctrlinfo_s)); if (ctrlep == NULL) { - udbg("ERROR: Failed to allocate control endpoint container\n"); + uerr("ERROR: Failed to allocate control endpoint container\n"); return -ENOMEM; } @@ -1294,7 +1294,7 @@ static int stm32_ctrlep_alloc(FAR struct stm32_usbhost_s *priv, hport->funcaddr, hport->speed, ctrlep); if (ret < 0) { - udbg("ERROR: stm32_ctrlchan_alloc failed: %d\n", ret); + uerr("ERROR: stm32_ctrlchan_alloc failed: %d\n", ret); kmm_free(ctrlep); return ret; } @@ -1346,7 +1346,7 @@ static int stm32_xfrep_alloc(FAR struct stm32_usbhost_s *priv, chidx = stm32_chan_alloc(priv); if (chidx < 0) { - udbg("ERROR: Failed to allocate a host channel\n"); + uerr("ERROR: Failed to allocate a host channel\n"); return -ENOMEM; } @@ -1856,7 +1856,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_in_setup(priv, chidx); if (ret < 0) { - udbg("ERROR: stm32_in_setup failed: %d\n", ret); + uerr("ERROR: stm32_in_setup failed: %d\n", ret); return (ssize_t)ret; } @@ -1887,7 +1887,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, { /* Break out and return the error */ - udbg("ERROR: stm32_chan_wait failed: %d\n", ret); + uerr("ERROR: stm32_chan_wait failed: %d\n", ret); return (ssize_t)ret; } } @@ -1932,7 +1932,7 @@ static void stm32_in_next(FAR struct stm32_usbhost_s *priv, return; } - udbg("ERROR: stm32_in_setup failed: %d\n", ret); + uerr("ERROR: stm32_in_setup failed: %d\n", ret); result = ret; } @@ -1990,7 +1990,7 @@ static int stm32_in_asynch(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_chan_asynchsetup(priv, chan, callback, arg); if (ret < 0) { - udbg("ERROR: stm32_chan_asynchsetup failed: %d\n", ret); + uerr("ERROR: stm32_chan_asynchsetup failed: %d\n", ret); return ret; } @@ -1999,7 +1999,7 @@ static int stm32_in_asynch(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_in_setup(priv, chidx); if (ret < 0) { - udbg("ERROR: stm32_in_setup failed: %d\n", ret); + uerr("ERROR: stm32_in_setup failed: %d\n", ret); } /* And return with the transfer pending */ @@ -2125,7 +2125,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_out_setup(priv, chidx); if (ret < 0) { - udbg("ERROR: stm32_out_setup failed: %d\n", ret); + uerr("ERROR: stm32_out_setup failed: %d\n", ret); return (ssize_t)ret; } @@ -2153,7 +2153,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, { /* Break out and return the error */ - udbg("ERROR: stm32_chan_wait failed: %d\n", ret); + uerr("ERROR: stm32_chan_wait failed: %d\n", ret); return (ssize_t)ret; } @@ -2218,7 +2218,7 @@ static void stm32_out_next(FAR struct stm32_usbhost_s *priv, return; } - udbg("ERROR: stm32_out_setup failed: %d\n", ret); + uerr("ERROR: stm32_out_setup failed: %d\n", ret); result = ret; } @@ -2276,7 +2276,7 @@ static int stm32_out_asynch(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_chan_asynchsetup(priv, chan, callback, arg); if (ret < 0) { - udbg("ERROR: stm32_chan_asynchsetup failed: %d\n", ret); + uerr("ERROR: stm32_chan_asynchsetup failed: %d\n", ret); return ret; } @@ -2285,7 +2285,7 @@ static int stm32_out_asynch(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_out_setup(priv, chidx); if (ret < 0) { - udbg("ERROR: stm32_out_setup failed: %d\n", ret); + uerr("ERROR: stm32_out_setup failed: %d\n", ret); } /* And return with the transfer pending */ @@ -3865,7 +3865,7 @@ static int stm32_rh_enumerate(FAR struct stm32_usbhost_s *priv, ret = stm32_ctrlchan_alloc(priv, 0, 0, priv->rhport.hport.speed, &priv->ep0); if (ret < 0) { - udbg("ERROR: Failed to allocate a control endpoint: %d\n", ret); + uerr("ERROR: Failed to allocate a control endpoint: %d\n", ret); } return ret; @@ -3911,7 +3911,7 @@ static int stm32_enumerate(FAR struct usbhost_connection_s *conn, { /* Return to the disconnected state */ - udbg("ERROR: Enumeration failed: %d\n", ret); + uerr("ERROR: Enumeration failed: %d\n", ret); stm32_gint_disconnected(priv); } diff --git a/arch/arm/src/stm32/stm32_otghsdev.c b/arch/arm/src/stm32/stm32_otghsdev.c index b63831a8ce..64b53eec4c 100644 --- a/arch/arm/src/stm32/stm32_otghsdev.c +++ b/arch/arm/src/stm32/stm32_otghsdev.c @@ -3801,7 +3801,7 @@ static int stm32_epout_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, break; default: - udbg("Unsupported maxpacket: %d\n", maxpacket); + uerr("Unsupported maxpacket: %d\n", maxpacket); return -EINVAL; } } @@ -3896,7 +3896,7 @@ static int stm32_epin_configure(FAR struct stm32_ep_s *privep, uint8_t eptype, break; default: - udbg("Unsupported maxpacket: %d\n", maxpacket); + uerr("Unsupported maxpacket: %d\n", maxpacket); return -EINVAL; } } @@ -5436,7 +5436,7 @@ void up_usbinitialize(void) ret = irq_attach(STM32_IRQ_OTGHS, stm32_usbinterrupt); if (ret < 0) { - udbg("irq_attach failed\n", ret); + uerr("irq_attach failed\n", ret); goto errout; } diff --git a/arch/arm/src/stm32/stm32_otghshost.c b/arch/arm/src/stm32/stm32_otghshost.c index 6ae9aa788c..b93e185c96 100644 --- a/arch/arm/src/stm32/stm32_otghshost.c +++ b/arch/arm/src/stm32/stm32_otghshost.c @@ -1284,7 +1284,7 @@ static int stm32_ctrlep_alloc(FAR struct stm32_usbhost_s *priv, ctrlep = (FAR struct stm32_ctrlinfo_s *)kmm_malloc(sizeof(struct stm32_ctrlinfo_s)); if (ctrlep == NULL) { - udbg("ERROR: Failed to allocate control endpoint container\n"); + uerr("ERROR: Failed to allocate control endpoint container\n"); return -ENOMEM; } @@ -1294,7 +1294,7 @@ static int stm32_ctrlep_alloc(FAR struct stm32_usbhost_s *priv, hport->funcaddr, hport->speed, ctrlep); if (ret < 0) { - udbg("ERROR: stm32_ctrlchan_alloc failed: %d\n", ret); + uerr("ERROR: stm32_ctrlchan_alloc failed: %d\n", ret); kmm_free(ctrlep); return ret; } @@ -1346,7 +1346,7 @@ static int stm32_xfrep_alloc(FAR struct stm32_usbhost_s *priv, chidx = stm32_chan_alloc(priv); if (chidx < 0) { - udbg("ERROR: Failed to allocate a host channel\n"); + uerr("ERROR: Failed to allocate a host channel\n"); return -ENOMEM; } @@ -1856,7 +1856,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_in_setup(priv, chidx); if (ret < 0) { - udbg("ERROR: stm32_in_setup failed: %d\n", ret); + uerr("ERROR: stm32_in_setup failed: %d\n", ret); return (ssize_t)ret; } @@ -1887,7 +1887,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, { /* Break out and return the error */ - udbg("ERROR: stm32_chan_wait failed: %d\n", ret); + uerr("ERROR: stm32_chan_wait failed: %d\n", ret); return (ssize_t)ret; } } @@ -1932,7 +1932,7 @@ static void stm32_in_next(FAR struct stm32_usbhost_s *priv, return; } - udbg("ERROR: stm32_in_setup failed: %d\n", ret); + uerr("ERROR: stm32_in_setup failed: %d\n", ret); result = ret; } @@ -1990,7 +1990,7 @@ static int stm32_in_asynch(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_chan_asynchsetup(priv, chan, callback, arg); if (ret < 0) { - udbg("ERROR: stm32_chan_asynchsetup failed: %d\n", ret); + uerr("ERROR: stm32_chan_asynchsetup failed: %d\n", ret); return ret; } @@ -1999,7 +1999,7 @@ static int stm32_in_asynch(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_in_setup(priv, chidx); if (ret < 0) { - udbg("ERROR: stm32_in_setup failed: %d\n", ret); + uerr("ERROR: stm32_in_setup failed: %d\n", ret); } /* And return with the transfer pending */ @@ -2125,7 +2125,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_out_setup(priv, chidx); if (ret < 0) { - udbg("ERROR: stm32_out_setup failed: %d\n", ret); + uerr("ERROR: stm32_out_setup failed: %d\n", ret); return (ssize_t)ret; } @@ -2153,7 +2153,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, { /* Break out and return the error */ - udbg("ERROR: stm32_chan_wait failed: %d\n", ret); + uerr("ERROR: stm32_chan_wait failed: %d\n", ret); return (ssize_t)ret; } @@ -2218,7 +2218,7 @@ static void stm32_out_next(FAR struct stm32_usbhost_s *priv, return; } - udbg("ERROR: stm32_out_setup failed: %d\n", ret); + uerr("ERROR: stm32_out_setup failed: %d\n", ret); result = ret; } @@ -2276,7 +2276,7 @@ static int stm32_out_asynch(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_chan_asynchsetup(priv, chan, callback, arg); if (ret < 0) { - udbg("ERROR: stm32_chan_asynchsetup failed: %d\n", ret); + uerr("ERROR: stm32_chan_asynchsetup failed: %d\n", ret); return ret; } @@ -2285,7 +2285,7 @@ static int stm32_out_asynch(FAR struct stm32_usbhost_s *priv, int chidx, ret = stm32_out_setup(priv, chidx); if (ret < 0) { - udbg("ERROR: stm32_out_setup failed: %d\n", ret); + uerr("ERROR: stm32_out_setup failed: %d\n", ret); } /* And return with the transfer pending */ @@ -3865,7 +3865,7 @@ static int stm32_rh_enumerate(FAR struct stm32_usbhost_s *priv, ret = stm32_ctrlchan_alloc(priv, 0, 0, priv->rhport.hport.speed, &priv->ep0); if (ret < 0) { - udbg("ERROR: Failed to allocate a control endpoint: %d\n", ret); + uerr("ERROR: Failed to allocate a control endpoint: %d\n", ret); } return ret; @@ -3911,7 +3911,7 @@ static int stm32_enumerate(FAR struct usbhost_connection_s *conn, { /* Return to the disconnected state */ - udbg("ERROR: Enumeration failed: %d\n", ret); + uerr("ERROR: Enumeration failed: %d\n", ret); stm32_gint_disconnected(priv); } diff --git a/arch/arm/src/stm32/stm32_procfs_ccm.c b/arch/arm/src/stm32/stm32_procfs_ccm.c index 816f37977e..51d1022146 100644 --- a/arch/arm/src/stm32/stm32_procfs_ccm.c +++ b/arch/arm/src/stm32/stm32_procfs_ccm.c @@ -152,7 +152,7 @@ static int ccm_open(FAR struct file *filep, FAR const char *relpath, if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - fdbg("ERROR: Only O_RDONLY supported\n"); + ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; } @@ -160,7 +160,7 @@ static int ccm_open(FAR struct file *filep, FAR const char *relpath, if (strcmp(relpath, "ccm") != 0) { - fdbg("ERROR: relpath is '%s'\n", relpath); + ferr("ERROR: relpath is '%s'\n", relpath); return -ENOENT; } @@ -169,7 +169,7 @@ static int ccm_open(FAR struct file *filep, FAR const char *relpath, priv = (FAR struct ccm_file_s *)kmm_zalloc(sizeof(struct ccm_file_s)); if (!priv) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -285,7 +285,7 @@ static int ccm_dup(FAR const struct file *oldp, FAR struct file *newp) newpriv = (FAR struct ccm_file_s *)kmm_zalloc(sizeof(struct ccm_file_s)); if (!newpriv) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -303,7 +303,7 @@ static int ccm_stat(const char *relpath, struct stat *buf) { if (strcmp(relpath, "ccm") != 0) { - fdbg("ERROR: relpath is '%s'\n", relpath); + ferr("ERROR: relpath is '%s'\n", relpath); return -ENOENT; } diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c index d43461d661..53e28f6ae1 100644 --- a/arch/arm/src/stm32/stm32_pwm.c +++ b/arch/arm/src/stm32/stm32_pwm.c @@ -122,7 +122,7 @@ #endif #ifdef CONFIG_DEBUG_PWM -# define pwmdbg dbg +# define pwmerr err # define pwmllerr llerr # ifdef CONFIG_DEBUG_INFO # define pwminfo info @@ -134,7 +134,7 @@ # define pwm_dumpgpio(p,m) # endif #else -# define pwmdbg(x...) +# define pwmerr(x...) # define pwmllerr(x...) # define pwminfo(x...) # define pwmllinfo(x...) @@ -1209,7 +1209,7 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, break; default: - pwmdbg("No such timer mode: %u\n", (unsigned int)priv->mode); + pwmerr("No such timer mode: %u\n", (unsigned int)priv->mode); return -EINVAL; } } @@ -1336,7 +1336,7 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, if (j >= PWM_NCHANNELS) { - pwmdbg("No such channel: %u\n", channel); + pwmerr("No such channel: %u\n", channel); return -EINVAL; } #else @@ -1387,7 +1387,7 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, #endif default: - pwmdbg("No such mode: %u\n", (unsigned int)mode); + pwmerr("No such mode: %u\n", (unsigned int)mode); return -EINVAL; } @@ -1494,7 +1494,7 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, break; default: - pwmdbg("No such channel: %u\n", channel); + pwmerr("No such channel: %u\n", channel); return -EINVAL; } } @@ -1707,7 +1707,7 @@ static int pwm_update_duty(FAR struct stm32_pwmtimer_s *priv, uint8_t channel, break; default: - pwmdbg("No such channel: %u\n", channel); + pwmerr("No such channel: %u\n", channel); return -EINVAL; } @@ -2149,7 +2149,7 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev, if (priv->timtype != TIMTYPE_ADVANCED) { - pwmdbg("ERROR: TIM%u cannot support pulse count: %u\n", + pwmerr("ERROR: TIM%u cannot support pulse count: %u\n", priv->timid, info->count); return -EPERM; } @@ -2527,7 +2527,7 @@ FAR struct pwm_lowerhalf_s *stm32_pwminitialize(int timer) #endif default: - pwmdbg("No such timer configured\n"); + pwmerr("No such timer configured\n"); return NULL; } diff --git a/arch/arm/src/stm32/stm32_qencoder.c b/arch/arm/src/stm32/stm32_qencoder.c index 8c856b25c4..584ea46a47 100644 --- a/arch/arm/src/stm32/stm32_qencoder.c +++ b/arch/arm/src/stm32/stm32_qencoder.c @@ -1270,7 +1270,7 @@ int stm32_qeinitialize(FAR const char *devpath, int tim) priv = stm32_tim2lower(tim); if (!priv) { - sndbg("TIM%d support not configured\n", tim); + snerr("TIM%d support not configured\n", tim); return -ENXIO; } @@ -1278,7 +1278,7 @@ int stm32_qeinitialize(FAR const char *devpath, int tim) if (priv->inuse) { - sndbg("TIM%d is in-used\n", tim); + snerr("TIM%d is in-used\n", tim); return -EBUSY; } @@ -1287,7 +1287,7 @@ int stm32_qeinitialize(FAR const char *devpath, int tim) ret = qe_register(devpath, (FAR struct qe_lowerhalf_s *)priv); if (ret < 0) { - sndbg("qe_register failed: %d\n", ret); + snerr("qe_register failed: %d\n", ret); return ret; } diff --git a/arch/arm/src/stm32/stm32_rtcc.c b/arch/arm/src/stm32/stm32_rtcc.c index 72ffc26fe3..7a55f9c46e 100644 --- a/arch/arm/src/stm32/stm32_rtcc.c +++ b/arch/arm/src/stm32/stm32_rtcc.c @@ -126,12 +126,12 @@ /* Debug ****************************************************************************/ #ifdef CONFIG_DEBUG_RTC -# define rtcdbg dbg +# define rtcerr err # define rtcinfo info # define rtcllerr llerr # define rtcllinfo llinfo #else -# define rtcdbg(x...) +# define rtcerr(x...) # define rtcinfo(x...) # define rtcllerr(x...) # define rtcllinfo(x...) diff --git a/arch/arm/src/stm32/stm32_sdio.c b/arch/arm/src/stm32/stm32_sdio.c index c9686a4b75..49bf6f1bcf 100644 --- a/arch/arm/src/stm32/stm32_sdio.c +++ b/arch/arm/src/stm32/stm32_sdio.c @@ -810,16 +810,16 @@ static void stm32_sample(struct stm32_dev_s *priv, int index) #ifdef CONFIG_SDIO_XFRDEBUG static void stm32_sdiodump(struct stm32_sdioregs_s *regs, const char *msg) { - fdbg("SDIO Registers: %s\n", msg); - fdbg(" POWER[%08x]: %08x\n", STM32_SDIO_POWER, regs->power); - fdbg(" CLKCR[%08x]: %08x\n", STM32_SDIO_CLKCR, regs->clkcr); - fdbg(" DCTRL[%08x]: %08x\n", STM32_SDIO_DCTRL, regs->dctrl); - fdbg(" DTIMER[%08x]: %08x\n", STM32_SDIO_DTIMER, regs->dtimer); - fdbg(" DLEN[%08x]: %08x\n", STM32_SDIO_DLEN, regs->dlen); - fdbg(" DCOUNT[%08x]: %08x\n", STM32_SDIO_DCOUNT, regs->dcount); - fdbg(" STA[%08x]: %08x\n", STM32_SDIO_STA, regs->sta); - fdbg(" MASK[%08x]: %08x\n", STM32_SDIO_MASK, regs->mask); - fdbg("FIFOCNT[%08x]: %08x\n", STM32_SDIO_FIFOCNT, regs->fifocnt); + ferr("SDIO Registers: %s\n", msg); + ferr(" POWER[%08x]: %08x\n", STM32_SDIO_POWER, regs->power); + ferr(" CLKCR[%08x]: %08x\n", STM32_SDIO_CLKCR, regs->clkcr); + ferr(" DCTRL[%08x]: %08x\n", STM32_SDIO_DCTRL, regs->dctrl); + ferr(" DTIMER[%08x]: %08x\n", STM32_SDIO_DTIMER, regs->dtimer); + ferr(" DLEN[%08x]: %08x\n", STM32_SDIO_DLEN, regs->dlen); + ferr(" DCOUNT[%08x]: %08x\n", STM32_SDIO_DCOUNT, regs->dcount); + ferr(" STA[%08x]: %08x\n", STM32_SDIO_STA, regs->sta); + ferr(" MASK[%08x]: %08x\n", STM32_SDIO_MASK, regs->mask); + ferr("FIFOCNT[%08x]: %08x\n", STM32_SDIO_FIFOCNT, regs->fifocnt); } #endif @@ -2025,7 +2025,7 @@ static int stm32_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd) { if (--timeout <= 0) { - fdbg("ERROR: Timeout cmd: %08x events: %08x STA: %08x\n", + ferr("ERROR: Timeout cmd: %08x events: %08x STA: %08x\n", cmd, events, getreg32(STM32_SDIO_STA)); return -ETIMEDOUT; @@ -2092,7 +2092,7 @@ static int stm32_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t #ifdef CONFIG_DEBUG_FEATURES if (!rshort) { - fdbg("ERROR: rshort=NULL\n"); + ferr("ERROR: rshort=NULL\n"); ret = -EINVAL; } @@ -2102,7 +2102,7 @@ static int stm32_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R1B_RESPONSE && (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R6_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2113,12 +2113,12 @@ static int stm32_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t regval = getreg32(STM32_SDIO_STA); if ((regval & SDIO_STA_CTIMEOUT) != 0) { - fdbg("ERROR: Command timeout: %08x\n", regval); + ferr("ERROR: Command timeout: %08x\n", regval); ret = -ETIMEDOUT; } else if ((regval & SDIO_STA_CCRCFAIL) != 0) { - fdbg("ERROR: CRC failure: %08x\n", regval); + ferr("ERROR: CRC failure: %08x\n", regval); ret = -EIO; } #ifdef CONFIG_DEBUG_FEATURES @@ -2129,7 +2129,7 @@ static int stm32_recvshortcrc(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t respcmd = getreg32(STM32_SDIO_RESPCMD); if ((uint8_t)(respcmd & SDIO_RESPCMD_MASK) != (cmd & MMCSD_CMDIDX_MASK)) { - fdbg("ERROR: RESCMD=%02x CMD=%08x\n", respcmd, cmd); + ferr("ERROR: RESCMD=%02x CMD=%08x\n", respcmd, cmd); ret = -EINVAL; } } @@ -2162,7 +2162,7 @@ static int stm32_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlo if ((cmd & MMCSD_RESPONSE_MASK) != MMCSD_R2_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2173,12 +2173,12 @@ static int stm32_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlo regval = getreg32(STM32_SDIO_STA); if (regval & SDIO_STA_CTIMEOUT) { - fdbg("ERROR: Timeout STA: %08x\n", regval); + ferr("ERROR: Timeout STA: %08x\n", regval); ret = -ETIMEDOUT; } else if (regval & SDIO_STA_CCRCFAIL) { - fdbg("ERROR: CRC fail STA: %08x\n", regval); + ferr("ERROR: CRC fail STA: %08x\n", regval); ret = -EIO; } } @@ -2216,7 +2216,7 @@ static int stm32_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *r if ((cmd & MMCSD_RESPONSE_MASK) != MMCSD_R3_RESPONSE && (cmd & MMCSD_RESPONSE_MASK) != MMCSD_R7_RESPONSE) { - fdbg("ERROR: Wrong response CMD=%08x\n", cmd); + ferr("ERROR: Wrong response CMD=%08x\n", cmd); ret = -EINVAL; } else @@ -2229,7 +2229,7 @@ static int stm32_recvshort(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *r regval = getreg32(STM32_SDIO_STA); if (regval & SDIO_STA_CTIMEOUT) { - fdbg("ERROR: Timeout STA: %08x\n", regval); + ferr("ERROR: Timeout STA: %08x\n", regval); ret = -ETIMEDOUT; } } @@ -2384,7 +2384,7 @@ static sdio_eventset_t stm32_eventwait(FAR struct sdio_dev_s *dev, 1, (uint32_t)priv); if (ret != OK) { - fdbg("ERROR: wd_start failed: %d\n", ret); + ferr("ERROR: wd_start failed: %d\n", ret); } } diff --git a/arch/arm/src/stm32/stm32_spi.c b/arch/arm/src/stm32/stm32_spi.c index 803935fea5..8b871665a5 100644 --- a/arch/arm/src/stm32/stm32_spi.c +++ b/arch/arm/src/stm32/stm32_spi.c @@ -165,14 +165,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -1692,7 +1692,7 @@ FAR struct spi_dev_s *stm32_spibus_initialize(int bus) else #endif { - spidbg("ERROR: Unsupbused SPI bus: %d\n", bus); + spierr("ERROR: Unsupbused SPI bus: %d\n", bus); return NULL; } diff --git a/arch/arm/src/stm32/stm32_wwdg.c b/arch/arm/src/stm32/stm32_wwdg.c index 2f9074867d..b2f9a616f7 100644 --- a/arch/arm/src/stm32/stm32_wwdg.c +++ b/arch/arm/src/stm32/stm32_wwdg.c @@ -49,7 +49,7 @@ #include #include "up_arch.h" -#include "chip/stm32_dbgmcu.h" +#include "chip/stm32_errmcu.h" #include "stm32_wdg.h" #if defined(CONFIG_WATCHDOG) && defined(CONFIG_STM32_WWDG) @@ -88,10 +88,10 @@ */ #ifdef CONFIG_DEBUG_WATCHDOG -# define wddbg llerr +# define wderr llerr # define wdinfo llinfo #else -# define wddbg(x...) +# define wderr(x...) # define wdinfo(x...) #endif @@ -513,7 +513,7 @@ static int stm32_settimeout(FAR struct watchdog_lowerhalf_s *lower, if (timeout < 1 || timeout > WWDG_MAXTIMEOUT) { - wddbg("Cannot represent timeout=%d > %d\n", + wderr("Cannot represent timeout=%d > %d\n", timeout, WWDG_MAXTIMEOUT); return -ERANGE; } diff --git a/arch/arm/src/stm32/stm32f10xxx_dma.c b/arch/arm/src/stm32/stm32f10xxx_dma.c index a452e65eb8..32f485c447 100644 --- a/arch/arm/src/stm32/stm32f10xxx_dma.c +++ b/arch/arm/src/stm32/stm32f10xxx_dma.c @@ -741,12 +741,12 @@ void stm32_dmadump(DMA_HANDLE handle, const struct stm32_dmaregs_s *regs, struct stm32_dma_s *dmach = (struct stm32_dma_s *)handle; uint32_t dmabase = DMA_BASE(dmach->base); - dmadbg("DMA Registers: %s\n", msg); - dmadbg(" ISRC[%08x]: %08x\n", dmabase + STM32_DMA_ISR_OFFSET, regs->isr); - dmadbg(" CCR[%08x]: %08x\n", dmach->base + STM32_DMACHAN_CCR_OFFSET, regs->ccr); - dmadbg(" CNDTR[%08x]: %08x\n", dmach->base + STM32_DMACHAN_CNDTR_OFFSET, regs->cndtr); - dmadbg(" CPAR[%08x]: %08x\n", dmach->base + STM32_DMACHAN_CPAR_OFFSET, regs->cpar); - dmadbg(" CMAR[%08x]: %08x\n", dmach->base + STM32_DMACHAN_CMAR_OFFSET, regs->cmar); + dmaerr("DMA Registers: %s\n", msg); + dmaerr(" ISRC[%08x]: %08x\n", dmabase + STM32_DMA_ISR_OFFSET, regs->isr); + dmaerr(" CCR[%08x]: %08x\n", dmach->base + STM32_DMACHAN_CCR_OFFSET, regs->ccr); + dmaerr(" CNDTR[%08x]: %08x\n", dmach->base + STM32_DMACHAN_CNDTR_OFFSET, regs->cndtr); + dmaerr(" CPAR[%08x]: %08x\n", dmach->base + STM32_DMACHAN_CPAR_OFFSET, regs->cpar); + dmaerr(" CMAR[%08x]: %08x\n", dmach->base + STM32_DMACHAN_CMAR_OFFSET, regs->cmar); } #endif diff --git a/arch/arm/src/stm32/stm32f20xxx_dma.c b/arch/arm/src/stm32/stm32f20xxx_dma.c index 39c40f59f6..8dbe917e93 100644 --- a/arch/arm/src/stm32/stm32f20xxx_dma.c +++ b/arch/arm/src/stm32/stm32f20xxx_dma.c @@ -606,7 +606,7 @@ void stm32_dmasetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr, uint32_t regoffset; uint32_t regval; - dmadbg("paddr: %08x maddr: %08x ntransfers: %d scr: %08x\n", + dmaerr("paddr: %08x maddr: %08x ntransfers: %d scr: %08x\n", paddr, maddr, ntransfers, scr); /* "If the stream is enabled, disable it by resetting the EN bit in the @@ -1010,15 +1010,15 @@ void stm32_dmadump(DMA_HANDLE handle, const struct stm32_dmaregs_s *regs, struct stm32_dma_s *dmast = (struct stm32_dma_s *)handle; uint32_t dmabase = DMA_BASE(dmast->base); - dmadbg("DMA Registers: %s\n", msg); - dmadbg(" LISR[%08x]: %08x\n", dmabase + STM32_DMA_LISR_OFFSET, regs->lisr); - dmadbg(" HISR[%08x]: %08x\n", dmabase + STM32_DMA_HISR_OFFSET, regs->hisr); - dmadbg(" SCR[%08x]: %08x\n", dmast->base + STM32_DMA_SCR_OFFSET, regs->scr); - dmadbg(" SNDTR[%08x]: %08x\n", dmast->base + STM32_DMA_SNDTR_OFFSET, regs->sndtr); - dmadbg(" SPAR[%08x]: %08x\n", dmast->base + STM32_DMA_SPAR_OFFSET, regs->spar); - dmadbg(" SM0AR[%08x]: %08x\n", dmast->base + STM32_DMA_SM0AR_OFFSET, regs->sm0ar); - dmadbg(" SM1AR[%08x]: %08x\n", dmast->base + STM32_DMA_SM1AR_OFFSET, regs->sm1ar); - dmadbg(" SFCR[%08x]: %08x\n", dmast->base + STM32_DMA_SFCR_OFFSET, regs->sfcr); + dmaerr("DMA Registers: %s\n", msg); + dmaerr(" LISR[%08x]: %08x\n", dmabase + STM32_DMA_LISR_OFFSET, regs->lisr); + dmaerr(" HISR[%08x]: %08x\n", dmabase + STM32_DMA_HISR_OFFSET, regs->hisr); + dmaerr(" SCR[%08x]: %08x\n", dmast->base + STM32_DMA_SCR_OFFSET, regs->scr); + dmaerr(" SNDTR[%08x]: %08x\n", dmast->base + STM32_DMA_SNDTR_OFFSET, regs->sndtr); + dmaerr(" SPAR[%08x]: %08x\n", dmast->base + STM32_DMA_SPAR_OFFSET, regs->spar); + dmaerr(" SM0AR[%08x]: %08x\n", dmast->base + STM32_DMA_SM0AR_OFFSET, regs->sm0ar); + dmaerr(" SM1AR[%08x]: %08x\n", dmast->base + STM32_DMA_SM1AR_OFFSET, regs->sm1ar); + dmaerr(" SFCR[%08x]: %08x\n", dmast->base + STM32_DMA_SFCR_OFFSET, regs->sfcr); } #endif diff --git a/arch/arm/src/stm32/stm32f30xxx_i2c.c b/arch/arm/src/stm32/stm32f30xxx_i2c.c index d3ed1ae31c..5f989bf0cd 100644 --- a/arch/arm/src/stm32/stm32f30xxx_i2c.c +++ b/arch/arm/src/stm32/stm32f30xxx_i2c.c @@ -157,10 +157,10 @@ /* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */ #ifdef CONFIG_DEBUG_I2C -# define i2cdbg dbg +# define i2cerr err # define i2cinfo info #else -# define i2cdbg(x...) +# define i2cerr(x...) # define i2cinfo(x...) #endif @@ -975,7 +975,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv, if (priv->tndx >= (CONFIG_I2C_NTRACE-1)) { - i2cdbg("Trace table overflow\n"); + i2cerr("Trace table overflow\n"); return; } @@ -1016,7 +1016,7 @@ static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv, if (priv->tndx >= (CONFIG_I2C_NTRACE-1)) { - i2cdbg("Trace table overflow\n"); + i2cerr("Trace table overflow\n"); return; } @@ -1709,7 +1709,7 @@ static int stm32_i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s status = stm32_i2c_getstatus(priv); ret = -ETIMEDOUT; - i2cdbg("Timed out: CR1: %04x status: %08x\n", + i2cerr("Timed out: CR1: %04x status: %08x\n", stm32_i2c_getreg(priv, STM32_I2C_CR1_OFFSET), status); /* "Note: When the STOP, START or PEC bit is set, the software must diff --git a/arch/arm/src/stm32/stm32f40xxx_dma.c b/arch/arm/src/stm32/stm32f40xxx_dma.c index 0ca3bc31ce..b7a968c84b 100644 --- a/arch/arm/src/stm32/stm32f40xxx_dma.c +++ b/arch/arm/src/stm32/stm32f40xxx_dma.c @@ -605,7 +605,7 @@ void stm32_dmasetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr, uint32_t regoffset; uint32_t regval; - dmadbg("paddr: %08x maddr: %08x ntransfers: %d scr: %08x\n", + dmaerr("paddr: %08x maddr: %08x ntransfers: %d scr: %08x\n", paddr, maddr, ntransfers, scr); #ifdef CONFIG_STM32_DMACAPABLE @@ -1038,15 +1038,15 @@ void stm32_dmadump(DMA_HANDLE handle, const struct stm32_dmaregs_s *regs, struct stm32_dma_s *dmast = (struct stm32_dma_s *)handle; uint32_t dmabase = DMA_BASE(dmast->base); - dmadbg("DMA Registers: %s\n", msg); - dmadbg(" LISR[%08x]: %08x\n", dmabase + STM32_DMA_LISR_OFFSET, regs->lisr); - dmadbg(" HISR[%08x]: %08x\n", dmabase + STM32_DMA_HISR_OFFSET, regs->hisr); - dmadbg(" SCR[%08x]: %08x\n", dmast->base + STM32_DMA_SCR_OFFSET, regs->scr); - dmadbg(" SNDTR[%08x]: %08x\n", dmast->base + STM32_DMA_SNDTR_OFFSET, regs->sndtr); - dmadbg(" SPAR[%08x]: %08x\n", dmast->base + STM32_DMA_SPAR_OFFSET, regs->spar); - dmadbg(" SM0AR[%08x]: %08x\n", dmast->base + STM32_DMA_SM0AR_OFFSET, regs->sm0ar); - dmadbg(" SM1AR[%08x]: %08x\n", dmast->base + STM32_DMA_SM1AR_OFFSET, regs->sm1ar); - dmadbg(" SFCR[%08x]: %08x\n", dmast->base + STM32_DMA_SFCR_OFFSET, regs->sfcr); + dmaerr("DMA Registers: %s\n", msg); + dmaerr(" LISR[%08x]: %08x\n", dmabase + STM32_DMA_LISR_OFFSET, regs->lisr); + dmaerr(" HISR[%08x]: %08x\n", dmabase + STM32_DMA_HISR_OFFSET, regs->hisr); + dmaerr(" SCR[%08x]: %08x\n", dmast->base + STM32_DMA_SCR_OFFSET, regs->scr); + dmaerr(" SNDTR[%08x]: %08x\n", dmast->base + STM32_DMA_SNDTR_OFFSET, regs->sndtr); + dmaerr(" SPAR[%08x]: %08x\n", dmast->base + STM32_DMA_SPAR_OFFSET, regs->spar); + dmaerr(" SM0AR[%08x]: %08x\n", dmast->base + STM32_DMA_SM0AR_OFFSET, regs->sm0ar); + dmaerr(" SM1AR[%08x]: %08x\n", dmast->base + STM32_DMA_SM1AR_OFFSET, regs->sm1ar); + dmaerr(" SFCR[%08x]: %08x\n", dmast->base + STM32_DMA_SFCR_OFFSET, regs->sfcr); } #endif diff --git a/arch/arm/src/stm32/stm32f40xxx_rtcc.c b/arch/arm/src/stm32/stm32f40xxx_rtcc.c index d016e20559..4600ce97fa 100644 --- a/arch/arm/src/stm32/stm32f40xxx_rtcc.c +++ b/arch/arm/src/stm32/stm32f40xxx_rtcc.c @@ -134,12 +134,12 @@ /* Debug ****************************************************************************/ #ifdef CONFIG_DEBUG_RTC -# define rtcdbg dbg +# define rtcerr err # define rtcinfo info # define rtcllerr llerr # define rtcllinfo llinfo #else -# define rtcdbg(x...) +# define rtcerr(x...) # define rtcinfo(x...) # define rtcllerr(x...) # define rtcllinfo(x...) diff --git a/arch/arm/src/stm32f7/stm32_dma.c b/arch/arm/src/stm32f7/stm32_dma.c index 1b7f821d33..cddacbc115 100644 --- a/arch/arm/src/stm32f7/stm32_dma.c +++ b/arch/arm/src/stm32f7/stm32_dma.c @@ -606,7 +606,7 @@ void stm32_dmasetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr, uint32_t regoffset; uint32_t regval; - dmadbg("paddr: %08x maddr: %08x ntransfers: %d scr: %08x\n", + dmaerr("paddr: %08x maddr: %08x ntransfers: %d scr: %08x\n", paddr, maddr, ntransfers, scr); #ifdef CONFIG_STM32_DMACAPABLE @@ -1040,15 +1040,15 @@ void stm32_dmadump(DMA_HANDLE handle, const struct stm32_dmaregs_s *regs, struct stm32_dma_s *dmast = (struct stm32_dma_s *)handle; uint32_t dmabase = DMA_BASE(dmast->base); - dmadbg("DMA Registers: %s\n", msg); - dmadbg(" LISR[%08x]: %08x\n", dmabase + STM32_DMA_LISR_OFFSET, regs->lisr); - dmadbg(" HISR[%08x]: %08x\n", dmabase + STM32_DMA_HISR_OFFSET, regs->hisr); - dmadbg(" SCR[%08x]: %08x\n", dmast->base + STM32_DMA_SCR_OFFSET, regs->scr); - dmadbg(" SNDTR[%08x]: %08x\n", dmast->base + STM32_DMA_SNDTR_OFFSET, regs->sndtr); - dmadbg(" SPAR[%08x]: %08x\n", dmast->base + STM32_DMA_SPAR_OFFSET, regs->spar); - dmadbg(" SM0AR[%08x]: %08x\n", dmast->base + STM32_DMA_SM0AR_OFFSET, regs->sm0ar); - dmadbg(" SM1AR[%08x]: %08x\n", dmast->base + STM32_DMA_SM1AR_OFFSET, regs->sm1ar); - dmadbg(" SFCR[%08x]: %08x\n", dmast->base + STM32_DMA_SFCR_OFFSET, regs->sfcr); + dmaerr("DMA Registers: %s\n", msg); + dmaerr(" LISR[%08x]: %08x\n", dmabase + STM32_DMA_LISR_OFFSET, regs->lisr); + dmaerr(" HISR[%08x]: %08x\n", dmabase + STM32_DMA_HISR_OFFSET, regs->hisr); + dmaerr(" SCR[%08x]: %08x\n", dmast->base + STM32_DMA_SCR_OFFSET, regs->scr); + dmaerr(" SNDTR[%08x]: %08x\n", dmast->base + STM32_DMA_SNDTR_OFFSET, regs->sndtr); + dmaerr(" SPAR[%08x]: %08x\n", dmast->base + STM32_DMA_SPAR_OFFSET, regs->spar); + dmaerr(" SM0AR[%08x]: %08x\n", dmast->base + STM32_DMA_SM0AR_OFFSET, regs->sm0ar); + dmaerr(" SM1AR[%08x]: %08x\n", dmast->base + STM32_DMA_SM1AR_OFFSET, regs->sm1ar); + dmaerr(" SFCR[%08x]: %08x\n", dmast->base + STM32_DMA_SFCR_OFFSET, regs->sfcr); } #endif diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index d2aae9bfa2..4845e564d5 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -3363,7 +3363,7 @@ static inline int stm32_dm9161(struct stm32_ethmac_s *priv) ret = stm32_phyread(CONFIG_STM32F7_PHYADDR, MII_PHYID1, &phyval); if (ret < 0) { - ndbg("ERROR: Failed to read the PHY ID1: %d\n", ret); + nerr("ERROR: Failed to read the PHY ID1: %d\n", ret); return ret; } @@ -3381,7 +3381,7 @@ static inline int stm32_dm9161(struct stm32_ethmac_s *priv) ret = stm32_phyread(CONFIG_STM32F7_PHYADDR, 16, &phyval); if (ret < 0) { - ndbg("ERROR: Failed to read the PHY Register 0x10: %d\n", ret); + nerr("ERROR: Failed to read the PHY Register 0x10: %d\n", ret); return ret; } @@ -3438,7 +3438,7 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv) ret = stm32_phywrite(CONFIG_STM32F7_PHYADDR, MII_MCR, MII_MCR_RESET); if (ret < 0) { - ndbg("ERROR: Failed to reset the PHY: %d\n", ret); + nerr("ERROR: Failed to reset the PHY: %d\n", ret); return ret; } up_mdelay(PHY_RESET_DELAY); @@ -3449,7 +3449,7 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv) ret = stm32_phy_boardinitialize(0); if (ret < 0) { - ndbg("ERROR: Failed to initialize the PHY: %d\n", ret); + nerr("ERROR: Failed to initialize the PHY: %d\n", ret); return ret; } #endif @@ -3474,7 +3474,7 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv) ret = stm32_phyread(CONFIG_STM32F7_PHYADDR, MII_MSR, &phyval); if (ret < 0) { - ndbg("ERROR: Failed to read the PHY MSR: %d\n", ret); + nerr("ERROR: Failed to read the PHY MSR: %d\n", ret); return ret; } else if ((phyval & MII_MSR_LINKSTATUS) != 0) @@ -3485,7 +3485,7 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv) if (timeout >= PHY_RETRY_TIMEOUT) { - ndbg("ERROR: Timed out waiting for link status: %04x\n", phyval); + nerr("ERROR: Timed out waiting for link status: %04x\n", phyval); return -ETIMEDOUT; } @@ -3494,7 +3494,7 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv) ret = stm32_phywrite(CONFIG_STM32F7_PHYADDR, MII_MCR, MII_MCR_ANENABLE); if (ret < 0) { - ndbg("ERROR: Failed to enable auto-negotiation: %d\n", ret); + nerr("ERROR: Failed to enable auto-negotiation: %d\n", ret); return ret; } @@ -3505,7 +3505,7 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv) ret = stm32_phyread(CONFIG_STM32F7_PHYADDR, MII_MSR, &phyval); if (ret < 0) { - ndbg("ERROR: Failed to read the PHY MSR: %d\n", ret); + nerr("ERROR: Failed to read the PHY MSR: %d\n", ret); return ret; } else if ((phyval & MII_MSR_ANEGCOMPLETE) != 0) @@ -3516,7 +3516,7 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv) if (timeout >= PHY_RETRY_TIMEOUT) { - ndbg("ERROR: Timed out waiting for auto-negotiation\n"); + nerr("ERROR: Timed out waiting for auto-negotiation\n"); return -ETIMEDOUT; } @@ -3525,7 +3525,7 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv) ret = stm32_phyread(CONFIG_STM32F7_PHYADDR, CONFIG_STM32F7_PHYSR, &phyval); if (ret < 0) { - ndbg("ERROR: Failed to read PHY status register\n"); + nerr("ERROR: Failed to read PHY status register\n"); return ret; } @@ -3543,7 +3543,7 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv) switch (phyval & CONFIG_STM32F7_PHYSR_ALTMODE) { default: - ndbg("ERROR: Unrecognized PHY status setting\n"); + nerr("ERROR: Unrecognized PHY status setting\n"); case CONFIG_STM32F7_PHYSR_10HD: priv->fduplex = 0; @@ -3597,7 +3597,7 @@ static int stm32_phyinit(struct stm32_ethmac_s *priv) ret = stm32_phywrite(CONFIG_STM32F7_PHYADDR, MII_MCR, phyval); if (ret < 0) { - ndbg("ERROR: Failed to write the PHY MCR: %d\n", ret); + nerr("ERROR: Failed to write the PHY MCR: %d\n", ret); return ret; } diff --git a/arch/arm/src/stm32f7/stm32_irq.c b/arch/arm/src/stm32f7/stm32_irq.c index 125555cbcb..7a541270de 100644 --- a/arch/arm/src/stm32f7/stm32_irq.c +++ b/arch/arm/src/stm32f7/stm32_irq.c @@ -173,7 +173,7 @@ static void stm32_dumpnvic(const char *msg, int irq) #endif /**************************************************************************** - * Name: stm32_nmi, stm32_busfault, stm32_usagefault, stm32_pendsv, stm32_dbgmonitor, + * Name: stm32_nmi, stm32_busfault, stm32_usagefault, stm32_pendsv, stm32_errmonitor, * stm32_pendsv, stm32_reserved * * Description: @@ -187,7 +187,7 @@ static void stm32_dumpnvic(const char *msg, int irq) static int stm32_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -195,7 +195,7 @@ static int stm32_nmi(int irq, FAR void *context) static int stm32_busfault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); + err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; } @@ -203,7 +203,7 @@ static int stm32_busfault(int irq, FAR void *context) static int stm32_usagefault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); + err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; } @@ -211,15 +211,15 @@ static int stm32_usagefault(int irq, FAR void *context) static int stm32_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } -static int stm32_dbgmonitor(int irq, FAR void *context) +static int stm32_errmonitor(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Debug Monitor received\n"); + err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; } @@ -227,7 +227,7 @@ static int stm32_dbgmonitor(int irq, FAR void *context) static int stm32_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } @@ -498,7 +498,7 @@ void up_irqinitialize(void) irq_attach(STM32_IRQ_BUSFAULT, stm32_busfault); irq_attach(STM32_IRQ_USAGEFAULT, stm32_usagefault); irq_attach(STM32_IRQ_PENDSV, stm32_pendsv); - irq_attach(STM32_IRQ_DBGMONITOR, stm32_dbgmonitor); + irq_attach(STM32_IRQ_DBGMONITOR, stm32_errmonitor); irq_attach(STM32_IRQ_RESERVED, stm32_reserved); #endif diff --git a/arch/arm/src/stm32f7/stm32_procfs_dtcm.c b/arch/arm/src/stm32f7/stm32_procfs_dtcm.c index 59faa89318..30c54f2387 100644 --- a/arch/arm/src/stm32f7/stm32_procfs_dtcm.c +++ b/arch/arm/src/stm32f7/stm32_procfs_dtcm.c @@ -157,7 +157,7 @@ static int dtcm_open(FAR struct file *filep, FAR const char *relpath, if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - fdbg("ERROR: Only O_RDONLY supported\n"); + ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; } @@ -165,7 +165,7 @@ static int dtcm_open(FAR struct file *filep, FAR const char *relpath, if (strcmp(relpath, "dtcm") != 0) { - fdbg("ERROR: relpath is '%s'\n", relpath); + ferr("ERROR: relpath is '%s'\n", relpath); return -ENOENT; } @@ -174,7 +174,7 @@ static int dtcm_open(FAR struct file *filep, FAR const char *relpath, priv = (FAR struct dtcm_file_s *)kmm_zalloc(sizeof(struct dtcm_file_s)); if (!priv) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -290,7 +290,7 @@ static int dtcm_dup(FAR const struct file *oldp, FAR struct file *newp) newpriv = (FAR struct dtcm_file_s *)kmm_zalloc(sizeof(struct dtcm_file_s)); if (!newpriv) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -308,7 +308,7 @@ static int dtcm_stat(const char *relpath, struct stat *buf) { if (strcmp(relpath, "dtcm") != 0) { - fdbg("ERROR: relpath is '%s'\n", relpath); + ferr("ERROR: relpath is '%s'\n", relpath); return -ENOENT; } diff --git a/arch/arm/src/stm32l4/stm32l4_can.c b/arch/arm/src/stm32l4/stm32l4_can.c index bb4e049312..5a23b36cbf 100644 --- a/arch/arm/src/stm32l4/stm32l4_can.c +++ b/arch/arm/src/stm32l4/stm32l4_can.c @@ -86,12 +86,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -1588,7 +1588,7 @@ FAR struct can_dev_s *stm32l4_caninitialize(int port) else #endif { - candbg("ERROR: Unsupported port %d\n", port); + canerr("ERROR: Unsupported port %d\n", port); return NULL; } diff --git a/arch/arm/src/stm32l4/stm32l4_i2c.c b/arch/arm/src/stm32l4/stm32l4_i2c.c index 679739d995..49088d947b 100644 --- a/arch/arm/src/stm32l4/stm32l4_i2c.c +++ b/arch/arm/src/stm32l4/stm32l4_i2c.c @@ -149,10 +149,10 @@ /* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */ #ifdef CONFIG_DEBUG_I2C -# define i2cdbg dbg +# define i2cerr err # define i2cinfo info #else -# define i2cdbg(x...) +# define i2cerr(x...) # define i2cinfo(x...) #endif @@ -919,7 +919,7 @@ static void stm32l4_i2c_tracenew(FAR struct stm32l4_i2c_priv_s *priv, if (priv->tndx >= (CONFIG_I2C_NTRACE-1)) { - i2cdbg("Trace table overflow\n"); + i2cerr("Trace table overflow\n"); return; } @@ -960,7 +960,7 @@ static void stm32l4_i2c_traceevent(FAR struct stm32l4_i2c_priv_s *priv, if (priv->tndx >= (CONFIG_I2C_NTRACE-1)) { - i2cdbg("Trace table overflow\n"); + i2cerr("Trace table overflow\n"); return; } @@ -1731,7 +1731,7 @@ static int stm32l4_i2c_transfer(FAR struct i2c_master_s *dev, FAR struct i2c_msg status = stm32l4_i2c_getstatus(priv); ret = -ETIMEDOUT; - i2cdbg("Timed out: CR1: %08x status: %08x\n", + i2cerr("Timed out: CR1: %08x status: %08x\n", stm32l4_i2c_getreg32(priv, STM32L4_I2C_CR1_OFFSET), status); /* "Note: When the STOP, START or PEC bit is set, the software must diff --git a/arch/arm/src/stm32l4/stm32l4_irq.c b/arch/arm/src/stm32l4/stm32l4_irq.c index 2a11ef105f..93903c8924 100644 --- a/arch/arm/src/stm32l4/stm32l4_irq.c +++ b/arch/arm/src/stm32l4/stm32l4_irq.c @@ -148,7 +148,7 @@ static void stm32l4_dumpnvic(const char *msg, int irq) /**************************************************************************** * Name: stm32l4_nmi, stm32l4_busfault, stm32l4_usagefault, stm32l4_pendsv, - * stm32l4_dbgmonitor, stm32l4_pendsv, stm32l4_reserved + * stm32l4_errmonitor, stm32l4_pendsv, stm32l4_reserved * * Description: * Handlers for various execptions. None are handled and all are fatal @@ -161,7 +161,7 @@ static void stm32l4_dumpnvic(const char *msg, int irq) static int stm32l4_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -169,7 +169,7 @@ static int stm32l4_nmi(int irq, FAR void *context) static int stm32l4_busfault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); + err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; } @@ -177,7 +177,7 @@ static int stm32l4_busfault(int irq, FAR void *context) static int stm32l4_usagefault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); + err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; } @@ -185,15 +185,15 @@ static int stm32l4_usagefault(int irq, FAR void *context) static int stm32l4_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } -static int stm32l4_dbgmonitor(int irq, FAR void *context) +static int stm32l4_errmonitor(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Debug Monitor received\n"); + err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; } @@ -201,7 +201,7 @@ static int stm32l4_dbgmonitor(int irq, FAR void *context) static int stm32l4_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } @@ -411,7 +411,7 @@ void up_irqinitialize(void) irq_attach(STM32L4_IRQ_BUSFAULT, stm32l4_busfault); irq_attach(STM32L4_IRQ_USAGEFAULT, stm32l4_usagefault); irq_attach(STM32L4_IRQ_PENDSV, stm32l4_pendsv); - irq_attach(STM32L4_IRQ_DBGMONITOR, stm32l4_dbgmonitor); + irq_attach(STM32L4_IRQ_DBGMONITOR, stm32l4_errmonitor); irq_attach(STM32L4_IRQ_RESERVED, stm32l4_reserved); #endif diff --git a/arch/arm/src/stm32l4/stm32l4_qspi.c b/arch/arm/src/stm32l4/stm32l4_qspi.c index 459b921ab6..90fb091d55 100644 --- a/arch/arm/src/stm32l4/stm32l4_qspi.c +++ b/arch/arm/src/stm32l4/stm32l4_qspi.c @@ -101,14 +101,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define qspidbg llerr +# define qspierr llerr # ifdef CONFIG_DEBUG_INFO # define qspiinfo llerr # else # define qspiinfo(x...) # endif #else -# define qspidbg(x...) +# define qspierr(x...) # define qspiinfo(x...) #endif @@ -1472,7 +1472,7 @@ static int qspi_memory_dma(struct stm32l4_qspidev_s *priv, (wdentry_t)qspi_dma_timeout, 1, (uint32_t)priv); if (ret != OK) { - qspidbg("ERROR: wd_start failed: %d\n", ret); + qspierr("ERROR: wd_start failed: %d\n", ret); } /* Wait for the DMA complete */ @@ -1535,7 +1535,7 @@ static int qspi_memory_dma(struct stm32l4_qspidev_s *priv, if (priv->result) { - qspidbg("ERROR: DMA failed with result: %d\n", priv->result); + qspierr("ERROR: DMA failed with result: %d\n", priv->result); } return priv->result; @@ -2497,7 +2497,7 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf) } else { - qspidbg("ERROR: QSPI%d not supported\n", intf); + qspierr("ERROR: QSPI%d not supported\n", intf); return NULL; } @@ -2520,7 +2520,7 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf) priv->dmach = stm32l4_dmachannel(DMACHAN_QUADSPI); if (!priv->dmach) { - qspidbg("ERROR: Failed to allocate the DMA channel\n"); + qspierr("ERROR: Failed to allocate the DMA channel\n"); priv->candma = false; } } @@ -2536,7 +2536,7 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf) priv->dmadog = wd_create(); if (priv->dmadog == NULL) { - qspidbg("ERROR: Failed to create wdog\n"); + qspierr("ERROR: Failed to create wdog\n"); goto errout_with_dmahandles; } #endif @@ -2547,7 +2547,7 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf) ret = irq_attach(priv->irq, priv->handler); if (ret < 0) { - qspidbg("ERROR: Failed to attach irq %d\n", priv->irq); + qspierr("ERROR: Failed to attach irq %d\n", priv->irq); goto errout_with_dmadog; } @@ -2564,7 +2564,7 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf) ret = qspi_hw_initialize(priv); if (ret < 0) { - qspidbg("ERROR: Failed to initialize QSPI hardware\n"); + qspierr("ERROR: Failed to initialize QSPI hardware\n"); goto errout_with_irq; } diff --git a/arch/arm/src/stm32l4/stm32l4_rtcc.c b/arch/arm/src/stm32l4/stm32l4_rtcc.c index 1d959e688a..d2d055fcbd 100644 --- a/arch/arm/src/stm32l4/stm32l4_rtcc.c +++ b/arch/arm/src/stm32l4/stm32l4_rtcc.c @@ -119,12 +119,12 @@ /* Debug ****************************************************************************/ #ifdef CONFIG_DEBUG_RTC -# define rtcdbg dbg +# define rtcerr err # define rtcinfo info # define rtcllerr llerr # define rtcllinfo llinfo #else -# define rtcdbg(x...) +# define rtcerr(x...) # define rtcinfo(x...) # define rtcllerr(x...) # define rtcllinfo(x...) diff --git a/arch/arm/src/stm32l4/stm32l4_spi.c b/arch/arm/src/stm32l4/stm32l4_spi.c index 05d6409035..dc8811dfd9 100644 --- a/arch/arm/src/stm32l4/stm32l4_spi.c +++ b/arch/arm/src/stm32l4/stm32l4_spi.c @@ -146,14 +146,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -1627,7 +1627,7 @@ FAR struct spi_dev_s *stm32l4_spibus_initialize(int bus) else #endif { - spidbg("ERROR: Unsupbused SPI bus: %d\n", bus); + spierr("ERROR: Unsupbused SPI bus: %d\n", bus); return NULL; } diff --git a/arch/arm/src/stm32l4/stm32l4x6xx_dma.c b/arch/arm/src/stm32l4/stm32l4x6xx_dma.c index eb91e3a754..e854d32261 100644 --- a/arch/arm/src/stm32l4/stm32l4x6xx_dma.c +++ b/arch/arm/src/stm32l4/stm32l4x6xx_dma.c @@ -762,13 +762,13 @@ void stm32l4_dmadump(DMA_HANDLE handle, const struct stm32l4_dmaregs_s *regs, struct stm32l4_dma_s *dmach = (struct stm32l4_dma_s *)handle; uint32_t dmabase = DMA_BASE(dmach->base); - dmadbg("DMA Registers: %s\n", msg); - dmadbg(" ISR[%08x]: %08x\n", dmabase + STM32L4_DMA_ISR_OFFSET, regs->isr); - dmadbg(" CSELR[%08x]: %08x\n", dmabase + STM32L4_DMA_CSELR_OFFSET, regs->cselr); - dmadbg(" CCR[%08x]: %08x\n", dmach->base + STM32L4_DMACHAN_CCR_OFFSET, regs->ccr); - dmadbg(" CNDTR[%08x]: %08x\n", dmach->base + STM32L4_DMACHAN_CNDTR_OFFSET, regs->cndtr); - dmadbg(" CPAR[%08x]: %08x\n", dmach->base + STM32L4_DMACHAN_CPAR_OFFSET, regs->cpar); - dmadbg(" CMAR[%08x]: %08x\n", dmach->base + STM32L4_DMACHAN_CMAR_OFFSET, regs->cmar); + dmaerr("DMA Registers: %s\n", msg); + dmaerr(" ISR[%08x]: %08x\n", dmabase + STM32L4_DMA_ISR_OFFSET, regs->isr); + dmaerr(" CSELR[%08x]: %08x\n", dmabase + STM32L4_DMA_CSELR_OFFSET, regs->cselr); + dmaerr(" CCR[%08x]: %08x\n", dmach->base + STM32L4_DMACHAN_CCR_OFFSET, regs->ccr); + dmaerr(" CNDTR[%08x]: %08x\n", dmach->base + STM32L4_DMACHAN_CNDTR_OFFSET, regs->cndtr); + dmaerr(" CPAR[%08x]: %08x\n", dmach->base + STM32L4_DMACHAN_CPAR_OFFSET, regs->cpar); + dmaerr(" CMAR[%08x]: %08x\n", dmach->base + STM32L4_DMACHAN_CMAR_OFFSET, regs->cmar); } #endif diff --git a/arch/arm/src/tiva/lm3s_ethernet.c b/arch/arm/src/tiva/lm3s_ethernet.c index 9a9f72e97b..bc22d7439d 100644 --- a/arch/arm/src/tiva/lm3s_ethernet.c +++ b/arch/arm/src/tiva/lm3s_ethernet.c @@ -1455,7 +1455,7 @@ static inline int tiva_ethinitialize(int intf) /* Check if the Ethernet module is present */ - ndbg("Setting up eth%d\n", intf); + nerr("Setting up eth%d\n", intf); #if TIVA_NETHCONTROLLERS > 1 # error "This debug check only works with one interface" diff --git a/arch/arm/src/tiva/tiva_adclib.c b/arch/arm/src/tiva/tiva_adclib.c index cb561682ed..8376e51cc8 100644 --- a/arch/arm/src/tiva/tiva_adclib.c +++ b/arch/arm/src/tiva/tiva_adclib.c @@ -417,7 +417,7 @@ void tiva_adc_irq_attach(uint8_t adc, uint8_t sse, xcpt_t isr) ret = irq_attach(irq, isr); if (ret < 0) { - adbg("ERROR: Failed to attach IRQ %d: %d\n", irq, ret); + aerr("ERROR: Failed to attach IRQ %d: %d\n", irq, ret); return; } @@ -446,7 +446,7 @@ void tiva_adc_irq_detach(uint8_t adc, uint8_t sse) ret = irq_detach(irq); if (ret < 0) { - adbg("ERROR: Failed to detach IRQ %d: %d\n", irq, ret); + aerr("ERROR: Failed to detach IRQ %d: %d\n", irq, ret); return; } } diff --git a/arch/arm/src/tiva/tiva_adclow.c b/arch/arm/src/tiva/tiva_adclow.c index 9e4ecd59b0..809cb65b3b 100644 --- a/arch/arm/src/tiva/tiva_adclow.c +++ b/arch/arm/src/tiva/tiva_adclow.c @@ -753,7 +753,7 @@ static void tiva_adc_interrupt(struct tiva_adc_sse_s *sse) ret = work_queue(HPWORK, &sse->work, tiva_adc_read, sse, 0); if (ret != 0) { - adbg("ERROR: Failed to queue work: %d ADC.SSE: %d.%d\n", + aerr("ERROR: Failed to queue work: %d ADC.SSE: %d.%d\n", ret, sse->adc, sse->num); } } @@ -879,7 +879,7 @@ int tiva_adc_initialize(const char *devpath, struct tiva_adc_cfg_s *cfg, adc = tiva_adc_struct_init(cfg); if (adc == NULL) { - adbg("Invalid ADC device number: expected=%d actual=%d\n", + aerr("Invalid ADC device number: expected=%d actual=%d\n", 0, cfg->adc); return -ENODEV; } @@ -888,7 +888,7 @@ int tiva_adc_initialize(const char *devpath, struct tiva_adc_cfg_s *cfg, if (tiva_adc_enable(adc->devno, true) < 0) { - adbg("ERROR: failure to power ADC peripheral (devno=%d)\n", + aerr("ERROR: failure to power ADC peripheral (devno=%d)\n", cfg->adc); return ret; } @@ -912,7 +912,7 @@ int tiva_adc_initialize(const char *devpath, struct tiva_adc_cfg_s *cfg, if (adc->dev == NULL) { - adbg("ERROR: Failed to get interface %s\n", devpath); + aerr("ERROR: Failed to get interface %s\n", devpath); return -ENODEV; } @@ -925,7 +925,7 @@ int tiva_adc_initialize(const char *devpath, struct tiva_adc_cfg_s *cfg, ret = adc_register(devpath, adc->dev); if (ret < 0) { - adbg("ERROR: Failed to register %s to character driver: %d\n", + aerr("ERROR: Failed to register %s to character driver: %d\n", devpath, ret); return ret; } diff --git a/arch/arm/src/tiva/tiva_gpio.h b/arch/arm/src/tiva/tiva_gpio.h index 2d8f12e2c3..17f3957f07 100644 --- a/arch/arm/src/tiva/tiva_gpio.h +++ b/arch/arm/src/tiva/tiva_gpio.h @@ -326,12 +326,12 @@ #endif #ifdef CONFIG_DEBUG_GPIO -# define gpiodbg(format, ...) dbg(format, ##__VA_ARGS__) +# define gpioerr(format, ...) err(format, ##__VA_ARGS__) # define gpiollerr(format, ...) llerr(format, ##__VA_ARGS__) # define gpioinfo(format, ...) info(format, ##__VA_ARGS__) # define gpiollinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define gpiodbg(x...) +# define gpioerr(x...) # define gpiollerr(x...) # define gpioinfo(x...) # define gpiollinfo(x...) diff --git a/arch/arm/src/tiva/tiva_i2c.c b/arch/arm/src/tiva/tiva_i2c.c index 0c83dc1b15..375f52ff4a 100644 --- a/arch/arm/src/tiva/tiva_i2c.c +++ b/arch/arm/src/tiva/tiva_i2c.c @@ -122,10 +122,10 @@ /* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */ #ifdef CONFIG_DEBUG_I2C -# define i2cdbg dbg +# define i2cerr err # define i2cinfo info #else -# define i2cdbg(x...) +# define i2cerr(x...) # define i2cinfo(x...) #endif @@ -968,7 +968,7 @@ static void tiva_i2c_tracenew(struct tiva_i2c_priv_s *priv, uint32_t status) if (priv->tndx >= (CONFIG_I2C_NTRACE-1)) { - i2cdbg("I2C%d: ERROR: Trace table overflow\n", priv->config->devno); + i2cerr("I2C%d: ERROR: Trace table overflow\n", priv->config->devno); return; } @@ -1017,7 +1017,7 @@ static void tiva_i2c_traceevent(struct tiva_i2c_priv_s *priv, if (priv->tndx >= (CONFIG_I2C_NTRACE-1)) { - i2cdbg("I2C%d: ERROR: Trace table overflow\n", priv->config->devno); + i2cerr("I2C%d: ERROR: Trace table overflow\n", priv->config->devno); return; } @@ -1916,7 +1916,7 @@ static int tiva_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgv, if (tiva_i2c_sem_waitdone(priv) < 0) { - i2cdbg("I2C%d: ERROR: Timed out\n", priv->config->devno); + i2cerr("I2C%d: ERROR: Timed out\n", priv->config->devno); ret = -ETIMEDOUT; } #if 0 /* I2CM_CS_CLKTO */ @@ -1925,7 +1925,7 @@ static int tiva_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgv, else if ((priv->mstatus & (I2CM_CS_ERROR | I2CM_CS_ARBLST)) != 0) #endif { - i2cdbg("I2C%d: ERROR: I2C error status: %08x\n", + i2cerr("I2C%d: ERROR: I2C error status: %08x\n", priv->config->devno, priv->mstatus); if ((priv->mstatus & I2CM_CS_ARBLST) != 0) @@ -1972,7 +1972,7 @@ static int tiva_i2c_transfer(struct i2c_master_s *dev, struct i2c_msg_s *msgv, * other bits are valid. */ - i2cdbg("I2C%d: ERROR: I2C still busy: %08x\n", + i2cerr("I2C%d: ERROR: I2C still busy: %08x\n", priv->config->devno, regval); /* Reset and reinitialize the I2C hardware */ @@ -2221,7 +2221,7 @@ struct i2c_master_s *tiva_i2cbus_initialize(int port) #endif default: - i2cdbg("I2C%d: ERROR: Not supported\n", port); + i2cerr("I2C%d: ERROR: Not supported\n", port); return NULL; } diff --git a/arch/arm/src/tiva/tiva_irq.c b/arch/arm/src/tiva/tiva_irq.c index 121d93bdfb..7e51ab03f8 100644 --- a/arch/arm/src/tiva/tiva_irq.c +++ b/arch/arm/src/tiva/tiva_irq.c @@ -186,7 +186,7 @@ static void tiva_dumpnvic(const char *msg, int irq) /**************************************************************************** * Name: tiva_nmi, tiva_busfault, tiva_usagefault, tiva_pendsv, - * tiva_dbgmonitor, tiva_pendsv, tiva_reserved + * tiva_errmonitor, tiva_pendsv, tiva_reserved * * Description: * Handlers for various execptions. None are handled and all are fatal @@ -199,7 +199,7 @@ static void tiva_dumpnvic(const char *msg, int irq) static int tiva_nmi(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! NMI received\n"); + err("PANIC!!! NMI received\n"); PANIC(); return 0; } @@ -207,7 +207,7 @@ static int tiva_nmi(int irq, FAR void *context) static int tiva_busfault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Bus fault recived\n"); + err("PANIC!!! Bus fault recived\n"); PANIC(); return 0; } @@ -215,7 +215,7 @@ static int tiva_busfault(int irq, FAR void *context) static int tiva_usagefault(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Usage fault received\n"); + err("PANIC!!! Usage fault received\n"); PANIC(); return 0; } @@ -223,15 +223,15 @@ static int tiva_usagefault(int irq, FAR void *context) static int tiva_pendsv(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! PendSV received\n"); + err("PANIC!!! PendSV received\n"); PANIC(); return 0; } -static int tiva_dbgmonitor(int irq, FAR void *context) +static int tiva_errmonitor(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Debug Monitor received\n"); + err("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; } @@ -239,7 +239,7 @@ static int tiva_dbgmonitor(int irq, FAR void *context) static int tiva_reserved(int irq, FAR void *context) { (void)up_irq_save(); - dbg("PANIC!!! Reserved interrupt\n"); + err("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; } @@ -482,7 +482,7 @@ void up_irqinitialize(void) irq_attach(TIVA_IRQ_BUSFAULT, tiva_busfault); irq_attach(TIVA_IRQ_USAGEFAULT, tiva_usagefault); irq_attach(TIVA_IRQ_PENDSV, tiva_pendsv); - irq_attach(TIVA_IRQ_DBGMONITOR, tiva_dbgmonitor); + irq_attach(TIVA_IRQ_DBGMONITOR, tiva_errmonitor); irq_attach(TIVA_IRQ_RESERVED, tiva_reserved); #endif diff --git a/arch/arm/src/tiva/tiva_ssi.c b/arch/arm/src/tiva/tiva_ssi.c index a49ed5b023..eb8972bb0b 100644 --- a/arch/arm/src/tiva/tiva_ssi.c +++ b/arch/arm/src/tiva/tiva_ssi.c @@ -73,10 +73,10 @@ #undef SSI_DEBUG /* Define to enable debug */ #ifdef SSI_DEBUG -# define ssidbg llerr +# define ssierr llerr # define ssiinfo llinfo #else -# define ssidbg(x...) +# define ssierr(x...) # define ssiinfo(x...) #endif @@ -841,7 +841,7 @@ static int ssi_transfer(struct tiva_ssidev_s *priv, const void *txbuffer, #endif int ntxd; - ssidbg("txbuffer: %p rxbuffer: %p nwords: %d\n", txbuffer, rxbuffer, nwords); + ssierr("txbuffer: %p rxbuffer: %p nwords: %d\n", txbuffer, rxbuffer, nwords); /* Set up to perform the transfer */ @@ -913,7 +913,7 @@ static int ssi_transfer(struct tiva_ssidev_s *priv, const void *txbuffer, ssi_semtake(&priv->xfrsem); } while (priv->nrxwords < priv->nwords); - ssidbg("Transfer complete\n"); + ssierr("Transfer complete\n"); #else /* Perform the transfer using polling logic. This will totally @@ -1025,7 +1025,7 @@ static int ssi_interrupt(int irq, void *context) #ifdef SSI_DEBUG if ((regval & SSI_RIS_ROR) != 0) { - ssidbg("Rx FIFO Overrun!\n"); + ssierr("Rx FIFO Overrun!\n"); } #endif @@ -1056,7 +1056,7 @@ static int ssi_interrupt(int irq, void *context) /* Wake up the waiting thread */ - ssidbg("Transfer complete\n"); + ssierr("Transfer complete\n"); ssi_semgive(&priv->xfrsem); } @@ -1137,7 +1137,7 @@ static uint32_t ssi_setfrequencyinternal(struct tiva_ssidev_s *priv, uint32_t scr; uint32_t actual; - ssidbg("frequency: %d\n", frequency); + ssierr("frequency: %d\n", frequency); DEBUGASSERT(frequency); /* Has the frequency changed? */ @@ -1261,7 +1261,7 @@ static void ssi_setmodeinternal(struct tiva_ssidev_s *priv, enum spi_mode_e mode uint32_t modebits; uint32_t regval; - ssidbg("mode: %d\n", mode); + ssierr("mode: %d\n", mode); DEBUGASSERT(priv); /* Has the number of bits per word changed? */ @@ -1340,7 +1340,7 @@ static void ssi_setbitsinternal(struct tiva_ssidev_s *priv, int nbits) { uint32_t regval; - ssidbg("nbits: %d\n", nbits); + ssierr("nbits: %d\n", nbits); DEBUGASSERT(priv); if (nbits != priv->nbits && nbits >= 4 && nbits <= 16) { @@ -1507,7 +1507,7 @@ FAR struct spi_dev_s *tiva_ssibus_initialize(int port) struct tiva_ssidev_s *priv; irqstate_t flags; - ssidbg("port: %d\n", port); + ssierr("port: %d\n", port); /* Set up for the selected port */ diff --git a/arch/arm/src/tiva/tiva_timer.h b/arch/arm/src/tiva/tiva_timer.h index 3b8135247b..16dacb92bd 100644 --- a/arch/arm/src/tiva/tiva_timer.h +++ b/arch/arm/src/tiva/tiva_timer.h @@ -134,10 +134,10 @@ */ #ifdef CONFIG_DEBUG_TIMER -# define timdbg llerr +# define timerr llerr # define timinfo llinfo #else -# define timdbg(x...) +# define timerr(x...) # define timinfo(x...) #endif diff --git a/arch/arm/src/tiva/tiva_timerlow32.c b/arch/arm/src/tiva/tiva_timerlow32.c index 8840ba55d6..c96b8a4570 100644 --- a/arch/arm/src/tiva/tiva_timerlow32.c +++ b/arch/arm/src/tiva/tiva_timerlow32.c @@ -565,7 +565,7 @@ int tiva_timer_initialize(FAR const char *devpath, priv = (struct tiva_lowerhalf_s *)kmm_zalloc(sizeof(struct tiva_lowerhalf_s)); if (!priv) { - timdbg("ERROR: Failed to allocate driver structure\n"); + timerr("ERROR: Failed to allocate driver structure\n"); return -ENOMEM; } @@ -577,7 +577,7 @@ int tiva_timer_initialize(FAR const char *devpath, #else if (config->cmn.alternate) { - timdbg("ERROR: Alternate clock unsupported on TM4C123 architecture\n"); + timerr("ERROR: Alternate clock unsupported on TM4C123 architecture\n"); return -ENOMEM; } else @@ -599,7 +599,7 @@ int tiva_timer_initialize(FAR const char *devpath, priv->handle = tiva_gptm_configure((const struct tiva_gptmconfig_s *)&priv->config); if (!priv->handle) { - timdbg("ERROR: Failed to create timer handle\n"); + timerr("ERROR: Failed to create timer handle\n"); ret = -EINVAL; goto errout_with_alloc; } diff --git a/arch/arm/src/tiva/tm4c_ethernet.c b/arch/arm/src/tiva/tm4c_ethernet.c index dfff51354b..56080a416e 100644 --- a/arch/arm/src/tiva/tm4c_ethernet.c +++ b/arch/arm/src/tiva/tm4c_ethernet.c @@ -2488,12 +2488,12 @@ static int tiva_ifup(struct net_driver_s *dev) int ret; #ifdef CONFIG_NET_IPv4 - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); #endif #ifdef CONFIG_NET_IPv6 - ndbg("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + nerr("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2], dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5], dev->d_ipv6addr[6], dev->d_ipv6addr[7]); @@ -3236,7 +3236,7 @@ static int tiva_phyread(uint16_t phydevaddr, uint16_t phyregaddr, uint16_t *valu } } - ndbg("MII transfer timed out: phydevaddr: %04x phyregaddr: %04x\n", + nerr("MII transfer timed out: phydevaddr: %04x phyregaddr: %04x\n", phydevaddr, phyregaddr); return -ETIMEDOUT; @@ -3295,7 +3295,7 @@ static int tiva_phywrite(uint16_t phydevaddr, uint16_t phyregaddr, uint16_t valu } } - ndbg("MII transfer timed out: phydevaddr: %04x phyregaddr: %04x value: %04x\n", + nerr("MII transfer timed out: phydevaddr: %04x phyregaddr: %04x value: %04x\n", phydevaddr, phyregaddr, value); return -ETIMEDOUT; @@ -3343,7 +3343,7 @@ static int tiva_phyinit(FAR struct tiva_ethmac_s *priv) ret = tiva_phywrite(CONFIG_TIVA_PHYADDR, MII_MCR, MII_MCR_RESET); if (ret < 0) { - ndbg("Failed to reset the PHY: %d\n", ret); + nerr("Failed to reset the PHY: %d\n", ret); return ret; } @@ -3359,7 +3359,7 @@ static int tiva_phyinit(FAR struct tiva_ethmac_s *priv) ret = tiva_phyread(CONFIG_TIVA_PHYADDR, MII_MSR, &phyval); if (ret < 0) { - ndbg("Failed to read the PHY MSR: %d\n", ret); + nerr("Failed to read the PHY MSR: %d\n", ret); return ret; } else if ((phyval & MII_MSR_LINKSTATUS) != 0) @@ -3370,7 +3370,7 @@ static int tiva_phyinit(FAR struct tiva_ethmac_s *priv) if (timeout >= PHY_RETRY_TIMEOUT) { - ndbg("Timed out waiting for link status: %04x\n", phyval); + nerr("Timed out waiting for link status: %04x\n", phyval); return -ETIMEDOUT; } @@ -3379,7 +3379,7 @@ static int tiva_phyinit(FAR struct tiva_ethmac_s *priv) ret = tiva_phywrite(CONFIG_TIVA_PHYADDR, MII_MCR, MII_MCR_ANENABLE); if (ret < 0) { - ndbg("Failed to enable auto-negotiation: %d\n", ret); + nerr("Failed to enable auto-negotiation: %d\n", ret); return ret; } @@ -3390,7 +3390,7 @@ static int tiva_phyinit(FAR struct tiva_ethmac_s *priv) ret = tiva_phyread(CONFIG_TIVA_PHYADDR, MII_MSR, &phyval); if (ret < 0) { - ndbg("Failed to read the PHY MSR: %d\n", ret); + nerr("Failed to read the PHY MSR: %d\n", ret); return ret; } else if ((phyval & MII_MSR_ANEGCOMPLETE) != 0) @@ -3401,7 +3401,7 @@ static int tiva_phyinit(FAR struct tiva_ethmac_s *priv) if (timeout >= PHY_RETRY_TIMEOUT) { - ndbg("Timed out waiting for auto-negotiation\n"); + nerr("Timed out waiting for auto-negotiation\n"); return -ETIMEDOUT; } @@ -3410,7 +3410,7 @@ static int tiva_phyinit(FAR struct tiva_ethmac_s *priv) ret = tiva_phyread(CONFIG_TIVA_PHYADDR, CONFIG_TIVA_PHYSR, &phyval); if (ret < 0) { - ndbg("Failed to read PHY status register\n"); + nerr("Failed to read PHY status register\n"); return ret; } @@ -3480,7 +3480,7 @@ static int tiva_phyinit(FAR struct tiva_ethmac_s *priv) ret = tiva_phywrite(CONFIG_TIVA_PHYADDR, MII_MCR, phyval); if (ret < 0) { - ndbg("Failed to write the PHY MCR: %d\n", ret); + nerr("Failed to write the PHY MCR: %d\n", ret); return ret; } up_mdelay(PHY_CONFIG_DELAY); @@ -3495,7 +3495,7 @@ static int tiva_phyinit(FAR struct tiva_ethmac_s *priv) #endif #endif - ndbg("Duplex: %s Speed: %d MBps\n", + nerr("Duplex: %s Speed: %d MBps\n", priv->fduplex ? "FULL" : "HALF", priv->mbps100 ? 100 : 10); diff --git a/arch/avr/src/avr/up_createstack.c b/arch/avr/src/avr/up_createstack.c index 6d6dce9d47..54efb1a3fb 100644 --- a/arch/avr/src/avr/up_createstack.c +++ b/arch/avr/src/avr/up_createstack.c @@ -127,7 +127,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) if (!tcb->stack_alloc_ptr) { - sdbg("ERROR: Failed to allocate stack, size %d\n", stack_size); + serr("ERROR: Failed to allocate stack, size %d\n", stack_size); } #endif } diff --git a/arch/avr/src/avr/up_schedulesigaction.c b/arch/avr/src/avr/up_schedulesigaction.c index 5c6cbf52ee..6d067f8fc2 100644 --- a/arch/avr/src/avr/up_schedulesigaction.c +++ b/arch/avr/src/avr/up_schedulesigaction.c @@ -94,7 +94,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); /* Make sure that interrupts are disabled */ @@ -108,7 +108,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) * being delivered to the currently executing task. */ - sdbg("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); + serr("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); if (tcb == this_task()) { diff --git a/arch/avr/src/avr/up_sigdeliver.c b/arch/avr/src/avr/up_sigdeliver.c index e786cba00c..96163e20f8 100644 --- a/arch/avr/src/avr/up_sigdeliver.c +++ b/arch/avr/src/avr/up_sigdeliver.c @@ -82,7 +82,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -117,7 +117,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/avr/src/avr/up_spi.c b/arch/avr/src/avr/up_spi.c index d3c0c56eed..66cf745e92 100644 --- a/arch/avr/src/avr/up_spi.c +++ b/arch/avr/src/avr/up_spi.c @@ -72,7 +72,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -80,7 +80,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -269,7 +269,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) actual = priv->actual; } - spidbg("Frequency %d->%d\n", frequency, actual); + spierr("Frequency %d->%d\n", frequency, actual); return actual; } @@ -408,7 +408,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size { FAR uint8_t *ptr = (FAR uint8_t *)buffer; - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords-- > 0) { (void)spi_send(dev, (uint16_t)*ptr++); @@ -439,7 +439,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw { FAR uint8_t *ptr = (FAR uint8_t *)buffer; - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords-- > 0) { *ptr++ = spi_send(dev, (uint16_t)0xff); diff --git a/arch/avr/src/avr32/up_createstack.c b/arch/avr/src/avr32/up_createstack.c index 59c470383f..6bc17519bc 100644 --- a/arch/avr/src/avr32/up_createstack.c +++ b/arch/avr/src/avr32/up_createstack.c @@ -145,7 +145,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) if (!tcb->stack_alloc_ptr) { - sdbg("ERROR: Failed to allocate stack, size %d\n", stack_size); + serr("ERROR: Failed to allocate stack, size %d\n", stack_size); } #endif } diff --git a/arch/avr/src/avr32/up_schedulesigaction.c b/arch/avr/src/avr32/up_schedulesigaction.c index 838c1382c2..f9bb311fe8 100644 --- a/arch/avr/src/avr32/up_schedulesigaction.c +++ b/arch/avr/src/avr32/up_schedulesigaction.c @@ -94,7 +94,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); /* Make sure that interrupts are disabled */ @@ -108,7 +108,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) * being delivered to the currently executing task. */ - sdbg("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); + serr("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); if (tcb == this_task()) { diff --git a/arch/avr/src/avr32/up_sigdeliver.c b/arch/avr/src/avr32/up_sigdeliver.c index 883bec9742..ded924df87 100644 --- a/arch/avr/src/avr32/up_sigdeliver.c +++ b/arch/avr/src/avr32/up_sigdeliver.c @@ -86,7 +86,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -117,7 +117,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/avr/src/common/up_exit.c b/arch/avr/src/common/up_exit.c index 7002118a7f..2ceb474129 100644 --- a/arch/avr/src/common/up_exit.c +++ b/arch/avr/src/common/up_exit.c @@ -77,8 +77,8 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) int i; #endif - sdbg(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); - sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); + serr(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); + serr(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); #if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; @@ -87,7 +87,7 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) struct inode *inode = filelist->fl_files[i].f_inode; if (inode) { - sdbg(" fd=%d refcount=%d\n", + serr(" fd=%d refcount=%d\n", i, inode->i_crefs); } } @@ -101,11 +101,11 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 - sdbg(" fd=%d nbytes=%d\n", + serr(" fd=%d nbytes=%d\n", filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - sdbg(" fd=%d\n", filep->fs_fd); + serr(" fd=%d\n", filep->fs_fd); #endif } } diff --git a/arch/hc/src/common/up_createstack.c b/arch/hc/src/common/up_createstack.c index 9ae87865d0..f09b98a87a 100644 --- a/arch/hc/src/common/up_createstack.c +++ b/arch/hc/src/common/up_createstack.c @@ -142,7 +142,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) if (!tcb->stack_alloc_ptr) { - sdbg("ERROR: Failed to allocate stack, size %d\n", stack_size); + serr("ERROR: Failed to allocate stack, size %d\n", stack_size); } #endif } diff --git a/arch/hc/src/common/up_exit.c b/arch/hc/src/common/up_exit.c index 47a23f7d9e..78e82c6088 100644 --- a/arch/hc/src/common/up_exit.c +++ b/arch/hc/src/common/up_exit.c @@ -85,8 +85,8 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) int i; #endif - sdbg(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); - sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); + serr(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); + serr(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); #if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; @@ -95,7 +95,7 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) struct inode *inode = filelist->fl_files[i].f_inode; if (inode) { - sdbg(" fd=%d refcount=%d\n", + serr(" fd=%d refcount=%d\n", i, inode->i_crefs); } } @@ -109,11 +109,11 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 - sdbg(" fd=%d nbytes=%d\n", + serr(" fd=%d nbytes=%d\n", filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - sdbg(" fd=%d\n", filep->fs_fd); + serr(" fd=%d\n", filep->fs_fd); #endif } } diff --git a/arch/hc/src/m9s12/m9s12_ethernet.c b/arch/hc/src/m9s12/m9s12_ethernet.c index 4b9dbfeef7..a96de8c408 100644 --- a/arch/hc/src/m9s12/m9s12_ethernet.c +++ b/arch/hc/src/m9s12/m9s12_ethernet.c @@ -549,7 +549,7 @@ static int emac_ifup(struct net_driver_s *dev) { FAR struct emac_driver_s *priv = (FAR struct emac_driver_s *)dev->d_private; - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24 ); diff --git a/arch/mips/src/common/up_createstack.c b/arch/mips/src/common/up_createstack.c index e4f9520b3b..69d5ff0486 100644 --- a/arch/mips/src/common/up_createstack.c +++ b/arch/mips/src/common/up_createstack.c @@ -163,7 +163,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) if (!tcb->stack_alloc_ptr) { - sdbg("ERROR: Failed to allocate stack, size %d\n", stack_size); + serr("ERROR: Failed to allocate stack, size %d\n", stack_size); } #endif } diff --git a/arch/mips/src/common/up_exit.c b/arch/mips/src/common/up_exit.c index 00c23ba782..ad1dbeb343 100644 --- a/arch/mips/src/common/up_exit.c +++ b/arch/mips/src/common/up_exit.c @@ -87,8 +87,8 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) int i; #endif - sdbg(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); - sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); + serr(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); + serr(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); #if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; @@ -97,7 +97,7 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) struct inode *inode = filelist->fl_files[i].f_inode; if (inode) { - sdbg(" fd=%d refcount=%d\n", + serr(" fd=%d refcount=%d\n", i, inode->i_crefs); } } @@ -111,11 +111,11 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 - sdbg(" fd=%d nbytes=%d\n", + serr(" fd=%d nbytes=%d\n", filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - sdbg(" fd=%d\n", filep->fs_fd); + serr(" fd=%d\n", filep->fs_fd); #endif } } diff --git a/arch/mips/src/mips32/up_schedulesigaction.c b/arch/mips/src/mips32/up_schedulesigaction.c index 86cba18c74..2af3169ee6 100644 --- a/arch/mips/src/mips32/up_schedulesigaction.c +++ b/arch/mips/src/mips32/up_schedulesigaction.c @@ -95,7 +95,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) irqstate_t flags; uint32_t status; - sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); /* Make sure that interrupts are disabled */ @@ -109,7 +109,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) * being delivered to the currently executing task. */ - sdbg("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); + serr("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); if (tcb == this_task()) { diff --git a/arch/mips/src/mips32/up_sigdeliver.c b/arch/mips/src/mips32/up_sigdeliver.c index 5237a697b7..c514731ca1 100644 --- a/arch/mips/src/mips32/up_sigdeliver.c +++ b/arch/mips/src/mips32/up_sigdeliver.c @@ -96,7 +96,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); diff --git a/arch/mips/src/mips32/up_swint0.c b/arch/mips/src/mips32/up_swint0.c index 12c79b0f15..6e23087108 100644 --- a/arch/mips/src/mips32/up_swint0.c +++ b/arch/mips/src/mips32/up_swint0.c @@ -65,9 +65,9 @@ */ #ifdef CONFIG_DEBUG_SYSCALL -# define swidbg(format, ...) llerr(format, ##__VA_ARGS__) +# define swierr(format, ...) llerr(format, ##__VA_ARGS__) #else -# define swidbg(x...) +# define swierr(x...) #endif /**************************************************************************** @@ -89,23 +89,23 @@ #ifdef CONFIG_DEBUG_SYSCALL static void up_registerdump(const uint32_t *regs) { - swidbg("MFLO:%08x MFHI:%08x EPC:%08x STATUS:%08x\n", + swierr("MFLO:%08x MFHI:%08x EPC:%08x STATUS:%08x\n", regs[REG_MFLO], regs[REG_MFHI], regs[REG_EPC], regs[REG_STATUS]); - swidbg("AT:%08x V0:%08x V1:%08x A0:%08x A1:%08x A2:%08x A3:%08x\n", + swierr("AT:%08x V0:%08x V1:%08x A0:%08x A1:%08x A2:%08x A3:%08x\n", regs[REG_AT], regs[REG_V0], regs[REG_V1], regs[REG_A0], regs[REG_A1], regs[REG_A2], regs[REG_A3]); - swidbg("T0:%08x T1:%08x T2:%08x T3:%08x T4:%08x T5:%08x T6:%08x T7:%08x\n", + swierr("T0:%08x T1:%08x T2:%08x T3:%08x T4:%08x T5:%08x T6:%08x T7:%08x\n", regs[REG_T0], regs[REG_T1], regs[REG_T2], regs[REG_T3], regs[REG_T4], regs[REG_T5], regs[REG_T6], regs[REG_T7]); - swidbg("S0:%08x S1:%08x S2:%08x S3:%08x S4:%08x S5:%08x S6:%08x S7:%08x\n", + swierr("S0:%08x S1:%08x S2:%08x S3:%08x S4:%08x S5:%08x S6:%08x S7:%08x\n", regs[REG_S0], regs[REG_S1], regs[REG_S2], regs[REG_S3], regs[REG_S4], regs[REG_S5], regs[REG_S6], regs[REG_S7]); #ifdef MIPS32_SAVE_GP - swidbg("T8:%08x T9:%08x GP:%08x SP:%08x FP:%08x RA:%08x\n", + swierr("T8:%08x T9:%08x GP:%08x SP:%08x FP:%08x RA:%08x\n", regs[REG_T8], regs[REG_T9], regs[REG_GP], regs[REG_SP], regs[REG_FP], regs[REG_RA]); #else - swidbg("T8:%08x T9:%08x SP:%08x FP:%08x RA:%08x\n", + swierr("T8:%08x T9:%08x SP:%08x FP:%08x RA:%08x\n", regs[REG_T8], regs[REG_T9], regs[REG_SP], regs[REG_FP], regs[REG_RA]); #endif @@ -168,7 +168,7 @@ int up_swint0(int irq, FAR void *context) */ #ifdef CONFIG_DEBUG_SYSCALL - swidbg("Entry: regs: %p cmd: %d\n", regs, regs[REG_R4]); + swierr("Entry: regs: %p cmd: %d\n", regs, regs[REG_R4]); up_registerdump(regs); #endif @@ -300,12 +300,12 @@ int up_swint0(int irq, FAR void *context) #ifdef CONFIG_DEBUG_SYSCALL if (regs != g_current_regs) { - swidbg("SWInt Return: Context switch!\n"); + swierr("SWInt Return: Context switch!\n"); up_registerdump((const uint32_t *)g_current_regs); } else { - swidbg("SWInt Return: %d\n", regs[REG_V0]); + swierr("SWInt Return: %d\n", regs[REG_V0]); } #endif diff --git a/arch/mips/src/mips32/up_vfork.c b/arch/mips/src/mips32/up_vfork.c index 552ffa335a..4ceb0a7215 100644 --- a/arch/mips/src/mips32/up_vfork.c +++ b/arch/mips/src/mips32/up_vfork.c @@ -152,7 +152,7 @@ pid_t up_vfork(const struct vfork_s *context) child = task_vforksetup((start_t)context->ra); if (!child) { - sdbg("task_vforksetup failed\n"); + serr("task_vforksetup failed\n"); return (pid_t)ERROR; } @@ -171,7 +171,7 @@ pid_t up_vfork(const struct vfork_s *context) parent->flags & TCB_FLAG_TTYPE_MASK); if (ret != OK) { - sdbg("up_create_stack failed: %d\n", ret); + serr("up_create_stack failed: %d\n", ret); task_vforkabort(child, -ret); return (pid_t)ERROR; } diff --git a/arch/mips/src/pic32mx/pic32mx-ethernet.c b/arch/mips/src/pic32mx/pic32mx-ethernet.c index ceb1c98906..0ae50a7357 100644 --- a/arch/mips/src/pic32mx/pic32mx-ethernet.c +++ b/arch/mips/src/pic32mx/pic32mx-ethernet.c @@ -1921,7 +1921,7 @@ static int pic32mx_ifup(struct net_driver_s *dev) uint32_t regval; int ret; - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); @@ -2011,7 +2011,7 @@ static int pic32mx_ifup(struct net_driver_s *dev) ret = pic32mx_phyinit(priv); if (ret != 0) { - ndbg("pic32mx_phyinit failed: %d\n", ret); + nerr("pic32mx_phyinit failed: %d\n", ret); return ret; } @@ -2373,14 +2373,14 @@ static int pic32mx_rmmac(struct net_driver_s *dev, const uint8_t *mac) #if defined(CONFIG_NET_REGDEBUG) && defined(PIC32MX_HAVE_PHY) static void pic32mx_showmii(uint8_t phyaddr, const char *msg) { - dbg("PHY " PIC32MX_PHYNAME ": %s\n", msg); - dbg(" MCR: %04x\n", pic32mx_phyread(phyaddr, MII_MCR)); - dbg(" MSR: %04x\n", pic32mx_phyread(phyaddr, MII_MSR)); - dbg(" ADVERTISE: %04x\n", pic32mx_phyread(phyaddr, MII_ADVERTISE)); - dbg(" LPA: %04x\n", pic32mx_phyread(phyaddr, MII_LPA)); - dbg(" EXPANSION: %04x\n", pic32mx_phyread(phyaddr, MII_EXPANSION)); + err("PHY " PIC32MX_PHYNAME ": %s\n", msg); + err(" MCR: %04x\n", pic32mx_phyread(phyaddr, MII_MCR)); + err(" MSR: %04x\n", pic32mx_phyread(phyaddr, MII_MSR)); + err(" ADVERTISE: %04x\n", pic32mx_phyread(phyaddr, MII_ADVERTISE)); + err(" LPA: %04x\n", pic32mx_phyread(phyaddr, MII_LPA)); + err(" EXPANSION: %04x\n", pic32mx_phyread(phyaddr, MII_EXPANSION)); #ifdef CONFIG_ETH0_PHY_KS8721 - dbg(" 10BTCR: %04x\n", pic32mx_phyread(phyaddr, MII_KS8721_10BTCR)); + err(" 10BTCR: %04x\n", pic32mx_phyread(phyaddr, MII_KS8721_10BTCR)); #endif } #endif @@ -2543,7 +2543,7 @@ static inline int pic32mx_phyreset(uint8_t phyaddr) } } - ndbg("Reset failed. MCR: %04x\n", phyreg); + nerr("Reset failed. MCR: %04x\n", phyreg); return -ETIMEDOUT; } #endif @@ -2590,7 +2590,7 @@ static inline int pic32mx_phyautoneg(uint8_t phyaddr) } } - ndbg("Auto-negotiation failed. MSR: %04x\n", phyreg); + nerr("Auto-negotiation failed. MSR: %04x\n", phyreg); return -ETIMEDOUT; } #endif @@ -2669,7 +2669,7 @@ static int pic32mx_phymode(uint8_t phyaddr, uint8_t mode) #endif } - ndbg("Link failed. MSR: %04x\n", phyreg); + nerr("Link failed. MSR: %04x\n", phyreg); return -ETIMEDOUT; } #endif @@ -2738,7 +2738,7 @@ static inline int pic32mx_phyinit(struct pic32mx_driver_s *priv) ret = pic32mx_phyreset(phyaddr); if (ret < 0) { - ndbg("Failed to reset PHY at address %d\n", phyaddr); + nerr("Failed to reset PHY at address %d\n", phyaddr); continue; } @@ -2771,7 +2771,7 @@ static inline int pic32mx_phyinit(struct pic32mx_driver_s *priv) { /* Failed to find PHY at any location */ - ndbg("No PHY detected\n"); + nerr("No PHY detected\n"); return -ENODEV; } ninfo("phyaddr: %d\n", phyaddr); @@ -2875,7 +2875,7 @@ static inline int pic32mx_phyinit(struct pic32mx_driver_s *priv) priv->pd_mode = PIC32MX_100BASET_FD; break; default: - ndbg("Unrecognized mode: %04x\n", phyreg); + nerr("Unrecognized mode: %04x\n", phyreg); return -ENODEV; } #elif defined(CONFIG_ETH0_PHY_DP83848C) @@ -2898,7 +2898,7 @@ static inline int pic32mx_phyinit(struct pic32mx_driver_s *priv) priv->pd_mode = PIC32MX_10BASET_FD; break; default: - ndbg("Unrecognized mode: %04x\n", phyreg); + nerr("Unrecognized mode: %04x\n", phyreg); return -ENODEV; } #elif defined(CONFIG_ETH0_PHY_LAN8720) @@ -2943,7 +2943,7 @@ static inline int pic32mx_phyinit(struct pic32mx_driver_s *priv) } else { - ndbg("Unrecognized mode: %04x\n", phyreg); + nerr("Unrecognized mode: %04x\n", phyreg); return -ENODEV; } } @@ -2951,7 +2951,7 @@ static inline int pic32mx_phyinit(struct pic32mx_driver_s *priv) # warning "PHY Unknown: speed and duplex are bogus" #endif - ndbg("%dBase-T %s duplex\n", + nerr("%dBase-T %s duplex\n", (priv->pd_mode & PIC32MX_SPEED_MASK) == PIC32MX_SPEED_100 ? 100 : 10, (priv->pd_mode & PIC32MX_DUPLEX_MASK) == PIC32MX_DUPLEX_FULL ?"full" : "half"); diff --git a/arch/mips/src/pic32mx/pic32mx-spi.c b/arch/mips/src/pic32mx/pic32mx-spi.c index 02a43d3eab..94e20314fc 100644 --- a/arch/mips/src/pic32mx/pic32mx-spi.c +++ b/arch/mips/src/pic32mx/pic32mx-spi.c @@ -75,14 +75,14 @@ /* Debug */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -526,7 +526,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) priv->frequency = frequency; priv->actual = actual; - spidbg("New frequency: %d Actual: %d\n", frequency, actual); + spierr("New frequency: %d Actual: %d\n", frequency, actual); return actual; } @@ -665,7 +665,7 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits) } else { - spidbg("Unsupported nbits: %d\n", nbits); + spierr("Unsupported nbits: %d\n", nbits); return; } @@ -897,7 +897,7 @@ FAR struct spi_dev_s *pic32mx_spibus_initialize(int port) else #endif { - spidbg("Unsuppport port: %d\n", port); + spierr("Unsuppport port: %d\n", port); return NULL; } @@ -926,7 +926,7 @@ FAR struct spi_dev_s *pic32mx_spibus_initialize(int port) ret = irq_attach(priv->vector, spi_interrupt); if (ret < 0) { - spidbg("Failed to attach vector: %d port: %d\n", priv->vector, port); + spierr("Failed to attach vector: %d port: %d\n", priv->vector, port); goto errout; } #endif @@ -976,7 +976,7 @@ FAR struct spi_dev_s *pic32mx_spibus_initialize(int port) ret = up_prioritize_irq(priv->vector, CONFIG_PIC32MX_SPI_PRIORITY) if (ret < 0) { - spidbg("up_prioritize_irq failed: %d\n", ret); + spierr("up_prioritize_irq failed: %d\n", ret); goto errout; } #endif diff --git a/arch/mips/src/pic32mx/pic32mx-usbdev.c b/arch/mips/src/pic32mx/pic32mx-usbdev.c index e6099bfb80..948df83d89 100644 --- a/arch/mips/src/pic32mx/pic32mx-usbdev.c +++ b/arch/mips/src/pic32mx/pic32mx-usbdev.c @@ -289,7 +289,7 @@ # undef CONFIG_PIC32MX_USBDEV_BDTDEBUG # define CONFIG_PIC32MX_USBDEV_BDTDEBUG 1 -# define regdbg llerr +# define regerr llerr # ifdef CONFIG_DEBUG_INFO # define reginfo llerr # else @@ -300,7 +300,7 @@ # define pic32mx_getreg(addr) getreg16(addr) # define pic32mx_putreg(val,addr) putreg16(val,addr) -# define regdbg(x...) +# define regerr(x...) # define reginfo(x...) #endif @@ -309,7 +309,7 @@ #ifdef CONFIG_PIC32MX_USBDEV_BDTDEBUG -# define bdtdbg llerr +# define bdterr llerr # ifdef CONFIG_DEBUG_INFO # define bdtinfo llerr # else @@ -318,7 +318,7 @@ #else -# define bdtdbg(x...) +# define bdterr(x...) # define bdtinfo(x...) #endif @@ -874,7 +874,7 @@ static void pic32mx_epwrite(struct pic32mx_ep_s *privep, /* And, finally, give the BDT to the USB */ - bdtdbg("EP%d BDT IN [%p] {%08x, %08x}\n", + bdterr("EP%d BDT IN [%p] {%08x, %08x}\n", USB_EPNO(privep->ep.eplog), bdt, status, bdt->addr); bdt->status = status; @@ -915,7 +915,7 @@ static void pic32mx_wrcomplete(struct pic32mx_usbdev_s *priv, epno, privreq->req.len, privreq->req.xfrd, privreq->inflight[0], privreq->inflight[1]); #endif - bdtdbg("EP%d BDT IN [%p] {%08x, %08x}\n", + bdterr("EP%d BDT IN [%p] {%08x, %08x}\n", epno, bdtin, bdtin->status, bdtin->addr); /* We should own the BDT that just completed. But NULLify the entire BDT IN. @@ -1340,7 +1340,7 @@ static int pic32mx_rdcomplete(struct pic32mx_usbdev_s *priv, ullinfo("EP%d: len=%d xfrd=%d\n", epno, privreq->req.len, privreq->req.xfrd); - bdtdbg("EP%d BDT OUT [%p] {%08x, %08x}\n", + bdterr("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdtout, bdtout->status, bdtout->addr); /* We should own the BDT that just completed */ @@ -1484,7 +1484,7 @@ static int pic32mx_ep0rdsetup(struct pic32mx_usbdev_s *priv, uint8_t *dest, /* Then give the BDT to the USB */ - bdtdbg("EP0 BDT OUT [%p] {%08x, %08x}\n", bdtout, status, bdtout->addr); + bdterr("EP0 BDT OUT [%p] {%08x, %08x}\n", bdtout, status, bdtout->addr); bdtout->status = status; priv->ctrlstate = CTRLSTATE_RDREQUEST; @@ -1585,7 +1585,7 @@ static int pic32mx_rdsetup(struct pic32mx_ep_s *privep, uint8_t *dest, int readl /* Then give the BDT to the USB */ - bdtdbg("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdtout, status, bdtout->addr); + bdterr("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdtout, status, bdtout->addr); bdtout->status = status; return OK; @@ -2596,7 +2596,7 @@ static void pic32mx_ep0transfer(struct pic32mx_usbdev_s *priv, uint16_t ustat) bdt = &g_bdt[index]; priv->eplist[0].bdtout = bdt; - bdtdbg("EP0 BDT OUT [%p] {%08x, %08x}\n", bdt, bdt->status, bdt->addr); + bdterr("EP0 BDT OUT [%p] {%08x, %08x}\n", bdt, bdt->status, bdt->addr); /* Check the current EP0 OUT buffer contains a SETUP packet */ @@ -3210,7 +3210,7 @@ static int pic32mx_epconfigure(struct usbdev_ep_s *ep, bdt->status = 0; bdt->addr = 0; - bdtdbg("EP%d BDT IN [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); + bdterr("EP%d BDT IN [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); /* Now do the same for the other buffer. */ @@ -3218,7 +3218,7 @@ static int pic32mx_epconfigure(struct usbdev_ep_s *ep, bdt->status = 0; bdt->addr = 0; - bdtdbg("EP%d BDT IN [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); + bdterr("EP%d BDT IN [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); } if (!epin || bidi) @@ -3232,7 +3232,7 @@ static int pic32mx_epconfigure(struct usbdev_ep_s *ep, bdt->status = 0; bdt->addr = 0; - bdtdbg("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); + bdterr("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); /* Now do the same for the other buffer. */ @@ -3240,7 +3240,7 @@ static int pic32mx_epconfigure(struct usbdev_ep_s *ep, bdt->status = 0; bdt->addr = 0; - bdtdbg("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); + bdterr("EP%d BDT OUT [%p] {%08x, %08x}\n", epno, bdt, bdt->status, bdt->addr); } /* Get the maxpacket size of the endpoint. */ @@ -3575,9 +3575,9 @@ static int pic32mx_epbdtstall(struct usbdev_ep_s *ep, bool resume, bool epin) bdt->addr = (uint8_t *)physaddr; bdt->status = (USB_BDT_UOWN | bytecount); - bdtdbg("EP0 BDT IN [%p] {%08x, %08x}\n", + bdterr("EP0 BDT IN [%p] {%08x, %08x}\n", bdt, bdt->status, bdt->addr); - bdtdbg("EP0 BDT IN [%p] {%08x, %08x}\n", + bdterr("EP0 BDT IN [%p] {%08x, %08x}\n", otherbdt, otherbdt->status, otherbdt->addr); } else @@ -3592,9 +3592,9 @@ static int pic32mx_epbdtstall(struct usbdev_ep_s *ep, bool resume, bool epin) bdt->addr = 0; bdt->status = 0; - bdtdbg("EP%d BDT %s [%p] {%08x, %08x}\n", + bdterr("EP%d BDT %s [%p] {%08x, %08x}\n", epno, epin ? "IN" : "OUT", bdt, bdt->status, bdt->addr); - bdtdbg("EP%d BDT %s [%p] {%08x, %08x}\n", + bdterr("EP%d BDT %s [%p] {%08x, %08x}\n", epno, epin ? "IN" : "OUT", otherbdt, otherbdt->status, otherbdt->addr); /* Restart any queued requests (after a delay so that we can be assured @@ -3627,9 +3627,9 @@ static int pic32mx_epbdtstall(struct usbdev_ep_s *ep, bool resume, bool epin) pic32mx_rqstop(privep); - bdtdbg("EP%d BDT %s [%p] {%08x, %08x}\n", + bdterr("EP%d BDT %s [%p] {%08x, %08x}\n", epno, epin ? "IN" : "OUT", bdt, bdt->status, bdt->addr); - bdtdbg("EP%d BDT %s [%p] {%08x, %08x}\n", + bdterr("EP%d BDT %s [%p] {%08x, %08x}\n", epno, epin ? "IN" : "OUT", otherbdt, otherbdt->status, otherbdt->addr); } diff --git a/arch/mips/src/pic32mz/pic32mz-ethernet.c b/arch/mips/src/pic32mz/pic32mz-ethernet.c index 5c1ae7aa78..af83f64f2a 100644 --- a/arch/mips/src/pic32mz/pic32mz-ethernet.c +++ b/arch/mips/src/pic32mz/pic32mz-ethernet.c @@ -1938,7 +1938,7 @@ static int pic32mz_ifup(struct net_driver_s *dev) uint32_t regval; int ret; - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); @@ -2028,7 +2028,7 @@ static int pic32mz_ifup(struct net_driver_s *dev) ret = pic32mz_phyinit(priv); if (ret != 0) { - ndbg("pic32mz_phyinit failed: %d\n", ret); + nerr("pic32mz_phyinit failed: %d\n", ret); return ret; } @@ -2105,7 +2105,7 @@ static int pic32mz_ifup(struct net_driver_s *dev) priv->pd_dev.d_mac.ether_addr_octet[0] = (uint32_t)(regval & 0xff); priv->pd_dev.d_mac.ether_addr_octet[1] = (uint32_t)((regval >> 8) & 0xff); - ndbg("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", + nerr("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1], dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3], dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]); @@ -2396,14 +2396,14 @@ static int pic32mz_rmmac(struct net_driver_s *dev, const uint8_t *mac) #if defined(CONFIG_NET_REGDEBUG) && defined(PIC32MZ_HAVE_PHY) static void pic32mz_showmii(uint8_t phyaddr, const char *msg) { - dbg("PHY " PIC32MZ_PHYNAME ": %s\n", msg); - dbg(" MCR: %04x\n", pic32mz_phyread(phyaddr, MII_MCR)); - dbg(" MSR: %04x\n", pic32mz_phyread(phyaddr, MII_MSR)); - dbg(" ADVERTISE: %04x\n", pic32mz_phyread(phyaddr, MII_ADVERTISE)); - dbg(" LPA: %04x\n", pic32mz_phyread(phyaddr, MII_LPA)); - dbg(" EXPANSION: %04x\n", pic32mz_phyread(phyaddr, MII_EXPANSION)); + err("PHY " PIC32MZ_PHYNAME ": %s\n", msg); + err(" MCR: %04x\n", pic32mz_phyread(phyaddr, MII_MCR)); + err(" MSR: %04x\n", pic32mz_phyread(phyaddr, MII_MSR)); + err(" ADVERTISE: %04x\n", pic32mz_phyread(phyaddr, MII_ADVERTISE)); + err(" LPA: %04x\n", pic32mz_phyread(phyaddr, MII_LPA)); + err(" EXPANSION: %04x\n", pic32mz_phyread(phyaddr, MII_EXPANSION)); #ifdef CONFIG_ETH0_PHY_KS8721 - dbg(" 10BTCR: %04x\n", pic32mz_phyread(phyaddr, MII_KS8721_10BTCR)); + err(" 10BTCR: %04x\n", pic32mz_phyread(phyaddr, MII_KS8721_10BTCR)); #endif } #endif @@ -2566,7 +2566,7 @@ static inline int pic32mz_phyreset(uint8_t phyaddr) } } - ndbg("Reset failed. MCR: %04x\n", phyreg); + nerr("Reset failed. MCR: %04x\n", phyreg); return -ETIMEDOUT; } #endif @@ -2613,7 +2613,7 @@ static inline int pic32mz_phyautoneg(uint8_t phyaddr) } } - ndbg("Auto-negotiation failed. MSR: %04x\n", phyreg); + nerr("Auto-negotiation failed. MSR: %04x\n", phyreg); return -ETIMEDOUT; } #endif @@ -2692,7 +2692,7 @@ static int pic32mz_phymode(uint8_t phyaddr, uint8_t mode) #endif } - ndbg("Link failed. MSR: %04x\n", phyreg); + nerr("Link failed. MSR: %04x\n", phyreg); return -ETIMEDOUT; } #endif @@ -2761,7 +2761,7 @@ static inline int pic32mz_phyinit(struct pic32mz_driver_s *priv) ret = pic32mz_phyreset(phyaddr); if (ret < 0) { - ndbg("Failed to reset PHY at address %d\n", phyaddr); + nerr("Failed to reset PHY at address %d\n", phyaddr); continue; } @@ -2794,7 +2794,7 @@ static inline int pic32mz_phyinit(struct pic32mz_driver_s *priv) { /* Failed to find PHY at any location */ - ndbg("No PHY detected\n"); + nerr("No PHY detected\n"); return -ENODEV; } ninfo("phyaddr: %d\n", phyaddr); @@ -2898,7 +2898,7 @@ static inline int pic32mz_phyinit(struct pic32mz_driver_s *priv) priv->pd_mode = PIC32MZ_100BASET_FD; break; default: - ndbg("Unrecognized mode: %04x\n", phyreg); + nerr("Unrecognized mode: %04x\n", phyreg); return -ENODEV; } #elif defined(CONFIG_ETH0_PHY_DP83848C) @@ -2921,7 +2921,7 @@ static inline int pic32mz_phyinit(struct pic32mz_driver_s *priv) priv->pd_mode = PIC32MZ_10BASET_FD; break; default: - ndbg("Unrecognized mode: %04x\n", phyreg); + nerr("Unrecognized mode: %04x\n", phyreg); return -ENODEV; } #elif defined(CONFIG_ETH0_PHY_LAN8720) || defined(CONFIG_ETH0_PHY_LAN8740) || defined(CONFIG_ETH0_PHY_LAN8740A) @@ -2966,7 +2966,7 @@ static inline int pic32mz_phyinit(struct pic32mz_driver_s *priv) } else { - ndbg("Unrecognized mode: %04x\n", phyreg); + nerr("Unrecognized mode: %04x\n", phyreg); return -ENODEV; } } @@ -2974,7 +2974,7 @@ static inline int pic32mz_phyinit(struct pic32mz_driver_s *priv) # warning "PHY Unknown: speed and duplex are bogus" #endif - ndbg("%dBase-T %s duplex\n", + nerr("%dBase-T %s duplex\n", (priv->pd_mode & PIC32MZ_SPEED_MASK) == PIC32MZ_SPEED_100 ? 100 : 10, (priv->pd_mode & PIC32MZ_DUPLEX_MASK) == PIC32MZ_DUPLEX_FULL ?"full" : "half"); diff --git a/arch/mips/src/pic32mz/pic32mz-spi.c b/arch/mips/src/pic32mz/pic32mz-spi.c index 504fe2ca95..956128eaeb 100644 --- a/arch/mips/src/pic32mz/pic32mz-spi.c +++ b/arch/mips/src/pic32mz/pic32mz-spi.c @@ -70,14 +70,14 @@ /* Debug */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -887,7 +887,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) priv->frequency = frequency; priv->actual = actual; - spidbg("New frequency: %d Actual: %d\n", frequency, actual); + spierr("New frequency: %d Actual: %d\n", frequency, actual); return actual; } @@ -1025,7 +1025,7 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits) } else { - spidbg("Unsupported nbits: %d\n", nbits); + spierr("Unsupported nbits: %d\n", nbits); return; } @@ -1275,7 +1275,7 @@ FAR struct spi_dev_s *pic32mz_spibus_initialize(int port) else #endif { - spidbg("Unsuppport port: %d\n", port); + spierr("Unsuppport port: %d\n", port); return NULL; } @@ -1311,7 +1311,7 @@ FAR struct spi_dev_s *pic32mz_spibus_initialize(int port) ret = irq_attach(priv->config->rxirq, spi_interrupt); if (ret < 0) { - spidbg("Failed to attach RX interrupt: %d port: %d\n", + spierr("Failed to attach RX interrupt: %d port: %d\n", priv->config->rxirq, port); goto errout; } @@ -1319,7 +1319,7 @@ FAR struct spi_dev_s *pic32mz_spibus_initialize(int port) ret = irq_attach(priv->config->txirq, spi_interrupt); if (ret < 0) { - spidbg("Failed to attach TX interrupt: %d port: %d\n", + spierr("Failed to attach TX interrupt: %d port: %d\n", priv->tconfig->xirq, port); goto errout_with_rxirq; } @@ -1327,7 +1327,7 @@ FAR struct spi_dev_s *pic32mz_spibus_initialize(int port) ret = irq_attach(priv->config->firq, spi_interrupt); if (ret < 0) { - spidbg("Failed to attach fault interrupt: %d port: %d\n", + spierr("Failed to attach fault interrupt: %d port: %d\n", priv->config->firq, port); goto errout_with_txirq; } diff --git a/arch/rgmp/src/x86/com.c b/arch/rgmp/src/x86/com.c index c31e301a7b..018293ee66 100644 --- a/arch/rgmp/src/x86/com.c +++ b/arch/rgmp/src/x86/com.c @@ -255,7 +255,7 @@ static int up_setup(struct uart_dev_s *dev) inb(base+COM_IIR); inb(base+COM_RX); if (inb(base+COM_LSR) == 0xff) { - dbg("COM %d does not exist\n", base); + err("COM %d does not exist\n", base); return -1; } @@ -583,41 +583,41 @@ void up_serialinit(void) #ifdef CONFIG_COM1 dev = up_alloc_com(COM1, 4); if (dev == NULL) - dbg("alloc com1 fail\n"); + err("alloc com1 fail\n"); else { errcode = uart_register("/dev/ttyS0", dev); if (errcode) - dbg("register com1 fail\n"); + err("register com1 fail\n"); } #endif #ifdef CONFIG_COM2 dev = up_alloc_com(COM2, 3); if (dev == NULL) - dbg("alloc com2 fail\n"); + err("alloc com2 fail\n"); else { errcode = uart_register("/dev/ttyS1", dev); if (errcode) - dbg("register com2 fail\n"); + err("register com2 fail\n"); } #endif #ifdef CONFIG_COM3 dev = up_alloc_com(COM3, 4); if (dev == NULL) - dbg("alloc com3 fail\n"); + err("alloc com3 fail\n"); else { errcode = uart_register("/dev/ttyS2", dev); if (errcode) - dbg("register com3 fail\n"); + err("register com3 fail\n"); } #endif #ifdef CONFIG_COM4 dev = up_alloc_com(COM4, 3); if (dev == NULL) - dbg("alloc com4 fail\n"); + err("alloc com4 fail\n"); else { errcode = uart_register("/dev/ttyS3", dev); if (errcode) - dbg("register com4 fail\n"); + err("register com4 fail\n"); } #endif } diff --git a/arch/sh/src/common/up_createstack.c b/arch/sh/src/common/up_createstack.c index da20268328..3a2a411811 100644 --- a/arch/sh/src/common/up_createstack.c +++ b/arch/sh/src/common/up_createstack.c @@ -142,7 +142,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) if (!tcb->stack_alloc_ptr) { - sdbg("ERROR: Failed to allocate stack, size %d\n", stack_size); + serr("ERROR: Failed to allocate stack, size %d\n", stack_size); } #endif } diff --git a/arch/sh/src/common/up_exit.c b/arch/sh/src/common/up_exit.c index e62462cec3..1ee0f1695d 100644 --- a/arch/sh/src/common/up_exit.c +++ b/arch/sh/src/common/up_exit.c @@ -86,8 +86,8 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) int i; #endif - sdbg(" TCB=%p name=%s\n", tcb, tcb->argv[0]); - sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); + serr(" TCB=%p name=%s\n", tcb, tcb->argv[0]); + serr(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); #if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; @@ -96,7 +96,7 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) struct inode *inode = filelist->fl_files[i].f_inode; if (inode) { - sdbg(" fd=%d refcount=%d\n", + serr(" fd=%d refcount=%d\n", i, inode->i_crefs); } } @@ -110,11 +110,11 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 - sdbg(" fd=%d nbytes=%d\n", + serr(" fd=%d nbytes=%d\n", filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - sdbg(" fd=%d\n", filep->fs_fd); + serr(" fd=%d\n", filep->fs_fd); #endif } } diff --git a/arch/sh/src/m16c/m16c_schedulesigaction.c b/arch/sh/src/m16c/m16c_schedulesigaction.c index 682d329987..7394dce29c 100644 --- a/arch/sh/src/m16c/m16c_schedulesigaction.c +++ b/arch/sh/src/m16c/m16c_schedulesigaction.c @@ -93,7 +93,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); /* Make sure that interrupts are disabled */ @@ -107,7 +107,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) * being delivered to the currently executing task. */ - sdbg("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); + serr("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); if (tcb == this_task()) { diff --git a/arch/sh/src/m16c/m16c_serial.c b/arch/sh/src/m16c/m16c_serial.c index a366e3b57d..b89d70e898 100644 --- a/arch/sh/src/m16c/m16c_serial.c +++ b/arch/sh/src/m16c/m16c_serial.c @@ -588,7 +588,7 @@ static int up_setup(struct uart_dev_s *dev) else #endif { - dbg("Invalid UART #\n"); + err("Invalid UART #\n"); } /* Set UART transmit/receive control register 1 to enable transmit and receive */ @@ -613,7 +613,7 @@ static int up_setup(struct uart_dev_s *dev) } else { - dbg("Invalid bits=%d\n", priv->bits); + err("Invalid bits=%d\n", priv->bits); } if (priv->parity != 0) @@ -665,7 +665,7 @@ static int up_setup(struct uart_dev_s *dev) else #endif { - dbg("Invalid UART #\n"); + err("Invalid UART #\n"); } /* Read any data left in the RX fifo */ @@ -872,7 +872,7 @@ static void m16c_rxint(struct up_dev_s *dev, bool enable) else #endif { - dbg("Invalid UART #\n"); + err("Invalid UART #\n"); return; } @@ -1027,7 +1027,7 @@ static void m16c_txint(struct up_dev_s *dev, bool enable) else #endif { - dbg("Invalid UART #\n"); + err("Invalid UART #\n"); return; } diff --git a/arch/sh/src/m16c/m16c_sigdeliver.c b/arch/sh/src/m16c/m16c_sigdeliver.c index 3b595ed7ef..c8612c5000 100644 --- a/arch/sh/src/m16c/m16c_sigdeliver.c +++ b/arch/sh/src/m16c/m16c_sigdeliver.c @@ -95,7 +95,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -128,7 +128,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/sh/src/sh1/sh1_irq.c b/arch/sh/src/sh1/sh1_irq.c index 3a0651efd4..3f5ce17b4f 100644 --- a/arch/sh/src/sh1/sh1_irq.c +++ b/arch/sh/src/sh1/sh1_irq.c @@ -95,7 +95,7 @@ void up_prioritize_irq(int irq, int priority) #ifdef CONFIG_DEBUG_FEATURES if ((unsigned) irq > NR_IRQS || (unsigned)priority > 15) { - dbg("Invalid parameters\n"); + err("Invalid parameters\n"); return; } #endif @@ -260,7 +260,7 @@ void up_prioritize_irq(int irq, int priority) #endif default: - dbg("Invalid irq=%d\n", irq); + err("Invalid irq=%d\n", irq); return; } diff --git a/arch/sh/src/sh1/sh1_schedulesigaction.c b/arch/sh/src/sh1/sh1_schedulesigaction.c index 4c6e7c1659..d1f87406d5 100644 --- a/arch/sh/src/sh1/sh1_schedulesigaction.c +++ b/arch/sh/src/sh1/sh1_schedulesigaction.c @@ -93,7 +93,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); /* Make sure that interrupts are disabled */ @@ -107,7 +107,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) * being delivered to the currently executing task. */ - sdbg("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); + serr("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); if (tcb == this_task()) { diff --git a/arch/sh/src/sh1/sh1_sigdeliver.c b/arch/sh/src/sh1/sh1_sigdeliver.c index eead3c06f2..7a408d293d 100644 --- a/arch/sh/src/sh1/sh1_sigdeliver.c +++ b/arch/sh/src/sh1/sh1_sigdeliver.c @@ -95,7 +95,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -127,7 +127,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/sim/src/board_lcd.c b/arch/sim/src/board_lcd.c index 592c4a7cb2..e2afcbaeae 100644 --- a/arch/sim/src/board_lcd.c +++ b/arch/sim/src/board_lcd.c @@ -116,9 +116,9 @@ #endif #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) info(format, ##__VA_ARGS__) +# define lcderr(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) #endif /**************************************************************************** @@ -257,7 +257,7 @@ static struct sim_dev_s g_lcddev = static int sim_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, size_t npixels) { - lcddbg("row: %d col: %d npixels: %d\n", row, col, npixels); + lcderr("row: %d col: %d npixels: %d\n", row, col, npixels); return OK; } @@ -278,7 +278,7 @@ static int sim_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, static int sim_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, size_t npixels) { - lcddbg("row: %d col: %d npixels: %d\n", row, col, npixels); + lcderr("row: %d col: %d npixels: %d\n", row, col, npixels); return -ENOSYS; } diff --git a/arch/sim/src/up_blocktask.c b/arch/sim/src/up_blocktask.c index ccc3920489..bf65f35eae 100644 --- a/arch/sim/src/up_blocktask.c +++ b/arch/sim/src/up_blocktask.c @@ -83,7 +83,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) ASSERT((tcb->task_state >= FIRST_READY_TO_RUN_STATE) && (tcb->task_state <= LAST_READY_TO_RUN_STATE)); - sdbg("Blocking TCB=%p\n", tcb); + serr("Blocking TCB=%p\n", tcb); /* Remove the tcb task from the ready-to-run list. If we * are blocking the task at the head of the task list (the @@ -127,7 +127,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) */ rtcb = this_task(); - sdbg("New Active Task TCB=%p\n", rtcb); + serr("New Active Task TCB=%p\n", rtcb); /* The way that we handle signals in the simulation is kind of * a kludge. This would be unsafe in a truly multi-threaded, interrupt @@ -136,7 +136,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (rtcb->xcp.sigdeliver) { - sdbg("Delivering signals TCB=%p\n", rtcb); + serr("Delivering signals TCB=%p\n", rtcb); ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); rtcb->xcp.sigdeliver = NULL; } diff --git a/arch/sim/src/up_deviceimage.c b/arch/sim/src/up_deviceimage.c index f50944bd2e..059b268498 100644 --- a/arch/sim/src/up_deviceimage.c +++ b/arch/sim/src/up_deviceimage.c @@ -58,7 +58,7 @@ ****************************************************************************/ #ifdef VFAT_STANDALONE -# define sdbg(format, ...) printf(format, ##__VA_ARGS__) +# define serr(format, ...) printf(format, ##__VA_ARGS__) # define kmm_malloc(size) malloc(size) # define kmm_free(mem) free(mem) #endif @@ -223,7 +223,7 @@ char *up_deviceimage(void) ret = inflateInit(&strm); if (ret != Z_OK) { - sdbg("inflateInit FAILED: ret=%d msg=\"%s\"\n", + serr("inflateInit FAILED: ret=%d msg=\"%s\"\n", ret, strm.msg ? strm.msg : "No message"); return NULL; } @@ -260,7 +260,7 @@ char *up_deviceimage(void) case Z_DATA_ERROR: case Z_MEM_ERROR: case Z_STREAM_ERROR: - sdbg("inflate FAILED: ret=%d msg=\"%s\"\n", + serr("inflate FAILED: ret=%d msg=\"%s\"\n", ret, strm.msg ? strm.msg : "No message"); (void)inflateEnd(&strm); kmm_free(pbuffer); diff --git a/arch/sim/src/up_elf.c b/arch/sim/src/up_elf.c index ecc4f2d2fe..2e17cadeaa 100644 --- a/arch/sim/src/up_elf.c +++ b/arch/sim/src/up_elf.c @@ -138,7 +138,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, uintptr_t addr) { - bdbg("Not supported\n"); + berr("Not supported\n"); return -ENOSYS; } diff --git a/arch/sim/src/up_exit.c b/arch/sim/src/up_exit.c index a022405d76..318a3dbcfb 100644 --- a/arch/sim/src/up_exit.c +++ b/arch/sim/src/up_exit.c @@ -67,7 +67,7 @@ void _exit(int status) { FAR struct tcb_s *tcb; - sdbg("TCB=%p exiting\n", tcb); + serr("TCB=%p exiting\n", tcb); /* Destroy the task at the head of the ready to run list. */ @@ -78,7 +78,7 @@ void _exit(int status) */ tcb = this_task(); - sdbg("New Active Task TCB=%p\n", tcb); + serr("New Active Task TCB=%p\n", tcb); /* The way that we handle signals in the simulation is kind of * a kludge. This would be unsafe in a truly multi-threaded, interrupt @@ -87,7 +87,7 @@ void _exit(int status) if (tcb->xcp.sigdeliver) { - sdbg("Delivering signals TCB=%p\n", tcb); + serr("Delivering signals TCB=%p\n", tcb); ((sig_deliver_t)tcb->xcp.sigdeliver)(tcb); tcb->xcp.sigdeliver = NULL; } diff --git a/arch/sim/src/up_framebuffer.c b/arch/sim/src/up_framebuffer.c index 847fcd0b6a..b621a4aa4d 100644 --- a/arch/sim/src/up_framebuffer.c +++ b/arch/sim/src/up_framebuffer.c @@ -191,13 +191,13 @@ struct fb_vtable_s g_fbobject = static int up_getvideoinfo(FAR struct fb_vtable_s *vtable, FAR struct fb_videoinfo_s *vinfo) { - dbg("vtable=%p vinfo=%p\n", vtable, vinfo); + err("vtable=%p vinfo=%p\n", vtable, vinfo); if (vtable && vinfo) { memcpy(vinfo, &g_videoinfo, sizeof(struct fb_videoinfo_s)); return OK; } - dbg("Returning EINVAL\n"); + err("Returning EINVAL\n"); return -EINVAL; } @@ -208,13 +208,13 @@ static int up_getvideoinfo(FAR struct fb_vtable_s *vtable, static int up_getplaneinfo(FAR struct fb_vtable_s *vtable, int planeno, FAR struct fb_planeinfo_s *pinfo) { - dbg("vtable=%p planeno=%d pinfo=%p\n", vtable, planeno, pinfo); + err("vtable=%p planeno=%d pinfo=%p\n", vtable, planeno, pinfo); if (vtable && planeno == 0 && pinfo) { memcpy(pinfo, &g_planeinfo, sizeof(struct fb_planeinfo_s)); return OK; } - dbg("Returning EINVAL\n"); + err("Returning EINVAL\n"); return -EINVAL; } @@ -228,7 +228,7 @@ static int up_getcmap(FAR struct fb_vtable_s *vtable, FAR struct fb_cmap_s *cmap int len; int i; - dbg("vtable=%p cmap=%p len=%d\n", vtable, cmap, cmap->len); + err("vtable=%p cmap=%p len=%d\n", vtable, cmap, cmap->len); if (vtable && cmap) { for (i = cmap->first, len = 0; i < 256 && len < cmap->len; i++, len++) @@ -244,7 +244,7 @@ static int up_getcmap(FAR struct fb_vtable_s *vtable, FAR struct fb_cmap_s *cmap cmap->len = len; return OK; } - dbg("Returning EINVAL\n"); + err("Returning EINVAL\n"); return -EINVAL; } #endif @@ -259,12 +259,12 @@ static int up_putcmap(FAR struct fb_vtable_s *vtable, FAR const struct fb_cmap_s #ifdef CONFIG_SIM_X11FB return up_x11cmap(cmap->first, cmap->len, cmap->red, cmap->green, cmap->blue, NULL); #else - dbg("vtable=%p cmap=%p len=%d\n", vtable, cmap, cmap->len); + err("vtable=%p cmap=%p len=%d\n", vtable, cmap, cmap->len); if (vtable && cmap) { return OK; } - dbg("Returning EINVAL\n"); + err("Returning EINVAL\n"); return -EINVAL; #endif } @@ -278,23 +278,23 @@ static int up_putcmap(FAR struct fb_vtable_s *vtable, FAR const struct fb_cmap_s static int up_getcursor(FAR struct fb_vtable_s *vtable, FAR struct fb_cursorattrib_s *attrib) { - dbg("vtable=%p attrib=%p\n", vtable, attrib); + err("vtable=%p attrib=%p\n", vtable, attrib); if (vtable && attrib) { #ifdef CONFIG_FB_HWCURSORIMAGE attrib->fmt = FB_FMT; #endif - dbg("pos: (x=%d, y=%d)\n", g_cpos.x, g_cpos.y); + err("pos: (x=%d, y=%d)\n", g_cpos.x, g_cpos.y); attrib->pos = g_cpos; #ifdef CONFIG_FB_HWCURSORSIZE attrib->mxsize.h = CONFIG_SIM_FBHEIGHT; attrib->mxsize.w = CONFIG_SIM_FBWIDTH; - dbg("size: (h=%d, w=%d)\n", g_csize.h, g_csize.w); + err("size: (h=%d, w=%d)\n", g_csize.h, g_csize.w); attrib->size = g_csize; #endif return OK; } - dbg("Returning EINVAL\n"); + err("Returning EINVAL\n"); return -EINVAL; } #endif @@ -307,32 +307,32 @@ static int up_getcursor(FAR struct fb_vtable_s *vtable, static int up_setcursor(FAR struct fb_vtable_s *vtable, FAR struct fb_setcursor_s *setttings) { - dbg("vtable=%p setttings=%p\n", vtable, setttings); + err("vtable=%p setttings=%p\n", vtable, setttings); if (vtable && setttings) { - dbg("flags: %02x\n", settings->flags); + err("flags: %02x\n", settings->flags); if ((flags & FB_CUR_SETPOSITION) != 0) { g_cpos = settings->pos; - dbg("pos: (h:%d, w:%d)\n", g_cpos.x, g_cpos.y); + err("pos: (h:%d, w:%d)\n", g_cpos.x, g_cpos.y); } #ifdef CONFIG_FB_HWCURSORSIZE if ((flags & FB_CUR_SETSIZE) != 0) { g_csize = settings->size; - dbg("size: (h:%d, w:%d)\n", g_csize.h, g_csize.w); + err("size: (h:%d, w:%d)\n", g_csize.h, g_csize.w); } #endif #ifdef CONFIG_FB_HWCURSORIMAGE if ((flags & FB_CUR_SETIMAGE) != 0) { - dbg("image: (h:%d, w:%d) @ %p\n", + err("image: (h:%d, w:%d) @ %p\n", settings->img.height, settings->img.width, settings->img.image); } #endif return OK; } - dbg("Returning EINVAL\n"); + err("Returning EINVAL\n"); return -EINVAL; } #endif diff --git a/arch/sim/src/up_releasepending.c b/arch/sim/src/up_releasepending.c index 386b58589a..8b92003340 100644 --- a/arch/sim/src/up_releasepending.c +++ b/arch/sim/src/up_releasepending.c @@ -66,7 +66,7 @@ void up_release_pending(void) { FAR struct tcb_s *rtcb = this_task(); - sdbg("From TCB=%p\n", rtcb); + serr("From TCB=%p\n", rtcb); /* Merge the g_pendingtasks list into the ready-to-run task list */ @@ -93,7 +93,7 @@ void up_release_pending(void) */ rtcb = this_task(); - sdbg("New Active Task TCB=%p\n", rtcb); + serr("New Active Task TCB=%p\n", rtcb); /* The way that we handle signals in the simulation is kind of * a kludge. This would be unsafe in a truly multi-threaded, interrupt @@ -102,7 +102,7 @@ void up_release_pending(void) if (rtcb->xcp.sigdeliver) { - sdbg("Delivering signals TCB=%p\n", rtcb); + serr("Delivering signals TCB=%p\n", rtcb); ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); rtcb->xcp.sigdeliver = NULL; } diff --git a/arch/sim/src/up_reprioritizertr.c b/arch/sim/src/up_reprioritizertr.c index 39c981c648..0c50facd24 100644 --- a/arch/sim/src/up_reprioritizertr.c +++ b/arch/sim/src/up_reprioritizertr.c @@ -95,7 +95,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) FAR struct tcb_s *rtcb = this_task(); bool switch_needed; - sdbg("TCB=%p PRI=%d\n", tcb, priority); + serr("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. * sched_removereadytorun will return true if we just @@ -148,7 +148,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) */ rtcb = this_task(); - sdbg("New Active Task TCB=%p\n", rtcb); + serr("New Active Task TCB=%p\n", rtcb); /* The way that we handle signals in the simulation is kind of * a kludge. This would be unsafe in a truly multi-threaded, interrupt @@ -157,7 +157,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (rtcb->xcp.sigdeliver) { - sdbg("Delivering signals TCB=%p\n", rtcb); + serr("Delivering signals TCB=%p\n", rtcb); ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); rtcb->xcp.sigdeliver = NULL; } diff --git a/arch/sim/src/up_smpsignal.c b/arch/sim/src/up_smpsignal.c index 58582d0df9..b69bfb75ab 100644 --- a/arch/sim/src/up_smpsignal.c +++ b/arch/sim/src/up_smpsignal.c @@ -112,7 +112,7 @@ void sim_cpu_pause(int cpu, volatile spinlock_t *wait, if (rtcb->xcp.sigdeliver) { - sdbg("CPU%d: Delivering signals TCB=%p\n", cpu, rtcb); + serr("CPU%d: Delivering signals TCB=%p\n", cpu, rtcb); ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); rtcb->xcp.sigdeliver = NULL; } diff --git a/arch/sim/src/up_spiflash.c b/arch/sim/src/up_spiflash.c index c7f4a076d0..3b182a8129 100644 --- a/arch/sim/src/up_spiflash.c +++ b/arch/sim/src/up_spiflash.c @@ -69,14 +69,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/arch/sim/src/up_touchscreen.c b/arch/sim/src/up_touchscreen.c index 93218e45bb..2869bcf0bb 100644 --- a/arch/sim/src/up_touchscreen.c +++ b/arch/sim/src/up_touchscreen.c @@ -670,7 +670,7 @@ int board_tsc_setup(int minor) ret = register_driver(devname, &up_fops, 0666, priv); if (ret < 0) { - idbg("register_driver() failed: %d\n", ret); + ierr("register_driver() failed: %d\n", ret); goto errout_with_priv; } @@ -737,7 +737,7 @@ void board_tsc_teardown(void) ret = unregister_driver(devname); if (ret < 0) { - idbg("uregister_driver() failed: %d\n", ret); + ierr("uregister_driver() failed: %d\n", ret); } /* Clean up any resources. Ouch! While we are holding the semaphore? */ diff --git a/arch/sim/src/up_unblocktask.c b/arch/sim/src/up_unblocktask.c index 148b551973..60bee25261 100644 --- a/arch/sim/src/up_unblocktask.c +++ b/arch/sim/src/up_unblocktask.c @@ -77,7 +77,7 @@ void up_unblock_task(FAR struct tcb_s *tcb) ASSERT((tcb->task_state >= FIRST_BLOCKED_STATE) && (tcb->task_state <= LAST_BLOCKED_STATE)); - sdbg("Unblocking TCB=%p\n", tcb); + serr("Unblocking TCB=%p\n", tcb); /* Remove the task from the blocked task list */ @@ -107,7 +107,7 @@ void up_unblock_task(FAR struct tcb_s *tcb) */ rtcb = this_task(); - sdbg("New Active Task TCB=%p\n", rtcb); + serr("New Active Task TCB=%p\n", rtcb); /* The way that we handle signals in the simulation is kind of * a kludge. This would be unsafe in a truly multi-threaded, interrupt @@ -116,7 +116,7 @@ void up_unblock_task(FAR struct tcb_s *tcb) if (rtcb->xcp.sigdeliver) { - sdbg("Delivering signals TCB=%p\n", rtcb); + serr("Delivering signals TCB=%p\n", rtcb); ((sig_deliver_t)rtcb->xcp.sigdeliver)(rtcb); rtcb->xcp.sigdeliver = NULL; } diff --git a/arch/x86/src/common/up_elf.c b/arch/x86/src/common/up_elf.c index 894f865786..f150799543 100644 --- a/arch/x86/src/common/up_elf.c +++ b/arch/x86/src/common/up_elf.c @@ -146,7 +146,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, uintptr_t addr) { - bdbg("Not supported\n"); + berr("Not supported\n"); return -ENOSYS; } diff --git a/arch/x86/src/common/up_exit.c b/arch/x86/src/common/up_exit.c index 350e65dec3..463cb8c5cf 100644 --- a/arch/x86/src/common/up_exit.c +++ b/arch/x86/src/common/up_exit.c @@ -85,8 +85,8 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) int i; #endif - sdbg(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); - sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); + serr(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); + serr(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); #if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; @@ -95,7 +95,7 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) struct inode *inode = filelist->fl_files[i].f_inode; if (inode) { - sdbg(" fd=%d refcount=%d\n", + serr(" fd=%d refcount=%d\n", i, inode->i_crefs); } } @@ -109,11 +109,11 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 - sdbg(" fd=%d nbytes=%d\n", + serr(" fd=%d nbytes=%d\n", filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - sdbg(" fd=%d\n", filep->fs_fd); + serr(" fd=%d\n", filep->fs_fd); #endif } } diff --git a/arch/x86/src/i486/up_createstack.c b/arch/x86/src/i486/up_createstack.c index 61992d2740..f51d6f2ca2 100644 --- a/arch/x86/src/i486/up_createstack.c +++ b/arch/x86/src/i486/up_createstack.c @@ -144,7 +144,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) if (!tcb->stack_alloc_ptr) { - sdbg("ERROR: Failed to allocate stack, size %d\n", stack_size); + serr("ERROR: Failed to allocate stack, size %d\n", stack_size); } #endif } diff --git a/arch/x86/src/i486/up_schedulesigaction.c b/arch/x86/src/i486/up_schedulesigaction.c index 60604e8827..6719699bb2 100644 --- a/arch/x86/src/i486/up_schedulesigaction.c +++ b/arch/x86/src/i486/up_schedulesigaction.c @@ -101,7 +101,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); /* Make sure that interrupts are disabled */ @@ -115,7 +115,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) * to the currently executing task. */ - sdbg("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); + serr("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); if (tcb == this_task()) { diff --git a/arch/x86/src/i486/up_sigdeliver.c b/arch/x86/src/i486/up_sigdeliver.c index e807c3d616..1411786d5a 100644 --- a/arch/x86/src/i486/up_sigdeliver.c +++ b/arch/x86/src/i486/up_sigdeliver.c @@ -95,7 +95,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -126,7 +126,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/x86/src/qemu/qemu_vga.c b/arch/x86/src/qemu/qemu_vga.c index ec56c8aaa8..1513339332 100644 --- a/arch/x86/src/qemu/qemu_vga.c +++ b/arch/x86/src/qemu/qemu_vga.c @@ -498,7 +498,7 @@ FAR struct lcd_dev_s *qemu_vga_initialize(void) int ret = init_graph_vga(VGA_XRES, VGA_YRES, 1); if (ret < 0) { - gdbg("ERROR: init_graph_vga returned %d\n",ret); + gerr("ERROR: init_graph_vga returned %d\n",ret); } memset(g_pscreen, 0, VGA_XRES * VGA_YRES); @@ -510,7 +510,7 @@ void qemu_vga(void) int ret = init_graph_vga(VGA_XRES, VGA_YRES, 1); if (ret < 0) { - gdbg("ERROR: init_graph_vga returned %d\n",ret); + gerr("ERROR: init_graph_vga returned %d\n",ret); } memset(g_pscreen, g_bg_color, VGA_XRES * VGA_YRES); diff --git a/arch/z16/src/common/up_blocktask.c b/arch/z16/src/common/up_blocktask.c index e165e74a73..dd8ea8ef17 100644 --- a/arch/z16/src/common/up_blocktask.c +++ b/arch/z16/src/common/up_blocktask.c @@ -83,7 +83,7 @@ void up_block_task(FAR struct tcb_s *tcb, tstate_t task_state) ASSERT((tcb->task_state >= FIRST_READY_TO_RUN_STATE) && (tcb->task_state <= LAST_READY_TO_RUN_STATE)); - /* dbg("Blocking TCB=%p\n", tcb); */ + /* err("Blocking TCB=%p\n", tcb); */ /* Remove the tcb task from the ready-to-run list. If we * are blocking the task at the head of the task list (the diff --git a/arch/z16/src/common/up_createstack.c b/arch/z16/src/common/up_createstack.c index db9296dd1c..2c35e68aef 100644 --- a/arch/z16/src/common/up_createstack.c +++ b/arch/z16/src/common/up_createstack.c @@ -125,7 +125,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) if (!tcb->stack_alloc_ptr) { - sdbg("ERROR: Failed to allocate stack, size %d\n", stack_size); + serr("ERROR: Failed to allocate stack, size %d\n", stack_size); } #endif } diff --git a/arch/z16/src/common/up_schedulesigaction.c b/arch/z16/src/common/up_schedulesigaction.c index 0592b88335..090c641f60 100644 --- a/arch/z16/src/common/up_schedulesigaction.c +++ b/arch/z16/src/common/up_schedulesigaction.c @@ -92,7 +92,7 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - dbg("tcb=0x%p sigdeliver=0x%06x\n", tcb, (uint32_t)sigdeliver); + err("tcb=0x%p sigdeliver=0x%06x\n", tcb, (uint32_t)sigdeliver); /* Make sure that interrupts are disabled */ @@ -106,7 +106,7 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) * being delivered to the currently executing task. */ - dbg("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); + err("rtcb=0x%p g_current_regs=0x%p\n", this_task(), g_current_regs); if (tcb == this_task()) { diff --git a/arch/z16/src/common/up_sigdeliver.c b/arch/z16/src/common/up_sigdeliver.c index 9861f0096e..cbe9e95ca6 100644 --- a/arch/z16/src/common/up_sigdeliver.c +++ b/arch/z16/src/common/up_sigdeliver.c @@ -84,7 +84,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -119,7 +119,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/z16/src/common/up_unblocktask.c b/arch/z16/src/common/up_unblocktask.c index 96eb7675ac..26aac84675 100644 --- a/arch/z16/src/common/up_unblocktask.c +++ b/arch/z16/src/common/up_unblocktask.c @@ -79,7 +79,7 @@ void up_unblock_task(FAR struct tcb_s *tcb) ASSERT((tcb->task_state >= FIRST_BLOCKED_STATE) && (tcb->task_state <= LAST_BLOCKED_STATE)); - /* dbg("Unblocking TCB=%p\n", tcb); */ + /* err("Unblocking TCB=%p\n", tcb); */ /* Remove the task from the blocked task list */ diff --git a/arch/z16/src/z16f/z16f_espi.c b/arch/z16/src/z16f/z16f_espi.c index 16676a280e..31971a11fd 100644 --- a/arch/z16/src/z16f/z16f_espi.c +++ b/arch/z16/src/z16f/z16f_espi.c @@ -70,14 +70,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo (void) # endif #else -# define spidbg (void) +# define spierr (void) # define spiinfo (void) #endif @@ -476,7 +476,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) priv->frequency = frequency; priv->actual = actual; - spidbg("Frequency %d->%d\n", frequency, actual); + spierr("Frequency %d->%d\n", frequency, actual); return actual; } diff --git a/arch/z80/src/common/up_blocktask.c b/arch/z80/src/common/up_blocktask.c index 831de41317..8d0bcfc3a0 100644 --- a/arch/z80/src/common/up_blocktask.c +++ b/arch/z80/src/common/up_blocktask.c @@ -85,7 +85,7 @@ void up_block_task(FAR struct tcb_s *tcb, tstate_t task_state) ASSERT((tcb->task_state >= FIRST_READY_TO_RUN_STATE) && (tcb->task_state <= LAST_READY_TO_RUN_STATE)); - /* dbg("Blocking TCB=%p\n", tcb); */ + /* err("Blocking TCB=%p\n", tcb); */ /* Remove the tcb task from the ready-to-run list. If we * are blocking the task at the head of the task list (the diff --git a/arch/z80/src/common/up_createstack.c b/arch/z80/src/common/up_createstack.c index b38a0b9a61..a0a2bc2507 100644 --- a/arch/z80/src/common/up_createstack.c +++ b/arch/z80/src/common/up_createstack.c @@ -142,7 +142,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) if (!tcb->stack_alloc_ptr) { - sdbg("ERROR: Failed to allocate stack, size %d\n", stack_size); + serr("ERROR: Failed to allocate stack, size %d\n", stack_size); } #endif } diff --git a/arch/z80/src/common/up_unblocktask.c b/arch/z80/src/common/up_unblocktask.c index f110172052..a3bad89b49 100644 --- a/arch/z80/src/common/up_unblocktask.c +++ b/arch/z80/src/common/up_unblocktask.c @@ -81,7 +81,7 @@ void up_unblock_task(FAR struct tcb_s *tcb) ASSERT((tcb->task_state >= FIRST_BLOCKED_STATE) && (tcb->task_state <= LAST_BLOCKED_STATE)); - /* dbg("Unblocking TCB=%p\n", tcb); */ + /* err("Unblocking TCB=%p\n", tcb); */ /* Remove the task from the blocked task list */ diff --git a/arch/z80/src/ez80/ez80_emac.c b/arch/z80/src/ez80/ez80_emac.c index f715cfcac2..12feabae9e 100644 --- a/arch/z80/src/ez80/ez80_emac.c +++ b/arch/z80/src/ez80/ez80_emac.c @@ -578,7 +578,7 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) phyval = ez80emac_miiread(priv, MII_PHYID1); if (phyval != MII_PHYID1_AM79C874) { - ndbg("Not an Am79c874 PHY: PHY1=%04x vs %04x\n", phyval, MII_PHYID1_AM79C874); + nerr("Not an Am79c874 PHY: PHY1=%04x vs %04x\n", phyval, MII_PHYID1_AM79C874); ret = -ENODEV; goto dumpregs; } @@ -586,7 +586,7 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) phyval = ez80emac_miiread(priv, MII_PHYID2); if (phyval != MII_PHYID2_AM79C874) { - ndbg("Not an Am79c874 PHY: PHY2=%04x vs %04x\n", phyval, MII_PHYID2_AM79C874); + nerr("Not an Am79c874 PHY: PHY2=%04x vs %04x\n", phyval, MII_PHYID2_AM79C874); ret = -ENODEV; goto dumpregs; } @@ -618,7 +618,7 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) #if CONFIG_EZ80_PHYCONFIG == EZ80_EMAC_AUTONEG - ndbg("Configure autonegotiation\n"); + nerr("Configure autonegotiation\n"); if (bauto) { ez80emac_miiwrite(priv, MII_ADVERTISE, @@ -628,12 +628,12 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) } else { - ndbg("Am79c784 is not capable of autonegotiation\n"); + nerr("Am79c784 is not capable of autonegotiation\n"); } #elif CONFIG_EZ80_PHYCONFIG == EZ80_EMAC_100BFD - ndbg("100BASETX full duplex\n"); + nerr("100BASETX full duplex\n"); phyval |= MII_MCR_SPEED100 | MII_MCR_FULLDPLX; ez80emac_miiwrite(priv, MII_ADVERTISE, MII_ADVERTISE_100BASETXFULL|MII_ADVERTISE_100BASETXHALF| @@ -642,7 +642,7 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) #elif CONFIG_EZ80_PHYCONFIG == EZ80_EMAC_100BHD - ndbg("100BASETX half duplex\n"); + nerr("100BASETX half duplex\n"); phyval |= MII_MCR_SPEED100; ez80emac_miiwrite(priv, MII_ADVERTISE, MII_ADVERTISE_100BASETXHALF|MII_ADVERTISE_10BASETXFULL| @@ -650,14 +650,14 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) #elif CONFIG_EZ80_PHYCONFIG == EZ80_EMAC_10BFD - ndbg("10BASETX full duplex\n"); + nerr("10BASETX full duplex\n"); phyval |= MII_MCR_FULLDPLX; ez80emac_miiwrite(priv, MII_ADVERTISE, MII_ADVERTISE_10BASETXFULL|MII_ADVERTISE_10BASETXHALF|MII_ADVERTISE_CSMA); #elif CONFIG_EZ80_PHYCONFIG == EZ80_EMAC_10BHD - ndbg("10BASETX half duplex\n"); + nerr("10BASETX half duplex\n"); ez80emac_miiwrite(priv, MII_ADVERTISE, MII_ADVERTISE_10BASETXHALF|MII_ADVERTISE_CSMA); @@ -681,7 +681,7 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) if ((phyval & MII_MSR_LINKSTATUS) == 0) { - ndbg("Failed to establish link\n"); + nerr("Failed to establish link\n"); ret = -ETIMEDOUT; } else @@ -731,21 +731,21 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) if (!ez80emac_miipoll(priv, MII_MCR, MII_MCR_ANRESTART, false)) { - ndbg("Autonegotiation didn't start.\n"); + nerr("Autonegotiation didn't start.\n"); } /* Wait for auto-negotiation to complete */ if (!ez80emac_miipoll(priv, MII_MSR, MII_MSR_ANEGCOMPLETE, true)) { - ndbg("Autonegotiation didn't complete.\n"); + nerr("Autonegotiation didn't complete.\n"); } /* Wait link */ if (!ez80emac_miipoll(priv, MII_MSR, MII_MSR_LINKSTATUS, true)) { - ndbg("Link is down!\n"); + nerr("Link is down!\n"); priv->blinkok = false; } else @@ -763,7 +763,7 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) if ((advertise & MII_ADVERTISE_100BASETXFULL) && (lpa & MII_LPA_100BASETXFULL)) { - ndbg("100BASETX full duplex\n"); + nerr("100BASETX full duplex\n"); regval = inp(EZ80_EMAC_CFG1); regval |= EMAC_CFG1_FULLHD; /* Enable full duplex mode */ outp(EZ80_EMAC_CFG1, regval); @@ -775,7 +775,7 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) else if ((advertise & MII_ADVERTISE_100BASETXHALF) && (lpa & MII_LPA_100BASETXHALF)) { - ndbg("100BASETX half duplex\n"); + nerr("100BASETX half duplex\n"); regval = inp(EZ80_EMAC_CFG1); regval &= ~EMAC_CFG1_FULLHD; /* Disable full duplex mode */ outp(EZ80_EMAC_CFG1, regval); @@ -787,7 +787,7 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) else if ((advertise & MII_ADVERTISE_10BASETXFULL) && (lpa & MII_LPA_10BASETXFULL)) { - ndbg("10BASETX full duplex\n"); + nerr("10BASETX full duplex\n"); regval = inp(EZ80_EMAC_CFG1); regval |= EMAC_CFG1_FULLHD; /* Enable full duplex mode */ outp(EZ80_EMAC_CFG1, regval); @@ -799,7 +799,7 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) else if ((advertise & MII_ADVERTISE_10BASETXHALF) && (lpa & MII_LPA_10BASETXHALF)) { - ndbg("10BASETX half duplex\n"); + nerr("10BASETX half duplex\n"); regval = inp(EZ80_EMAC_CFG1); regval &= ~EMAC_CFG1_FULLHD; /* Disable full duplex mode */ outp(EZ80_EMAC_CFG1, regval); @@ -808,7 +808,7 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) } else { - ndbg("No valid connection; force 10Mbps half-duplex.\n"); + nerr("No valid connection; force 10Mbps half-duplex.\n"); regval = inp(EZ80_EMAC_CFG1); regval &= ~EMAC_CFG1_FULLHD; /* Disable full duplex mode */ outp(EZ80_EMAC_CFG1, regval); @@ -1400,7 +1400,7 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv) else #endif { - ndbg("Unsupported packet type dropped (%02x)\n", ETHBUF->type); + nerr("Unsupported packet type dropped (%02x)\n", ETHBUF->type); EMAC_STAT(priv, rx_dropped); } @@ -1458,7 +1458,7 @@ static int ez80emac_txinterrupt(int irq, FAR void *context) { if ((txhead->stat & EMAC_TXDESC_ABORT) != 0) { - ndbg("Descriptor %p aborted {%06x, %u, %04x} trp=%02x%02x\n", + nerr("Descriptor %p aborted {%06x, %u, %04x} trp=%02x%02x\n", txhead, txhead->np, txhead->pktsize, txhead->stat, inp(EZ80_EMAC_TRP_H), inp(EZ80_EMAC_TRP_L)); @@ -1604,7 +1604,7 @@ static int ez80emac_sysinterrupt(int irq, FAR void *context) if ((istat & EMAC_ISTAT_TXFSMERR) != 0) { - ndbg("Tx FSMERR txhead=%p {%06x, %u, %04x} trp=%02x%02x istat=%02x\n", + nerr("Tx FSMERR txhead=%p {%06x, %u, %04x} trp=%02x%02x istat=%02x\n", priv->txhead, priv->txhead->np, priv->txhead->pktsize, priv->txhead->stat, inp(EZ80_EMAC_TRP_H), inp(EZ80_EMAC_TRP_L), istat); @@ -1620,7 +1620,7 @@ static int ez80emac_sysinterrupt(int irq, FAR void *context) if ((istat & EMAC_ISTAT_RXOVR) != 0) { - ndbg("Rx OVR rxnext=%p {%06x, %u, %04x} rrp=%02x%02x rwp=%02x%02x blkslft=%02x istat=%02x\n", + nerr("Rx OVR rxnext=%p {%06x, %u, %04x} rrp=%02x%02x rwp=%02x%02x blkslft=%02x istat=%02x\n", priv->rxnext, priv->rxnext->np, priv->rxnext->pktsize, priv->rxnext->stat, inp(EZ80_EMAC_RRP_H), inp(EZ80_EMAC_RRP_L), inp(EZ80_EMAC_RWP_H), inp(EZ80_EMAC_RWP_L), @@ -1728,11 +1728,11 @@ static int ez80emac_ifup(FAR struct net_driver_s *dev) uint8_t regval; int ret; - ndbg("Bringing up: MAC %02x:%02x:%02x:%02x:%02x:%02x\n", + nerr("Bringing up: MAC %02x:%02x:%02x:%02x:%02x:%02x\n", dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1], dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3], dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]); - ndbg(" IP %d.%d.%d.%d\n", + nerr(" IP %d.%d.%d.%d\n", dev->d_ipaddr >> 24, (dev->d_ipaddr >> 16) & 0xff, (dev->d_ipaddr >> 8) & 0xff, dev->d_ipaddr & 0xff); @@ -2094,7 +2094,7 @@ static int ez80_emacinitialize(void) ez80emac_miiwrite(priv, MII_MCR, MII_MCR_RESET); if (!ez80emac_miipoll(priv, MII_MCR, MII_MCR_RESET, false)) { - ndbg("PHY reset error.\n"); + nerr("PHY reset error.\n"); } /* Initialize MAC */ @@ -2149,7 +2149,7 @@ static int ez80_emacinitialize(void) ez80emac_miiwrite(priv, MII_MCR, MII_MCR_RESET); if (!ez80emac_miipoll(priv, MII_MCR, MII_MCR_RESET, false)) { - ndbg("PHY reset error.\n"); + nerr("PHY reset error.\n"); ret = -EIO; goto errout; } diff --git a/arch/z80/src/ez80/ez80_i2c.c b/arch/z80/src/ez80/ez80_i2c.c index d9bec997c2..73f78fc2e7 100644 --- a/arch/z80/src/ez80/ez80_i2c.c +++ b/arch/z80/src/ez80/ez80_i2c.c @@ -404,7 +404,7 @@ static int ez80_i2c_sendaddr(struct ez80_i2cdev_s *priv, uint8_t readbit) { /* This error should never occur */ - dbg("Bad START status: %02x\n", sr); + err("Bad START status: %02x\n", sr); ez80_i2c_clriflg(); return -EIO; } @@ -426,7 +426,7 @@ static int ez80_i2c_sendaddr(struct ez80_i2cdev_s *priv, uint8_t readbit) sr = ez80_i2c_waitiflg(); if (sr != I2C_SR_MADDRWRACK && sr != I2C_SR_MADDRWR) { - dbg("Bad ADDR8 status: %02x\n", sr); + err("Bad ADDR8 status: %02x\n", sr); goto failure; } } @@ -445,7 +445,7 @@ static int ez80_i2c_sendaddr(struct ez80_i2cdev_s *priv, uint8_t readbit) sr = ez80_i2c_waitiflg(); if (sr != I2C_SR_MADDRWRACK && sr != I2C_SR_MADDRWR) { - dbg("Bad ADDR10H status: %02x\n", sr); + err("Bad ADDR10H status: %02x\n", sr); goto failure; } @@ -459,7 +459,7 @@ static int ez80_i2c_sendaddr(struct ez80_i2cdev_s *priv, uint8_t readbit) sr = ez80_i2c_waitiflg(); if (sr != I2C_SR_MADDR2WRACK && sr != I2C_SR_MADDR2WR) { - dbg("Bad ADDR10L status: %02x\n", sr); + err("Bad ADDR10L status: %02x\n", sr); goto failure; } } @@ -479,12 +479,12 @@ failure: * Call address received, ACK transmitted */ case I2C_SR_ARBLOST4: /* Arbitration lost in address as master, slave * address and Read bit received, ACK transmitted */ - dbg("Arbitration lost: %02x\n", sr); + err("Arbitration lost: %02x\n", sr); ez80_i2c_clriflg(); return -EAGAIN; default: - dbg("Unexpected status: %02x\n", sr); + err("Unexpected status: %02x\n", sr); ez80_i2c_clriflg(); return -EIO; } @@ -634,7 +634,7 @@ static int ez80_i2c_read_transfer(FAR struct ez80_i2cdev_s *priv, * this will cause the whole transfer to start over */ - dbg("Arbitration lost: %02x\n", regval); + err("Arbitration lost: %02x\n", regval); ez80_i2c_clriflg(); break; } @@ -643,7 +643,7 @@ static int ez80_i2c_read_transfer(FAR struct ez80_i2cdev_s *priv, else { - dbg("Unexpected status: %02x\n", regval); + err("Unexpected status: %02x\n", regval); ez80_i2c_clriflg(); return-EIO; } @@ -731,7 +731,7 @@ static int ez80_i2c_write_transfer(FAR struct ez80_i2cdev_s *priv, sr = ez80_i2c_waitiflg(); if (sr != I2C_SR_MDATAWRACK && sr != I2C_SR_MDATAWR) { - dbg("Bad DATA status: %02x\n", sr); + err("Bad DATA status: %02x\n", sr); ez80_i2c_clriflg(); if (sr == I2C_SR_ARBLOST1) { diff --git a/arch/z80/src/ez80/ez80_schedulesigaction.c b/arch/z80/src/ez80/ez80_schedulesigaction.c index 33d6c11b5f..b8de5d3c73 100644 --- a/arch/z80/src/ez80/ez80_schedulesigaction.c +++ b/arch/z80/src/ez80/ez80_schedulesigaction.c @@ -125,7 +125,7 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - sdbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); + serr("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); /* Make sure that interrupts are disabled */ diff --git a/arch/z80/src/ez80/ez80_sigdeliver.c b/arch/z80/src/ez80/ez80_sigdeliver.c index 657961ce59..3532758f63 100644 --- a/arch/z80/src/ez80/ez80_sigdeliver.c +++ b/arch/z80/src/ez80/ez80_sigdeliver.c @@ -95,7 +95,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -127,7 +127,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/z80/src/z180/z180_mmu.c b/arch/z80/src/z180/z180_mmu.c index e3612dc9f0..53e6183d0b 100644 --- a/arch/z80/src/z180/z180_mmu.c +++ b/arch/z80/src/z180/z180_mmu.c @@ -258,7 +258,7 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize, { /* No address environment... but I suppose that is not an error */ - sdbg("ERROR: npages is zero\n"); + serr("ERROR: npages is zero\n"); return OK; } @@ -273,7 +273,7 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize, cbr = z180_mmu_alloccbr(); if (!cbr) { - sdbg("ERROR: No free CBR structures\n"); + serr("ERROR: No free CBR structures\n"); ret = -ENOMEM; goto errout_with_irq; } @@ -287,7 +287,7 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize, #endif if (!alloc) { - sdbg("ERROR: Failed to allocate %d pages\n", npages); + serr("ERROR: Failed to allocate %d pages\n", npages); ret = -ENOMEM; goto errout_with_cbr; } diff --git a/arch/z80/src/z180/z180_schedulesigaction.c b/arch/z80/src/z180/z180_schedulesigaction.c index a29a4b9d8a..360f06bb1a 100644 --- a/arch/z80/src/z180/z180_schedulesigaction.c +++ b/arch/z80/src/z180/z180_schedulesigaction.c @@ -125,7 +125,7 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); + err("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); /* Make sure that interrupts are disabled */ diff --git a/arch/z80/src/z180/z180_sigdeliver.c b/arch/z80/src/z180/z180_sigdeliver.c index e058d5a116..42925eb31a 100644 --- a/arch/z80/src/z180/z180_sigdeliver.c +++ b/arch/z80/src/z180/z180_sigdeliver.c @@ -94,7 +94,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -126,7 +126,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/z80/src/z8/z8_i2c.c b/arch/z80/src/z8/z8_i2c.c index cc3508a564..cf8c347068 100644 --- a/arch/z80/src/z8/z8_i2c.c +++ b/arch/z80/src/z8/z8_i2c.c @@ -236,7 +236,7 @@ static uint16_t z8_i2c_getbrg(uint32_t frequency) if (frequency > 400*1000) { - dbg("Invalid inputs\n"); + err("Invalid inputs\n"); frequency = 400*1000; } diff --git a/arch/z80/src/z8/z8_schedulesigaction.c b/arch/z80/src/z8/z8_schedulesigaction.c index 2e6de089ec..94d9dc0541 100644 --- a/arch/z80/src/z8/z8_schedulesigaction.c +++ b/arch/z80/src/z8/z8_schedulesigaction.c @@ -125,7 +125,7 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); + err("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); /* Make sure that interrupts are disabled */ diff --git a/arch/z80/src/z8/z8_sigdeliver.c b/arch/z80/src/z8/z8_sigdeliver.c index 1cbb7e2159..0edcb9e8c7 100644 --- a/arch/z80/src/z8/z8_sigdeliver.c +++ b/arch/z80/src/z8/z8_sigdeliver.c @@ -109,7 +109,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -141,7 +141,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/z80/src/z80/z80_schedulesigaction.c b/arch/z80/src/z80/z80_schedulesigaction.c index eb0c9c5554..a90d495c3c 100644 --- a/arch/z80/src/z80/z80_schedulesigaction.c +++ b/arch/z80/src/z80/z80_schedulesigaction.c @@ -125,7 +125,7 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; - dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); + err("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); /* Make sure that interrupts are disabled */ diff --git a/arch/z80/src/z80/z80_sigdeliver.c b/arch/z80/src/z80/z80_sigdeliver.c index b56d1afd32..198ac4b4c7 100644 --- a/arch/z80/src/z80/z80_sigdeliver.c +++ b/arch/z80/src/z80/z80_sigdeliver.c @@ -94,7 +94,7 @@ void up_sigdeliver(void) board_autoled_on(LED_SIGNAL); - sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); ASSERT(rtcb->xcp.sigdeliver != NULL); @@ -126,7 +126,7 @@ void up_sigdeliver(void) * errno that is needed by the user logic (it is probably EINTR). */ - sdbg("Resuming\n"); + serr("Resuming\n"); (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/audio/audio.c b/audio/audio.c index e8caf0a4b8..8b35368174 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -832,7 +832,7 @@ static void audio_callback(FAR void *handle, uint16_t reason, default: { - auddbg("Unknown callback reason code %d\n", reason); + auderr("Unknown callback reason code %d\n", reason); break; } } @@ -885,7 +885,7 @@ int audio_register(FAR const char *name, FAR struct audio_lowerhalf_s *dev) upper = (FAR struct audio_upperhalf_s *)kmm_zalloc(sizeof(struct audio_upperhalf_s)); if (!upper) { - auddbg("Allocation failed\n"); + auderr("Allocation failed\n"); return -ENOMEM; } diff --git a/audio/pcm_decode.c b/audio/pcm_decode.c index f650045dd5..28dafc41a9 100644 --- a/audio/pcm_decode.c +++ b/audio/pcm_decode.c @@ -259,23 +259,23 @@ static void pcm_callback(FAR void *arg, uint16_t reason, #ifdef CONFIG_PCM_DEBUG static void pcm_dump(FAR const struct wav_header_s *wav) { - dbg("Wave file header\n"); - dbg(" Header Chunk:\n"); - dbg(" Chunk ID: 0x%08x\n", wav->hdr.chunkid); - dbg(" Chunk Size: %u\n", wav->hdr.chunklen); - dbg(" Format: 0x%08x\n", wav->hdr.format); - dbg(" Format Chunk:\n"); - dbg(" Chunk ID: 0x%08x\n", wav->fmt.chunkid); - dbg(" Chunk Size: %u\n", wav->fmt.chunklen); - dbg(" Audio Format: 0x%04x\n", wav->fmt.format); - dbg(" Num. Channels: %d\n", wav->fmt.nchannels); - dbg(" Sample Rate: %u\n", wav->fmt.samprate); - dbg(" Byte Rate: %u\n", wav->fmt.byterate); - dbg(" Block Align: %d\n", wav->fmt.align); - dbg(" Bits Per Sample: %d\n", wav->fmt.bpsamp); - dbg(" Data Chunk:\n"); - dbg(" Chunk ID: 0x%08x\n", wav->data.chunkid); - dbg(" Chunk Size: %u\n", wav->data.chunklen); + err("Wave file header\n"); + err(" Header Chunk:\n"); + err(" Chunk ID: 0x%08x\n", wav->hdr.chunkid); + err(" Chunk Size: %u\n", wav->hdr.chunklen); + err(" Format: 0x%08x\n", wav->hdr.format); + err(" Format Chunk:\n"); + err(" Chunk ID: 0x%08x\n", wav->fmt.chunkid); + err(" Chunk Size: %u\n", wav->fmt.chunklen); + err(" Audio Format: 0x%04x\n", wav->fmt.format); + err(" Num. Channels: %d\n", wav->fmt.nchannels); + err(" Sample Rate: %u\n", wav->fmt.samprate); + err(" Byte Rate: %u\n", wav->fmt.byterate); + err(" Block Align: %d\n", wav->fmt.align); + err(" Bits Per Sample: %d\n", wav->fmt.bpsamp); + err(" Data Chunk:\n"); + err(" Chunk ID: 0x%08x\n", wav->data.chunkid); + err(" Chunk Size: %u\n", wav->data.chunklen); } #endif @@ -398,14 +398,14 @@ static bool pcm_parsewav(FAR struct pcm_decode_s *priv, uint8_t *data) if (priv->bpsamp != 8 && priv->bpsamp != 16) { - auddbg("ERROR: Cannot support bits per sample of %d in this mode\n", + auderr("ERROR: Cannot support bits per sample of %d in this mode\n", priv->bpsamp); return -EINVAL; } if (priv->nchannels != 1 && priv->nchannels != 2) { - auddbg("ERROR: Cannot support number of channles of %d in this mode\n", + auderr("ERROR: Cannot support number of channles of %d in this mode\n", priv->nchannels); return -EINVAL; } @@ -691,7 +691,7 @@ static int pcm_getcaps(FAR struct audio_lowerhalf_s *dev, int type, ret = lower->ops->getcaps(lower, type, caps); if (ret < 0) { - auddbg("Lower getcaps() failed: %d\n", ret); + auderr("Lower getcaps() failed: %d\n", ret); return ret; } @@ -1100,7 +1100,7 @@ static int pcm_enqueuebuffer(FAR struct audio_lowerhalf_s *dev, #endif if (ret < 0) { - auddbg("ERROR: Failed to set PCM configuration: %d\n", ret); + auderr("ERROR: Failed to set PCM configuration: %d\n", ret); return ret; } @@ -1135,7 +1135,7 @@ static int pcm_enqueuebuffer(FAR struct audio_lowerhalf_s *dev, } } - auddbg("ERROR: Invalid PCM WAV file\n"); + auderr("ERROR: Invalid PCM WAV file\n"); /* The normal protocol for streaming errors is as follows: * @@ -1161,7 +1161,7 @@ static int pcm_enqueuebuffer(FAR struct audio_lowerhalf_s *dev, /* This is not a WAV file! */ - auddbg("ERROR: Invalid PCM WAV file\n"); + auderr("ERROR: Invalid PCM WAV file\n"); return -EINVAL; } @@ -1378,7 +1378,7 @@ FAR struct audio_lowerhalf_s * priv = (FAR struct pcm_decode_s *)kmm_zalloc(sizeof(struct pcm_decode_s)); if (!priv) { - auddbg("ERROR: Failed to allocate driver structure\n"); + auderr("ERROR: Failed to allocate driver structure\n"); return NULL; } diff --git a/binfmt/binfmt_copyargv.c b/binfmt/binfmt_copyargv.c index 612c0ec005..f0a594f5a6 100644 --- a/binfmt/binfmt_copyargv.c +++ b/binfmt/binfmt_copyargv.c @@ -114,7 +114,7 @@ int binfmt_copyargv(FAR struct binary_s *bin, FAR char * const *argv) if (nargs > MAX_EXEC_ARGS) { - bdbg("ERROR: Too many arguments: %lu\n", (unsigned long)argvsize); + berr("ERROR: Too many arguments: %lu\n", (unsigned long)argvsize); return -E2BIG; } } @@ -129,7 +129,7 @@ int binfmt_copyargv(FAR struct binary_s *bin, FAR char * const *argv) bin->argbuffer = (FAR char *)kmm_malloc(argvsize + argsize); if (!bin->argbuffer) { - bdbg("ERROR: Failed to allocate the argument buffer\n"); + berr("ERROR: Failed to allocate the argument buffer\n"); return -ENOMEM; } diff --git a/binfmt/binfmt_dumpmodule.c b/binfmt/binfmt_dumpmodule.c index d4b534ce9c..a28f4cefee 100644 --- a/binfmt/binfmt_dumpmodule.c +++ b/binfmt/binfmt_dumpmodule.c @@ -86,21 +86,21 @@ int dump_module(FAR const struct binary_s *bin) { if (bin) { - bdbg("Module:\n"); - bdbg(" filename: %s\n", bin->filename); - bdbg(" argv: %p\n", bin->argv); - bdbg(" entrypt: %p\n", bin->entrypt); - bdbg(" mapped: %p size=%d\n", bin->mapped, bin->mapsize); - bdbg(" alloc: %p %p %p\n", bin->alloc[0], bin->alloc[1], bin->alloc[2]); + berr("Module:\n"); + berr(" filename: %s\n", bin->filename); + berr(" argv: %p\n", bin->argv); + berr(" entrypt: %p\n", bin->entrypt); + berr(" mapped: %p size=%d\n", bin->mapped, bin->mapsize); + berr(" alloc: %p %p %p\n", bin->alloc[0], bin->alloc[1], bin->alloc[2]); #ifdef CONFIG_BINFMT_CONSTRUCTORS - bdbg(" ctors: %p nctors=%d\n", bin->ctors, bin->nctors); - bdbg(" dtors: %p ndtors=%d\n", bin->dtors, bin->ndtors); + berr(" ctors: %p nctors=%d\n", bin->ctors, bin->nctors); + berr(" dtors: %p ndtors=%d\n", bin->dtors, bin->ndtors); #endif #ifdef CONFIG_ARCH_ADDRENV - bdbg(" addrenv: %p\n", bin->addrenv); + berr(" addrenv: %p\n", bin->addrenv); #endif - bdbg(" stacksize: %d\n", bin->stacksize); - bdbg(" unload: %p\n", bin->unload); + berr(" stacksize: %d\n", bin->stacksize); + berr(" unload: %p\n", bin->unload); } return OK; diff --git a/binfmt/binfmt_exec.c b/binfmt/binfmt_exec.c index 6352b0f981..2e6f074b79 100644 --- a/binfmt/binfmt_exec.c +++ b/binfmt/binfmt_exec.c @@ -94,7 +94,7 @@ int exec(FAR const char *filename, FAR char * const *argv, bin = (FAR struct binary_s *)kmm_zalloc(sizeof(struct binary_s)); if (!bin) { - bdbg("ERROR: Failed to allocate binary_s\n"); + berr("ERROR: Failed to allocate binary_s\n"); errcode = ENOMEM; goto errout; } @@ -111,7 +111,7 @@ int exec(FAR const char *filename, FAR char * const *argv, if (ret < 0) { errcode = -ret; - bdbg("ERROR: Failed to copy argv[]: %d\n", errcode); + berr("ERROR: Failed to copy argv[]: %d\n", errcode); goto errout_with_bin; } @@ -121,7 +121,7 @@ int exec(FAR const char *filename, FAR char * const *argv, if (ret < 0) { errcode = get_errno(); - bdbg("ERROR: Failed to load program '%s': %d\n", filename, errcode); + berr("ERROR: Failed to load program '%s': %d\n", filename, errcode); goto errout_with_argv; } @@ -138,7 +138,7 @@ int exec(FAR const char *filename, FAR char * const *argv, if (pid < 0) { errcode = get_errno(); - bdbg("ERROR: Failed to execute program '%s': %d\n", filename, errcode); + berr("ERROR: Failed to execute program '%s': %d\n", filename, errcode); goto errout_with_lock; } @@ -150,7 +150,7 @@ int exec(FAR const char *filename, FAR char * const *argv, if (ret < 0) { errcode = get_errno(); - bdbg("ERROR: Failed to schedule unload '%s': %d\n", filename, errcode); + berr("ERROR: Failed to schedule unload '%s': %d\n", filename, errcode); } sched_unlock(); @@ -183,7 +183,7 @@ errout: if (ret < 0) { errcode = get_errno(); - bdbg("ERROR: Failed to load program '%s': %d\n", filename, errcode); + berr("ERROR: Failed to load program '%s': %d\n", filename, errcode); goto errout; } @@ -193,7 +193,7 @@ errout: if (ret < 0) { errcode = get_errno(); - bdbg("ERROR: Failed to execute program '%s': %d\n", filename, errcode); + berr("ERROR: Failed to execute program '%s': %d\n", filename, errcode); goto errout_with_module; } diff --git a/binfmt/binfmt_execmodule.c b/binfmt/binfmt_execmodule.c index 32b35c15aa..eef50068a5 100644 --- a/binfmt/binfmt_execmodule.c +++ b/binfmt/binfmt_execmodule.c @@ -172,7 +172,7 @@ int exec_module(FAR const struct binary_s *binp) ret = up_addrenv_select(&binp->addrenv, &oldenv); if (ret < 0) { - bdbg("ERROR: up_addrenv_select() failed: %d\n", ret); + berr("ERROR: up_addrenv_select() failed: %d\n", ret); errcode = -ret; goto errout_with_tcb; } @@ -203,7 +203,7 @@ int exec_module(FAR const struct binary_s *binp) if (ret < 0) { errcode = get_errno(); - bdbg("task_init() failed: %d\n", errcode); + berr("task_init() failed: %d\n", errcode); goto errout_with_addrenv; } @@ -224,7 +224,7 @@ int exec_module(FAR const struct binary_s *binp) ret = up_addrenv_kstackalloc(&tcb->cmn); if (ret < 0) { - bdbg("ERROR: up_addrenv_select() failed: %d\n", ret); + berr("ERROR: up_addrenv_select() failed: %d\n", ret); errcode = -ret; goto errout_with_tcbinit; } @@ -236,7 +236,7 @@ int exec_module(FAR const struct binary_s *binp) ret = shm_group_initialize(tcb->cmn.group); if (ret < 0) { - bdbg("ERROR: shm_group_initialize() failed: %d\n", ret); + berr("ERROR: shm_group_initialize() failed: %d\n", ret); errcode = -ret; goto errout_with_tcbinit; } @@ -261,7 +261,7 @@ int exec_module(FAR const struct binary_s *binp) if (ret < 0) { errcode = -ret; - bdbg("ERROR: up_addrenv_clone() failed: %d\n", ret); + berr("ERROR: up_addrenv_clone() failed: %d\n", ret); goto errout_with_tcbinit; } @@ -289,7 +289,7 @@ int exec_module(FAR const struct binary_s *binp) if (ret < 0) { errcode = get_errno(); - bdbg("task_activate() failed: %d\n", errcode); + berr("task_activate() failed: %d\n", errcode); goto errout_with_tcbinit; } @@ -299,7 +299,7 @@ int exec_module(FAR const struct binary_s *binp) ret = up_addrenv_restore(&oldenv); if (ret < 0) { - bdbg("ERROR: up_addrenv_select() failed: %d\n", ret); + berr("ERROR: up_addrenv_select() failed: %d\n", ret); errcode = -ret; goto errout_with_tcbinit; } @@ -323,7 +323,7 @@ errout_with_tcb: errout: set_errno(errcode); - bdbg("returning errno: %d\n", errcode); + berr("returning errno: %d\n", errcode); return ERROR; } diff --git a/binfmt/binfmt_loadmodule.c b/binfmt/binfmt_loadmodule.c index c8b319f685..9cd80a8f42 100644 --- a/binfmt/binfmt_loadmodule.c +++ b/binfmt/binfmt_loadmodule.c @@ -91,7 +91,7 @@ static int load_default_priority(FAR struct binary_s *bin) ret = sched_getparam(0, ¶m); if (ret < 0) { - bdbg("ERROR: sched_getparam failed: %d\n", get_errno()); + berr("ERROR: sched_getparam failed: %d\n", get_errno()); return ERROR; } @@ -262,7 +262,7 @@ int load_module(FAR struct binary_s *bin) if (ret < 0) { - bdbg("ERROR: Returning errno %d\n", -ret); + berr("ERROR: Returning errno %d\n", -ret); set_errno(-ret); return ERROR; } diff --git a/binfmt/binfmt_unloadmodule.c b/binfmt/binfmt_unloadmodule.c index 05e459d658..25b9cef121 100644 --- a/binfmt/binfmt_unloadmodule.c +++ b/binfmt/binfmt_unloadmodule.c @@ -99,7 +99,7 @@ static inline int exec_dtors(FAR struct binary_s *binp) ret = up_addrenv_select(&binp->addrenv, &oldenv); if (ret < 0) { - bdbg("ERROR: up_addrenv_select() failed: %d\n", ret); + berr("ERROR: up_addrenv_select() failed: %d\n", ret); return ret; } #endif @@ -161,7 +161,7 @@ int unload_module(FAR struct binary_s *binp) ret = binp->unload(binp); if (ret < 0) { - bdbg("binp->unload() failed: %d\n", ret); + berr("binp->unload() failed: %d\n", ret); set_errno(-ret); return ERROR; } @@ -173,7 +173,7 @@ int unload_module(FAR struct binary_s *binp) ret = exec_dtors(binp); if (ret < 0) { - bdbg("exec_ctors() failed: %d\n", ret); + berr("exec_ctors() failed: %d\n", ret); set_errno(-ret); return ERROR; } diff --git a/binfmt/builtin.c b/binfmt/builtin.c index 695be24ef5..88ad846c7f 100644 --- a/binfmt/builtin.c +++ b/binfmt/builtin.c @@ -103,7 +103,7 @@ static int builtin_loadbinary(struct binary_s *binp) if (fd < 0) { int errval = get_errno(); - bdbg("ERROR: Failed to open binary %s: %d\n", binp->filename, errval); + berr("ERROR: Failed to open binary %s: %d\n", binp->filename, errval); return -errval; } @@ -115,7 +115,7 @@ static int builtin_loadbinary(struct binary_s *binp) if (ret < 0) { int errval = get_errno(); - bdbg("ERROR: FIOC_FILENAME ioctl failed: %d\n", errval); + berr("ERROR: FIOC_FILENAME ioctl failed: %d\n", errval); close(fd); return -errval; } @@ -128,7 +128,7 @@ static int builtin_loadbinary(struct binary_s *binp) if (index < 0) { int errval = get_errno(); - bdbg("ERROR: %s is not a builtin application\n", filename); + berr("ERROR: %s is not a builtin application\n", filename); close(fd); return -errval; @@ -176,7 +176,7 @@ int builtin_initialize(void) ret = register_binfmt(&g_builtin_binfmt); if (ret != 0) { - bdbg("Failed to register binfmt: %d\n", ret); + berr("Failed to register binfmt: %d\n", ret); } return ret; diff --git a/binfmt/elf.c b/binfmt/elf.c index ab08515dd9..37b1e117cd 100644 --- a/binfmt/elf.c +++ b/binfmt/elf.c @@ -115,58 +115,58 @@ static void elf_dumploadinfo(FAR struct elf_loadinfo_s *loadinfo) { int i; - bdbg("LOAD_INFO:\n"); - bdbg(" textalloc: %08lx\n", (long)loadinfo->textalloc); - bdbg(" dataalloc: %08lx\n", (long)loadinfo->dataalloc); - bdbg(" textsize: %ld\n", (long)loadinfo->textsize); - bdbg(" datasize: %ld\n", (long)loadinfo->datasize); - bdbg(" filelen: %ld\n", (long)loadinfo->filelen); + berr("LOAD_INFO:\n"); + berr(" textalloc: %08lx\n", (long)loadinfo->textalloc); + berr(" dataalloc: %08lx\n", (long)loadinfo->dataalloc); + berr(" textsize: %ld\n", (long)loadinfo->textsize); + berr(" datasize: %ld\n", (long)loadinfo->datasize); + berr(" filelen: %ld\n", (long)loadinfo->filelen); #ifdef CONFIG_BINFMT_CONSTRUCTORS - bdbg(" ctoralloc: %08lx\n", (long)loadinfo->ctoralloc); - bdbg(" ctors: %08lx\n", (long)loadinfo->ctors); - bdbg(" nctors: %d\n", loadinfo->nctors); - bdbg(" dtoralloc: %08lx\n", (long)loadinfo->dtoralloc); - bdbg(" dtors: %08lx\n", (long)loadinfo->dtors); - bdbg(" ndtors: %d\n", loadinfo->ndtors); + berr(" ctoralloc: %08lx\n", (long)loadinfo->ctoralloc); + berr(" ctors: %08lx\n", (long)loadinfo->ctors); + berr(" nctors: %d\n", loadinfo->nctors); + berr(" dtoralloc: %08lx\n", (long)loadinfo->dtoralloc); + berr(" dtors: %08lx\n", (long)loadinfo->dtors); + berr(" ndtors: %d\n", loadinfo->ndtors); #endif - bdbg(" filfd: %d\n", loadinfo->filfd); - bdbg(" symtabidx: %d\n", loadinfo->symtabidx); - bdbg(" strtabidx: %d\n", loadinfo->strtabidx); + berr(" filfd: %d\n", loadinfo->filfd); + berr(" symtabidx: %d\n", loadinfo->symtabidx); + berr(" strtabidx: %d\n", loadinfo->strtabidx); - bdbg("ELF Header:\n"); - bdbg(" e_ident: %02x %02x %02x %02x\n", + berr("ELF Header:\n"); + berr(" e_ident: %02x %02x %02x %02x\n", loadinfo->ehdr.e_ident[0], loadinfo->ehdr.e_ident[1], loadinfo->ehdr.e_ident[2], loadinfo->ehdr.e_ident[3]); - bdbg(" e_type: %04x\n", loadinfo->ehdr.e_type); - bdbg(" e_machine: %04x\n", loadinfo->ehdr.e_machine); - bdbg(" e_version: %08x\n", loadinfo->ehdr.e_version); - bdbg(" e_entry: %08lx\n", (long)loadinfo->ehdr.e_entry); - bdbg(" e_phoff: %d\n", loadinfo->ehdr.e_phoff); - bdbg(" e_shoff: %d\n", loadinfo->ehdr.e_shoff); - bdbg(" e_flags: %08x\n" , loadinfo->ehdr.e_flags); - bdbg(" e_ehsize: %d\n", loadinfo->ehdr.e_ehsize); - bdbg(" e_phentsize: %d\n", loadinfo->ehdr.e_phentsize); - bdbg(" e_phnum: %d\n", loadinfo->ehdr.e_phnum); - bdbg(" e_shentsize: %d\n", loadinfo->ehdr.e_shentsize); - bdbg(" e_shnum: %d\n", loadinfo->ehdr.e_shnum); - bdbg(" e_shstrndx: %d\n", loadinfo->ehdr.e_shstrndx); + berr(" e_type: %04x\n", loadinfo->ehdr.e_type); + berr(" e_machine: %04x\n", loadinfo->ehdr.e_machine); + berr(" e_version: %08x\n", loadinfo->ehdr.e_version); + berr(" e_entry: %08lx\n", (long)loadinfo->ehdr.e_entry); + berr(" e_phoff: %d\n", loadinfo->ehdr.e_phoff); + berr(" e_shoff: %d\n", loadinfo->ehdr.e_shoff); + berr(" e_flags: %08x\n" , loadinfo->ehdr.e_flags); + berr(" e_ehsize: %d\n", loadinfo->ehdr.e_ehsize); + berr(" e_phentsize: %d\n", loadinfo->ehdr.e_phentsize); + berr(" e_phnum: %d\n", loadinfo->ehdr.e_phnum); + berr(" e_shentsize: %d\n", loadinfo->ehdr.e_shentsize); + berr(" e_shnum: %d\n", loadinfo->ehdr.e_shnum); + berr(" e_shstrndx: %d\n", loadinfo->ehdr.e_shstrndx); if (loadinfo->shdr && loadinfo->ehdr.e_shnum > 0) { for (i = 0; i < loadinfo->ehdr.e_shnum; i++) { FAR Elf32_Shdr *shdr = &loadinfo->shdr[i]; - bdbg("Sections %d:\n", i); - bdbg(" sh_name: %08x\n", shdr->sh_name); - bdbg(" sh_type: %08x\n", shdr->sh_type); - bdbg(" sh_flags: %08x\n", shdr->sh_flags); - bdbg(" sh_addr: %08x\n", shdr->sh_addr); - bdbg(" sh_offset: %d\n", shdr->sh_offset); - bdbg(" sh_size: %d\n", shdr->sh_size); - bdbg(" sh_link: %d\n", shdr->sh_link); - bdbg(" sh_info: %d\n", shdr->sh_info); - bdbg(" sh_addralign: %d\n", shdr->sh_addralign); - bdbg(" sh_entsize: %d\n", shdr->sh_entsize); + berr("Sections %d:\n", i); + berr(" sh_name: %08x\n", shdr->sh_name); + berr(" sh_type: %08x\n", shdr->sh_type); + berr(" sh_flags: %08x\n", shdr->sh_flags); + berr(" sh_addr: %08x\n", shdr->sh_addr); + berr(" sh_offset: %d\n", shdr->sh_offset); + berr(" sh_size: %d\n", shdr->sh_size); + berr(" sh_link: %d\n", shdr->sh_link); + berr(" sh_info: %d\n", shdr->sh_info); + berr(" sh_addralign: %d\n", shdr->sh_addralign); + berr(" sh_entsize: %d\n", shdr->sh_entsize); } } } @@ -193,7 +193,7 @@ static void elf_dumpentrypt(FAR struct binary_s *binp, ret = elf_addrenv_select(loadinfo); if (ret < 0) { - bdbg("ERROR: elf_addrenv_select() failed: %d\n", ret); + berr("ERROR: elf_addrenv_select() failed: %d\n", ret); return; } #endif @@ -207,7 +207,7 @@ static void elf_dumpentrypt(FAR struct binary_s *binp, ret = elf_addrenv_restore(loadinfo); if (ret < 0) { - bdbg("ERROR: elf_addrenv_restore() failed: %d\n", ret); + berr("ERROR: elf_addrenv_restore() failed: %d\n", ret); } #endif } @@ -237,7 +237,7 @@ static int elf_loadbinary(FAR struct binary_s *binp) elf_dumploadinfo(&loadinfo); if (ret != 0) { - bdbg("Failed to initialize for load of ELF program: %d\n", ret); + berr("Failed to initialize for load of ELF program: %d\n", ret); goto errout; } @@ -247,7 +247,7 @@ static int elf_loadbinary(FAR struct binary_s *binp) elf_dumploadinfo(&loadinfo); if (ret != 0) { - bdbg("Failed to load ELF program binary: %d\n", ret); + berr("Failed to load ELF program binary: %d\n", ret); goto errout_with_init; } @@ -256,7 +256,7 @@ static int elf_loadbinary(FAR struct binary_s *binp) ret = elf_bind(&loadinfo, binp->exports, binp->nexports); if (ret != 0) { - bdbg("Failed to bind symbols program binary: %d\n", ret); + berr("Failed to bind symbols program binary: %d\n", ret); goto errout_with_load; } @@ -343,7 +343,7 @@ int elf_initialize(void) ret = register_binfmt(&g_elfbinfmt); if (ret != 0) { - bdbg("Failed to register binfmt: %d\n", ret); + berr("Failed to register binfmt: %d\n", ret); } return ret; diff --git a/binfmt/libelf/libelf_addrenv.c b/binfmt/libelf/libelf_addrenv.c index 3c01279b2c..5e358f58e4 100644 --- a/binfmt/libelf/libelf_addrenv.c +++ b/binfmt/libelf/libelf_addrenv.c @@ -101,7 +101,7 @@ int elf_addrenv_alloc(FAR struct elf_loadinfo_s *loadinfo, size_t textsize, ret = up_addrenv_create(textsize, datasize, heapsize, &loadinfo->addrenv); if (ret < 0) { - bdbg("ERROR: up_addrenv_create failed: %d\n", ret); + berr("ERROR: up_addrenv_create failed: %d\n", ret); return ret; } @@ -114,14 +114,14 @@ int elf_addrenv_alloc(FAR struct elf_loadinfo_s *loadinfo, size_t textsize, ret = up_addrenv_vtext(&loadinfo->addrenv, &vtext); if (ret < 0) { - bdbg("ERROR: up_addrenv_vtext failed: %d\n", ret); + berr("ERROR: up_addrenv_vtext failed: %d\n", ret); return ret; } ret = up_addrenv_vdata(&loadinfo->addrenv, textsize, &vdata); if (ret < 0) { - bdbg("ERROR: up_adup_addrenv_vdatadrenv_vtext failed: %d\n", ret); + berr("ERROR: up_adup_addrenv_vdatadrenv_vtext failed: %d\n", ret); return ret; } @@ -170,7 +170,7 @@ void elf_addrenv_free(FAR struct elf_loadinfo_s *loadinfo) ret = up_addrenv_destroy(&loadinfo->addrenv); if (ret < 0) { - bdbg("ERROR: up_addrenv_destroy failed: %d\n", ret); + berr("ERROR: up_addrenv_destroy failed: %d\n", ret); } #else /* If there is an allocation for the ELF image, free it */ diff --git a/binfmt/libelf/libelf_bind.c b/binfmt/libelf/libelf_bind.c index 009e17c7df..5239f0523c 100644 --- a/binfmt/libelf/libelf_bind.c +++ b/binfmt/libelf/libelf_bind.c @@ -103,7 +103,7 @@ static inline int elf_readrel(FAR struct elf_loadinfo_s *loadinfo, if (index < 0 || index > (relsec->sh_size / sizeof(Elf32_Rel))) { - bdbg("Bad relocation symbol index: %d\n", index); + berr("Bad relocation symbol index: %d\n", index); return -EINVAL; } @@ -156,7 +156,7 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx, ret = elf_readrel(loadinfo, relsec, i, &rel); if (ret < 0) { - bdbg("Section %d reloc %d: Failed to read relocation entry: %d\n", + berr("Section %d reloc %d: Failed to read relocation entry: %d\n", relidx, i, ret); return ret; } @@ -172,7 +172,7 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx, ret = elf_readsym(loadinfo, symidx, &sym); if (ret < 0) { - bdbg("Section %d reloc %d: Failed to read symbol[%d]: %d\n", + berr("Section %d reloc %d: Failed to read symbol[%d]: %d\n", relidx, i, symidx, ret); return ret; } @@ -194,13 +194,13 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx, if (ret == -ESRCH) { - bdbg("Section %d reloc %d: Undefined symbol[%d] has no name: %d\n", + berr("Section %d reloc %d: Undefined symbol[%d] has no name: %d\n", relidx, i, symidx, ret); psym = NULL; } else { - bdbg("Section %d reloc %d: Failed to get value of symbol[%d]: %d\n", + berr("Section %d reloc %d: Failed to get value of symbol[%d]: %d\n", relidx, i, symidx, ret); return ret; } @@ -210,7 +210,7 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx, if (rel.r_offset < 0 || rel.r_offset > dstsec->sh_size - sizeof(uint32_t)) { - bdbg("Section %d reloc %d: Relocation address out of range, offset %d size %d\n", + berr("Section %d reloc %d: Relocation address out of range, offset %d size %d\n", relidx, i, rel.r_offset, dstsec->sh_size); return -EINVAL; } @@ -222,7 +222,7 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx, ret = up_relocate(&rel, psym, addr); if (ret < 0) { - bdbg("ERROR: Section %d reloc %d: Relocation failed: %d\n", relidx, i, ret); + berr("ERROR: Section %d reloc %d: Relocation failed: %d\n", relidx, i, ret); return ret; } } @@ -233,7 +233,7 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx, static int elf_relocateadd(FAR struct elf_loadinfo_s *loadinfo, int relidx, FAR const struct symtab_s *exports, int nexports) { - bdbg("Not implemented\n"); + berr("Not implemented\n"); return -ENOSYS; } @@ -278,7 +278,7 @@ int elf_bind(FAR struct elf_loadinfo_s *loadinfo, ret = elf_allocbuffer(loadinfo); if (ret < 0) { - bdbg("elf_allocbuffer failed: %d\n", ret); + berr("elf_allocbuffer failed: %d\n", ret); return -ENOMEM; } @@ -291,7 +291,7 @@ int elf_bind(FAR struct elf_loadinfo_s *loadinfo, ret = elf_addrenv_select(loadinfo); if (ret < 0) { - bdbg("ERROR: elf_addrenv_select() failed: %d\n", ret); + berr("ERROR: elf_addrenv_select() failed: %d\n", ret); return ret; } #endif @@ -352,7 +352,7 @@ int elf_bind(FAR struct elf_loadinfo_s *loadinfo, status = elf_addrenv_restore(loadinfo); if (status < 0) { - bdbg("ERROR: elf_addrenv_restore() failed: %d\n", status); + berr("ERROR: elf_addrenv_restore() failed: %d\n", status); if (ret == OK) { ret = status; diff --git a/binfmt/libelf/libelf_ctors.c b/binfmt/libelf/libelf_ctors.c index 7d7a872027..b957038bc3 100644 --- a/binfmt/libelf/libelf_ctors.c +++ b/binfmt/libelf/libelf_ctors.c @@ -103,7 +103,7 @@ int elf_loadctors(FAR struct elf_loadinfo_s *loadinfo) ret = elf_allocbuffer(loadinfo); if (ret < 0) { - bdbg("elf_allocbuffer failed: %d\n", ret); + berr("elf_allocbuffer failed: %d\n", ret); return -ENOMEM; } @@ -166,7 +166,7 @@ int elf_loadctors(FAR struct elf_loadinfo_s *loadinfo) loadinfo->ctoralloc = (binfmt_ctor_t *)kumm_malloc(ctorsize); if (!loadinfo->ctoralloc) { - bdbg("Failed to allocate memory for .ctors\n"); + berr("Failed to allocate memory for .ctors\n"); return -ENOMEM; } @@ -178,7 +178,7 @@ int elf_loadctors(FAR struct elf_loadinfo_s *loadinfo) shdr->sh_offset); if (ret < 0) { - bdbg("Failed to allocate .ctors: %d\n", ret); + berr("Failed to allocate .ctors: %d\n", ret); return ret; } diff --git a/binfmt/libelf/libelf_dtors.c b/binfmt/libelf/libelf_dtors.c index 75a6264b3c..6d0b0cff1a 100644 --- a/binfmt/libelf/libelf_dtors.c +++ b/binfmt/libelf/libelf_dtors.c @@ -103,7 +103,7 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo) ret = elf_allocbuffer(loadinfo); if (ret < 0) { - bdbg("elf_allocbuffer failed: %d\n", ret); + berr("elf_allocbuffer failed: %d\n", ret); return -ENOMEM; } @@ -166,7 +166,7 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo) loadinfo->ctoralloc = (binfmt_dtor_t *)kumm_malloc(dtorsize); if (!loadinfo->ctoralloc) { - bdbg("Failed to allocate memory for .dtors\n"); + berr("Failed to allocate memory for .dtors\n"); return -ENOMEM; } @@ -178,7 +178,7 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo) shdr->sh_offset); if (ret < 0) { - bdbg("Failed to allocate .dtors: %d\n", ret); + berr("Failed to allocate .dtors: %d\n", ret); return ret; } diff --git a/binfmt/libelf/libelf_init.c b/binfmt/libelf/libelf_init.c index 9efa1e4b2c..7307261df6 100644 --- a/binfmt/libelf/libelf_init.c +++ b/binfmt/libelf/libelf_init.c @@ -102,7 +102,7 @@ static inline int elf_filelen(FAR struct elf_loadinfo_s *loadinfo, if (ret < 0) { int errval = errno; - bdbg("Failed to stat file: %d\n", errval); + berr("Failed to stat file: %d\n", errval); return -errval; } @@ -110,7 +110,7 @@ static inline int elf_filelen(FAR struct elf_loadinfo_s *loadinfo, if (!S_ISREG(buf.st_mode)) { - bdbg("Not a regular file. mode: %d\n", buf.st_mode); + berr("Not a regular file. mode: %d\n", buf.st_mode); return -ENOENT; } @@ -156,7 +156,7 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo) ret = elf_filelen(loadinfo, filename); if (ret < 0) { - bdbg("elf_filelen failed: %d\n", ret); + berr("elf_filelen failed: %d\n", ret); return ret; } @@ -166,7 +166,7 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo) if (loadinfo->filfd < 0) { int errval = errno; - bdbg("Failed to open ELF binary %s: %d\n", filename, errval); + berr("Failed to open ELF binary %s: %d\n", filename, errval); return -errval; } @@ -175,7 +175,7 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo) ret = elf_read(loadinfo, (FAR uint8_t *)&loadinfo->ehdr, sizeof(Elf32_Ehdr), 0); if (ret < 0) { - bdbg("Failed to read ELF header: %d\n", ret); + berr("Failed to read ELF header: %d\n", ret); return ret; } @@ -193,7 +193,7 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo) * is not correctly formed. */ - bdbg("Bad ELF header: %d\n", ret); + berr("Bad ELF header: %d\n", ret); return ret; } diff --git a/binfmt/libelf/libelf_iobuffer.c b/binfmt/libelf/libelf_iobuffer.c index 6e97781a37..29abb492de 100644 --- a/binfmt/libelf/libelf_iobuffer.c +++ b/binfmt/libelf/libelf_iobuffer.c @@ -87,7 +87,7 @@ int elf_allocbuffer(FAR struct elf_loadinfo_s *loadinfo) loadinfo->iobuffer = (FAR uint8_t *)kmm_malloc(CONFIG_ELF_BUFFERSIZE); if (!loadinfo->iobuffer) { - bdbg("Failed to allocate an I/O buffer\n"); + berr("Failed to allocate an I/O buffer\n"); return -ENOMEM; } @@ -123,7 +123,7 @@ int elf_reallocbuffer(FAR struct elf_loadinfo_s *loadinfo, size_t increment) buffer = kmm_realloc((FAR void *)loadinfo->iobuffer, newsize); if (!buffer) { - bdbg("Failed to reallocate the I/O buffer\n"); + berr("Failed to reallocate the I/O buffer\n"); return -ENOMEM; } diff --git a/binfmt/libelf/libelf_load.c b/binfmt/libelf/libelf_load.c index e8f19766ee..5b589323f0 100644 --- a/binfmt/libelf/libelf_load.c +++ b/binfmt/libelf/libelf_load.c @@ -196,7 +196,7 @@ static inline int elf_loadfile(FAR struct elf_loadinfo_s *loadinfo) ret = elf_read(loadinfo, *pptr, shdr->sh_size, shdr->sh_offset); if (ret < 0) { - bdbg("ERROR: Failed to read section %d: %d\n", i, ret); + berr("ERROR: Failed to read section %d: %d\n", i, ret); return ret; } } @@ -258,7 +258,7 @@ int elf_load(FAR struct elf_loadinfo_s *loadinfo) ret = elf_loadshdrs(loadinfo); if (ret < 0) { - bdbg("ERROR: elf_loadshdrs failed: %d\n", ret); + berr("ERROR: elf_loadshdrs failed: %d\n", ret); goto errout_with_buffers; } @@ -286,7 +286,7 @@ int elf_load(FAR struct elf_loadinfo_s *loadinfo) ret = elf_addrenv_alloc(loadinfo, loadinfo->textsize, loadinfo->datasize, heapsize); if (ret < 0) { - bdbg("ERROR: elf_addrenv_alloc() failed: %d\n", ret); + berr("ERROR: elf_addrenv_alloc() failed: %d\n", ret); goto errout_with_buffers; } @@ -299,7 +299,7 @@ int elf_load(FAR struct elf_loadinfo_s *loadinfo) ret = elf_addrenv_select(loadinfo); if (ret < 0) { - bdbg("ERROR: elf_addrenv_select() failed: %d\n", ret); + berr("ERROR: elf_addrenv_select() failed: %d\n", ret); goto errout_with_buffers; } #endif @@ -309,7 +309,7 @@ int elf_load(FAR struct elf_loadinfo_s *loadinfo) ret = elf_loadfile(loadinfo); if (ret < 0) { - bdbg("ERROR: elf_loadfile failed: %d\n", ret); + berr("ERROR: elf_loadfile failed: %d\n", ret); goto errout_with_addrenv; } @@ -319,14 +319,14 @@ int elf_load(FAR struct elf_loadinfo_s *loadinfo) ret = elf_loadctors(loadinfo); if (ret < 0) { - bdbg("ERROR: elf_loadctors failed: %d\n", ret); + berr("ERROR: elf_loadctors failed: %d\n", ret); goto errout_with_addrenv; } ret = elf_loaddtors(loadinfo); if (ret < 0) { - bdbg("ERROR: elf_loaddtors failed: %d\n", ret); + berr("ERROR: elf_loaddtors failed: %d\n", ret); goto errout_with_addrenv; } #endif @@ -349,7 +349,7 @@ int elf_load(FAR struct elf_loadinfo_s *loadinfo) ret = elf_addrenv_restore(loadinfo); if (ret < 0) { - bdbg("ERROR: elf_addrenv_restore() failed: %d\n", ret); + berr("ERROR: elf_addrenv_restore() failed: %d\n", ret); goto errout_with_buffers; } #endif diff --git a/binfmt/libelf/libelf_read.c b/binfmt/libelf/libelf_read.c index d0b801768b..cdadf4444e 100644 --- a/binfmt/libelf/libelf_read.c +++ b/binfmt/libelf/libelf_read.c @@ -127,7 +127,7 @@ int elf_read(FAR struct elf_loadinfo_s *loadinfo, FAR uint8_t *buffer, if (rpos != offset) { int errval = errno; - bdbg("Failed to seek to position %lu: %d\n", + berr("Failed to seek to position %lu: %d\n", (unsigned long)offset, errval); return -errval; } @@ -143,14 +143,14 @@ int elf_read(FAR struct elf_loadinfo_s *loadinfo, FAR uint8_t *buffer, if (errval != EINTR) { - bdbg("Read from offset %lu failed: %d\n", + berr("Read from offset %lu failed: %d\n", (unsigned long)offset, errval); return -errval; } } else if (nbytes == 0) { - bdbg("Unexpected end of file\n"); + berr("Unexpected end of file\n"); return -ENODATA; } else diff --git a/binfmt/libelf/libelf_sections.c b/binfmt/libelf/libelf_sections.c index a34bac2eb8..8f4369d367 100644 --- a/binfmt/libelf/libelf_sections.c +++ b/binfmt/libelf/libelf_sections.c @@ -93,7 +93,7 @@ static inline int elf_sectname(FAR struct elf_loadinfo_s *loadinfo, shstrndx = loadinfo->ehdr.e_shstrndx; if (shstrndx == SHN_UNDEF) { - bdbg("No section header string table\n"); + berr("No section header string table\n"); return -EINVAL; } @@ -126,7 +126,7 @@ static inline int elf_sectname(FAR struct elf_loadinfo_s *loadinfo, { if (loadinfo->filelen <= offset) { - bdbg("At end of file\n"); + berr("At end of file\n"); return -EINVAL; } @@ -139,7 +139,7 @@ static inline int elf_sectname(FAR struct elf_loadinfo_s *loadinfo, ret = elf_read(loadinfo, buffer, readlen, offset); if (ret < 0) { - bdbg("Failed to read section name\n"); + berr("Failed to read section name\n"); return ret; } @@ -159,7 +159,7 @@ static inline int elf_sectname(FAR struct elf_loadinfo_s *loadinfo, ret = elf_reallocbuffer(loadinfo, CONFIG_ELF_BUFFERINCR); if (ret < 0) { - bdbg("elf_reallocbuffer failed: %d\n", ret); + berr("elf_reallocbuffer failed: %d\n", ret); return ret; } } @@ -196,7 +196,7 @@ int elf_loadshdrs(FAR struct elf_loadinfo_s *loadinfo) if (loadinfo->ehdr.e_shnum < 1) { - bdbg("No sections(?)\n"); + berr("No sections(?)\n"); return -EINVAL; } @@ -205,7 +205,7 @@ int elf_loadshdrs(FAR struct elf_loadinfo_s *loadinfo) shdrsize = (size_t)loadinfo->ehdr.e_shentsize * (size_t)loadinfo->ehdr.e_shnum; if (loadinfo->ehdr.e_shoff + shdrsize > loadinfo->filelen) { - bdbg("Insufficent space in file for section header table\n"); + berr("Insufficent space in file for section header table\n"); return -ESPIPE; } @@ -214,7 +214,7 @@ int elf_loadshdrs(FAR struct elf_loadinfo_s *loadinfo) loadinfo->shdr = (FAR FAR Elf32_Shdr *)kmm_malloc(shdrsize); if (!loadinfo->shdr) { - bdbg("Failed to allocate the section header table. Size: %ld\n", + berr("Failed to allocate the section header table. Size: %ld\n", (long)shdrsize); return -ENOMEM; } @@ -225,7 +225,7 @@ int elf_loadshdrs(FAR struct elf_loadinfo_s *loadinfo) loadinfo->ehdr.e_shoff); if (ret < 0) { - bdbg("Failed to read section header table: %d\n", ret); + berr("Failed to read section header table: %d\n", ret); } return ret; @@ -264,7 +264,7 @@ int elf_findsection(FAR struct elf_loadinfo_s *loadinfo, ret = elf_sectname(loadinfo, shdr); if (ret < 0) { - bdbg("elf_sectname failed: %d\n", ret); + berr("elf_sectname failed: %d\n", ret); return ret; } diff --git a/binfmt/libelf/libelf_symbols.c b/binfmt/libelf/libelf_symbols.c index e63531a085..ba67034e54 100644 --- a/binfmt/libelf/libelf_symbols.c +++ b/binfmt/libelf/libelf_symbols.c @@ -97,7 +97,7 @@ static int elf_symname(FAR struct elf_loadinfo_s *loadinfo, if (sym->st_name == 0) { - bdbg("Symbol has no name\n"); + berr("Symbol has no name\n"); return -ESRCH; } @@ -116,7 +116,7 @@ static int elf_symname(FAR struct elf_loadinfo_s *loadinfo, { if (loadinfo->filelen <= offset) { - bdbg("At end of file\n"); + berr("At end of file\n"); return -EINVAL; } @@ -129,7 +129,7 @@ static int elf_symname(FAR struct elf_loadinfo_s *loadinfo, ret = elf_read(loadinfo, buffer, readlen, offset); if (ret < 0) { - bdbg("elf_read failed: %d\n", ret); + berr("elf_read failed: %d\n", ret); return ret; } @@ -149,7 +149,7 @@ static int elf_symname(FAR struct elf_loadinfo_s *loadinfo, ret = elf_reallocbuffer(loadinfo, CONFIG_ELF_BUFFERINCR); if (ret < 0) { - bdbg("elf_reallocbuffer failed: %d\n", ret); + berr("elf_reallocbuffer failed: %d\n", ret); return ret; } } @@ -195,7 +195,7 @@ int elf_findsymtab(FAR struct elf_loadinfo_s *loadinfo) if (loadinfo->symtabidx == 0) { - bdbg("No symbols in ELF file\n"); + berr("No symbols in ELF file\n"); return -EINVAL; } @@ -229,7 +229,7 @@ int elf_readsym(FAR struct elf_loadinfo_s *loadinfo, int index, if (index < 0 || index > (symtab->sh_size / sizeof(Elf32_Sym))) { - bdbg("Bad relocation symbol index: %d\n", index); + berr("Bad relocation symbol index: %d\n", index); return -EINVAL; } @@ -278,7 +278,7 @@ int elf_symvalue(FAR struct elf_loadinfo_s *loadinfo, FAR Elf32_Sym *sym, { /* NuttX ELF modules should be compiled with -fno-common. */ - bdbg("SHN_COMMON: Re-compile with -fno-common\n"); + berr("SHN_COMMON: Re-compile with -fno-common\n"); return -ENOSYS; } @@ -303,7 +303,7 @@ int elf_symvalue(FAR struct elf_loadinfo_s *loadinfo, FAR Elf32_Sym *sym, * indicate the nameless symbol. */ - bdbg("SHN_UNDEF: Failed to get symbol name: %d\n", ret); + berr("SHN_UNDEF: Failed to get symbol name: %d\n", ret); return ret; } @@ -316,7 +316,7 @@ int elf_symvalue(FAR struct elf_loadinfo_s *loadinfo, FAR Elf32_Sym *sym, #endif if (!symbol) { - bdbg("SHN_UNDEF: Exported symbol \"%s\" not found\n", loadinfo->iobuffer); + berr("SHN_UNDEF: Exported symbol \"%s\" not found\n", loadinfo->iobuffer); return -ENOENT; } diff --git a/binfmt/libelf/libelf_verify.c b/binfmt/libelf/libelf_verify.c index 4e79991433..26cb51ae7c 100644 --- a/binfmt/libelf/libelf_verify.c +++ b/binfmt/libelf/libelf_verify.c @@ -87,7 +87,7 @@ int elf_verifyheader(FAR const Elf32_Ehdr *ehdr) { if (!ehdr) { - bdbg("NULL ELF header!"); + berr("NULL ELF header!"); return -ENOEXEC; } @@ -104,7 +104,7 @@ int elf_verifyheader(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_type != ET_REL) { - bdbg("Not a relocatable file: e_type=%d\n", ehdr->e_type); + berr("Not a relocatable file: e_type=%d\n", ehdr->e_type); return -EINVAL; } @@ -112,7 +112,7 @@ int elf_verifyheader(FAR const Elf32_Ehdr *ehdr) if (up_checkarch(ehdr)) { - bdbg("Not a supported architecture\n"); + berr("Not a supported architecture\n"); return -ENOEXEC; } diff --git a/binfmt/libnxflat/libnxflat_addrenv.c b/binfmt/libnxflat/libnxflat_addrenv.c index 92840dc02d..9ca8add7cc 100644 --- a/binfmt/libnxflat/libnxflat_addrenv.c +++ b/binfmt/libnxflat/libnxflat_addrenv.c @@ -103,7 +103,7 @@ int nxflat_addrenv_alloc(FAR struct nxflat_loadinfo_s *loadinfo, size_t envsize) dspace = (FAR struct dspace_s *)kmm_malloc(sizeof(struct dspace_s)); if (dspace == 0) { - bdbg("ERROR: Failed to allocate DSpace\n"); + berr("ERROR: Failed to allocate DSpace\n"); return -ENOMEM; } @@ -124,7 +124,7 @@ int nxflat_addrenv_alloc(FAR struct nxflat_loadinfo_s *loadinfo, size_t envsize) ret = up_addrenv_create(0, envsize, heapsize, &loadinfo->addrenv); if (ret < 0) { - bdbg("ERROR: up_addrenv_create failed: %d\n", ret); + berr("ERROR: up_addrenv_create failed: %d\n", ret); goto errout_with_dspace; } @@ -137,7 +137,7 @@ int nxflat_addrenv_alloc(FAR struct nxflat_loadinfo_s *loadinfo, size_t envsize) ret = up_addrenv_vdata(&loadinfo->addrenv, 0, &vdata); if (ret < 0) { - bdbg("ERROR: up_addrenv_vdata failed: %d\n", ret); + berr("ERROR: up_addrenv_vdata failed: %d\n", ret); goto errout_with_addrenv; } @@ -148,7 +148,7 @@ int nxflat_addrenv_alloc(FAR struct nxflat_loadinfo_s *loadinfo, size_t envsize) ret = up_addrenv_select(loadinfo->addrenv, &oldenv); if (ret < 0) { - bdbg("ERROR: up_addrenv_select failed: %d\n", ret); + berr("ERROR: up_addrenv_select failed: %d\n", ret); goto errout_with_addrenv; } @@ -157,7 +157,7 @@ int nxflat_addrenv_alloc(FAR struct nxflat_loadinfo_s *loadinfo, size_t envsize) ret = up_addrenv_restore(oldenv); if (ret < 0) { - bdbg("ERROR: up_addrenv_restore failed: %d\n", ret); + berr("ERROR: up_addrenv_restore failed: %d\n", ret); goto errout_with_addrenv; } @@ -227,7 +227,7 @@ void nxflat_addrenv_free(FAR struct nxflat_loadinfo_s *loadinfo) ret = up_addrenv_destroy(loadinfo->addrenv); if (ret < 0) { - bdbg("ERROR: up_addrenv_destroy failed: %d\n", ret); + berr("ERROR: up_addrenv_destroy failed: %d\n", ret); } loadinfo->addrenv = 0; diff --git a/binfmt/libnxflat/libnxflat_bind.c b/binfmt/libnxflat/libnxflat_bind.c index 4239517153..71c3b8d57d 100644 --- a/binfmt/libnxflat/libnxflat_bind.c +++ b/binfmt/libnxflat/libnxflat_bind.c @@ -117,7 +117,7 @@ static inline int nxflat_bindrel32i(FAR struct nxflat_loadinfo_s *loadinfo, } else { - bdbg("Offset: %08 does not lie in D-Space size: %08x\n", + berr("Offset: %08 does not lie in D-Space size: %08x\n", offset, loadinfo->dsize); return -EINVAL; } @@ -156,7 +156,7 @@ static inline int nxflat_bindrel32d(FAR struct nxflat_loadinfo_s *loadinfo, } else { - bdbg("Offset: %08 does not lie in D-Space size: %08x\n", + berr("Offset: %08 does not lie in D-Space size: %08x\n", offset, loadinfo->dsize); return -EINVAL; } @@ -198,7 +198,7 @@ static inline int nxflat_bindrel32id(FAR struct nxflat_loadinfo_s *loadinfo, } else { - bdbg("Offset: %08 does not lie in D-Space size: %08x\n", + berr("Offset: %08 does not lie in D-Space size: %08x\n", offset, loadinfo->dsize); return -EINVAL; } @@ -265,7 +265,7 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo) ret = nxflat_addrenv_select(loadinfo); if (ret < 0) { - bdbg("ERROR: nxflat_addrenv_select() failed: %d\n", ret); + berr("ERROR: nxflat_addrenv_select() failed: %d\n", ret); return ret; } #endif @@ -329,7 +329,7 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo) default: { - bdbg("ERROR: Unrecognized relocation type: %d\n", NXFLAT_RELOC_TYPE(reloc.r_info)); + berr("ERROR: Unrecognized relocation type: %d\n", NXFLAT_RELOC_TYPE(reloc.r_info)); result = -EINVAL; } break; @@ -359,7 +359,7 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo) ret = nxflat_addrenv_restore(loadinfo); if (ret < 0) { - bdbg("ERROR: nxflat_addrenv_restore() failed: %d\n", ret); + berr("ERROR: nxflat_addrenv_restore() failed: %d\n", ret); } #endif @@ -418,7 +418,7 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo, ret = nxflat_addrenv_select(loadinfo); if (ret < 0) { - bdbg("ERROR: nxflat_addrenv_select() failed: %d\n", ret); + berr("ERROR: nxflat_addrenv_select() failed: %d\n", ret); return ret; } #endif @@ -473,7 +473,7 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo, #endif if (!symbol) { - bdbg("Exported symbol \"%s\" not found\n", symname); + berr("Exported symbol \"%s\" not found\n", symname); #ifdef CONFIG_ARCH_ADDRENV (void)nxflat_addrenv_restore(loadinfo); #endif @@ -504,7 +504,7 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo, ret = nxflat_addrenv_restore(loadinfo); if (ret < 0) { - bdbg("ERROR: nxflat_addrenv_restore() failed: %d\n", ret); + berr("ERROR: nxflat_addrenv_restore() failed: %d\n", ret); } return ret; @@ -542,7 +542,7 @@ static inline int nxflat_clearbss(FAR struct nxflat_loadinfo_s *loadinfo) ret = nxflat_addrenv_select(loadinfo); if (ret < 0) { - bdbg("ERROR: nxflat_addrenv_select() failed: %d\n", ret); + berr("ERROR: nxflat_addrenv_select() failed: %d\n", ret); return ret; } #endif @@ -558,7 +558,7 @@ static inline int nxflat_clearbss(FAR struct nxflat_loadinfo_s *loadinfo) ret = nxflat_addrenv_restore(loadinfo); if (ret < 0) { - bdbg("ERROR: nxflat_addrenv_restore() failed: %d\n", ret); + berr("ERROR: nxflat_addrenv_restore() failed: %d\n", ret); } return ret; diff --git a/binfmt/libnxflat/libnxflat_init.c b/binfmt/libnxflat/libnxflat_init.c index 826614f2d9..eff6cd8b29 100644 --- a/binfmt/libnxflat/libnxflat_init.c +++ b/binfmt/libnxflat/libnxflat_init.c @@ -112,7 +112,7 @@ int nxflat_init(const char *filename, struct nxflat_loadinfo_s *loadinfo) if (loadinfo->filfd < 0) { int errval = errno; - bdbg("Failed to open NXFLAT binary %s: %d\n", filename, errval); + berr("Failed to open NXFLAT binary %s: %d\n", filename, errval); return -errval; } @@ -122,7 +122,7 @@ int nxflat_init(const char *filename, struct nxflat_loadinfo_s *loadinfo) sizeof(struct nxflat_hdr_s), 0); if (ret < 0) { - bdbg("Failed to read NXFLAT header: %d\n", ret); + berr("Failed to read NXFLAT header: %d\n", ret); return ret; } @@ -140,7 +140,7 @@ int nxflat_init(const char *filename, struct nxflat_loadinfo_s *loadinfo) * done so. */ - bdbg("Bad NXFLAT header\n"); + berr("Bad NXFLAT header\n"); return -ENOEXEC; } diff --git a/binfmt/libnxflat/libnxflat_load.c b/binfmt/libnxflat/libnxflat_load.c index 8e5dea7062..c849daf7de 100644 --- a/binfmt/libnxflat/libnxflat_load.c +++ b/binfmt/libnxflat/libnxflat_load.c @@ -150,7 +150,7 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo) MAP_SHARED | MAP_FILE, loadinfo->filfd, 0); if (loadinfo->ispace == (uint32_t)MAP_FAILED) { - bdbg("Failed to map NXFLAT ISpace: %d\n", errno); + berr("Failed to map NXFLAT ISpace: %d\n", errno); return -errno; } @@ -163,7 +163,7 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo) ret = nxflat_addrenv_alloc(loadinfo, loadinfo->dsize); if (ret < 0) { - bdbg("ERROR: nxflat_addrenv_alloc() failed: %d\n", ret); + berr("ERROR: nxflat_addrenv_alloc() failed: %d\n", ret); return ret; } @@ -180,7 +180,7 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo) ret = nxflat_addrenv_select(loadinfo); if (ret < 0) { - bdbg("ERROR: nxflat_addrenv_select() failed: %d\n", ret); + berr("ERROR: nxflat_addrenv_select() failed: %d\n", ret); return ret; } #endif @@ -193,7 +193,7 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo) dreadsize, doffset); if (ret < 0) { - bdbg("Failed to read .data section: %d\n", ret); + berr("Failed to read .data section: %d\n", ret); goto errout; } @@ -206,7 +206,7 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo) ret = nxflat_addrenv_restore(loadinfo); if (ret < 0) { - bdbg("ERROR: nxflat_addrenv_restore() failed: %d\n", ret); + berr("ERROR: nxflat_addrenv_restore() failed: %d\n", ret); return ret; } #endif diff --git a/binfmt/libnxflat/libnxflat_read.c b/binfmt/libnxflat/libnxflat_read.c index bb3d4b5b16..678dd6d671 100644 --- a/binfmt/libnxflat/libnxflat_read.c +++ b/binfmt/libnxflat/libnxflat_read.c @@ -129,7 +129,7 @@ int nxflat_read(struct nxflat_loadinfo_s *loadinfo, char *buffer, int readsize, if (rpos != offset) { int errval = errno; - bdbg("Failed to seek to position %d: %d\n", offset, errval); + berr("Failed to seek to position %d: %d\n", offset, errval); return -errval; } @@ -141,13 +141,13 @@ int nxflat_read(struct nxflat_loadinfo_s *loadinfo, char *buffer, int readsize, int errval = errno; if (errval != EINTR) { - bdbg("Read from offset %d failed: %d\n", offset, errval); + berr("Read from offset %d failed: %d\n", offset, errval); return -errval; } } else if (nbytes == 0) { - bdbg("Unexpected end of file\n"); + berr("Unexpected end of file\n"); return -ENODATA; } else diff --git a/binfmt/libnxflat/libnxflat_verify.c b/binfmt/libnxflat/libnxflat_verify.c index e645fdf925..76d8354edf 100644 --- a/binfmt/libnxflat/libnxflat_verify.c +++ b/binfmt/libnxflat/libnxflat_verify.c @@ -79,7 +79,7 @@ int nxflat_verifyheader(const struct nxflat_hdr_s *header) { if (!header) { - bdbg("NULL NXFLAT header!"); + berr("NULL NXFLAT header!"); return -ENOEXEC; } @@ -91,7 +91,7 @@ int nxflat_verifyheader(const struct nxflat_hdr_s *header) if (strncmp(header->h_magic, NXFLAT_MAGIC, 4) != 0) { - bdbg("Unrecognized magic=\"%c%c%c%c\"\n", + berr("Unrecognized magic=\"%c%c%c%c\"\n", header->h_magic[0], header->h_magic[1], header->h_magic[2], header->h_magic[3]); return -ENOEXEC; diff --git a/binfmt/nxflat.c b/binfmt/nxflat.c index 1e2eddf3a2..c2f1c06f78 100644 --- a/binfmt/nxflat.c +++ b/binfmt/nxflat.c @@ -107,31 +107,31 @@ static void nxflat_dumploadinfo(struct nxflat_loadinfo_s *loadinfo) { unsigned long dsize = loadinfo->datasize + loadinfo->bsssize; - bdbg("LOAD_INFO:\n"); - bdbg(" ISPACE:\n"); - bdbg(" ispace: %08lx\n", loadinfo->ispace); - bdbg(" entryoffs: %08lx\n", loadinfo->entryoffs); - bdbg(" isize: %08lx\n", loadinfo->isize); - - bdbg(" DSPACE:\n"); - bdbg(" dspace: %08lx\n", loadinfo->dspace); + berr("LOAD_INFO:\n"); + berr(" ISPACE:\n"); + berr(" ispace: %08lx\n", loadinfo->ispace); + berr(" entryoffs: %08lx\n", loadinfo->entryoffs); + berr(" isize: %08lx\n", loadinfo->isize); + + berr(" DSPACE:\n"); + berr(" dspace: %08lx\n", loadinfo->dspace); if (loadinfo->dspace != NULL) { - bdbg(" crefs: %d\n", loadinfo->dspace->crefs); - bdbg(" region: %08lx\n", loadinfo->dspace->region); + berr(" crefs: %d\n", loadinfo->dspace->crefs); + berr(" region: %08lx\n", loadinfo->dspace->region); } - bdbg(" datasize: %08lx\n", loadinfo->datasize); - bdbg(" bsssize: %08lx\n", loadinfo->bsssize); - bdbg(" (pad): %08lx\n", loadinfo->dsize - dsize); - bdbg(" stacksize: %08lx\n", loadinfo->stacksize); - bdbg(" dsize: %08lx\n", loadinfo->dsize); - - bdbg(" RELOCS:\n"); - bdbg(" relocstart: %08lx\n", loadinfo->relocstart); - bdbg(" reloccount: %d\n", loadinfo->reloccount); - - bdbg(" HANDLES:\n"); - bdbg(" filfd: %d\n", loadinfo->filfd); + berr(" datasize: %08lx\n", loadinfo->datasize); + berr(" bsssize: %08lx\n", loadinfo->bsssize); + berr(" (pad): %08lx\n", loadinfo->dsize - dsize); + berr(" stacksize: %08lx\n", loadinfo->stacksize); + berr(" dsize: %08lx\n", loadinfo->dsize); + + berr(" RELOCS:\n"); + berr(" relocstart: %08lx\n", loadinfo->relocstart); + berr(" reloccount: %d\n", loadinfo->reloccount); + + berr(" HANDLES:\n"); + berr(" filfd: %d\n", loadinfo->filfd); } #else # define nxflat_dumploadinfo(i) @@ -159,7 +159,7 @@ static int nxflat_loadbinary(struct binary_s *binp) nxflat_dumploadinfo(&loadinfo); if (ret != 0) { - bdbg("Failed to initialize for load of NXFLAT program: %d\n", ret); + berr("Failed to initialize for load of NXFLAT program: %d\n", ret); goto errout; } @@ -169,7 +169,7 @@ static int nxflat_loadbinary(struct binary_s *binp) nxflat_dumploadinfo(&loadinfo); if (ret != 0) { - bdbg("Failed to load NXFLAT program binary: %d\n", ret); + berr("Failed to load NXFLAT program binary: %d\n", ret); goto errout_with_init; } @@ -178,7 +178,7 @@ static int nxflat_loadbinary(struct binary_s *binp) ret = nxflat_bind(&loadinfo, binp->exports, binp->nexports); if (ret != 0) { - bdbg("Failed to bind symbols program binary: %d\n", ret); + berr("Failed to bind symbols program binary: %d\n", ret); goto errout_with_load; } @@ -256,7 +256,7 @@ int nxflat_initialize(void) ret = register_binfmt(&g_nxflatbinfmt); if (ret != 0) { - bdbg("Failed to register binfmt: %d\n", ret); + berr("Failed to register binfmt: %d\n", ret); } return ret; } diff --git a/binfmt/pcode.c b/binfmt/pcode.c index 74b42e4ca5..3913d38ed5 100644 --- a/binfmt/pcode.c +++ b/binfmt/pcode.c @@ -174,7 +174,7 @@ static int pcode_mount_testfs(void) NSECTORS(ROMFS_IMG_LEN), SECTORSIZE); if (ret < 0) { - bdbg("ERROR: romdisk_register failed: %d\n", ret); + berr("ERROR: romdisk_register failed: %d\n", ret); return ret; } @@ -190,7 +190,7 @@ static int pcode_mount_testfs(void) int errval = get_errno(); DEBUGASSERT(errval > 0); - bdbg("ERROR: mount(%s,%s,romfs) failed: %d\n", + berr("ERROR: mount(%s,%s,romfs) failed: %d\n", CONFIG_PCODE_TEST_DEVPATH, CONFIG_PCODE_TEST_MOUNTPOINT, errval); return -errval; } @@ -266,7 +266,7 @@ static int pcode_proxy(int argc, char **argv) ret = on_exit(pcode_onexit, binp); if (ret < 0) { - bdbg("ERROR: on_exit failed: %d\n", get_errno()); + berr("ERROR: on_exit failed: %d\n", get_errno()); kmm_free(fullpath); return EXIT_FAILURE; } @@ -283,7 +283,7 @@ static int pcode_proxy(int argc, char **argv) if (ret < 0) { - bdbg("ERROR: Execution failed\n"); + berr("ERROR: Execution failed\n"); return EXIT_FAILURE; } @@ -318,7 +318,7 @@ static int pcode_load(struct binary_s *binp) if (fd < 0) { int errval = get_errno(); - bdbg("ERROR: Failed to open binary %s: %d\n", binp->filename, errval); + berr("ERROR: Failed to open binary %s: %d\n", binp->filename, errval); return -errval; } @@ -341,12 +341,12 @@ static int pcode_load(struct binary_s *binp) if (errval != EINTR) { - bdbg("ERROR: read failed: %d\n", errval); + berr("ERROR: read failed: %d\n", errval); ret = -errval; goto errout_with_fd; } - bdbg("Interrupted by a signal\n"); + berr("Interrupted by a signal\n"); } else { @@ -366,7 +366,7 @@ static int pcode_load(struct binary_s *binp) if (memcmp(&hdr.fh_ident, FHI_POFF_MAG, 4) != 0 || hdr.fh_type != FHT_EXEC) { - dbg("ERROR: File is not a P-code executable: %d\n"); + err("ERROR: File is not a P-code executable: %d\n"); ret = -ENOEXEC; goto errout_with_fd; } @@ -399,7 +399,7 @@ static int pcode_load(struct binary_s *binp) g_pcode_handoff.fullpath = strdup(binp->filename); if (!g_pcode_handoff.fullpath) { - bdbg("ERROR: Failed to duplicate the full path: %d\n", + berr("ERROR: Failed to duplicate the full path: %d\n", binp->filename); sem_post(&g_pcode_handoff.exclsem); @@ -473,7 +473,7 @@ int pcode_initialize(void) ret = pcode_mount_testfs(); if (ret < 0) { - bdbg("ERROR: Failed to mount test file system: %d\n", ret); + berr("ERROR: Failed to mount test file system: %d\n", ret); return ret; } @@ -484,7 +484,7 @@ int pcode_initialize(void) ret = register_binfmt(&g_pcode_binfmt); if (ret != 0) { - bdbg("Failed to register binfmt: %d\n", ret); + berr("Failed to register binfmt: %d\n", ret); } return ret; @@ -513,7 +513,7 @@ void pcode_uninitialize(void) int errval = get_errno(); DEBUGASSERT(errval > 0); - bdbg("ERROR: unregister_binfmt() failed: %d\n", errval); + berr("ERROR: unregister_binfmt() failed: %d\n", errval); UNUSED(errval); } @@ -524,7 +524,7 @@ void pcode_uninitialize(void) int errval = get_errno(); DEBUGASSERT(errval > 0); - bdbg("ERROR: umount(%s) failed: %d\n", CONFIG_PCODE_TEST_MOUNTPOINT, errval); + berr("ERROR: umount(%s) failed: %d\n", CONFIG_PCODE_TEST_MOUNTPOINT, errval); UNUSED(errval); } #endif diff --git a/configs/arduino-due/src/sam_autoleds.c b/configs/arduino-due/src/sam_autoleds.c index f407e86cdd..8fb0ea7104 100644 --- a/configs/arduino-due/src/sam_autoleds.c +++ b/configs/arduino-due/src/sam_autoleds.c @@ -100,10 +100,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/arduino-due/src/sam_mmcsd.c b/configs/arduino-due/src/sam_mmcsd.c index c0437411a9..3edad36db0 100644 --- a/configs/arduino-due/src/sam_mmcsd.c +++ b/configs/arduino-due/src/sam_mmcsd.c @@ -259,7 +259,7 @@ int sam_sdinitialize(int minor) spi = sam_mmcsd_spiinitialize(); if (!spi) { - fdbg("Failed to bit bang SPI for the MMC/SD slot\n"); + ferr("Failed to bit bang SPI for the MMC/SD slot\n"); return -ENODEV; } @@ -273,7 +273,7 @@ int sam_sdinitialize(int minor) ret = mmcsd_spislotinitialize(minor, SAM34_MMCSDSLOTNO, spi); if (ret < 0) { - fdbg("Failed to bind bit bang SPI device to MMC/SD slot %d: %d\n", + ferr("Failed to bind bit bang SPI device to MMC/SD slot %d: %d\n", SAM34_MMCSDSLOTNO, ret); return ret; } diff --git a/configs/arduino-due/src/sam_touchscreen.c b/configs/arduino-due/src/sam_touchscreen.c index 13ea83febe..6f105ff2bf 100644 --- a/configs/arduino-due/src/sam_touchscreen.c +++ b/configs/arduino-due/src/sam_touchscreen.c @@ -359,7 +359,7 @@ int board_tsc_setup(int minor) static bool initialized = false; int ret; - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(minor == 0); /* Have we already initialized? Since we never uninitialize we must prevent @@ -383,7 +383,7 @@ int board_tsc_setup(int minor) dev = sam_tsc_spiinitialize(); if (!dev) { - idbg("Failed to initialize bit bang SPI\n"); + ierr("Failed to initialize bit bang SPI\n"); return -ENODEV; } @@ -392,7 +392,7 @@ int board_tsc_setup(int minor) ret = ads7843e_register(dev, &g_tscinfo, CONFIG_ADS7843E_DEVMINOR); if (ret < 0) { - idbg("Failed to register touchscreen device\n"); + ierr("Failed to register touchscreen device\n"); /* up_spiuninitialize(dev); */ return -ENODEV; } diff --git a/configs/arduino-due/src/sam_userleds.c b/configs/arduino-due/src/sam_userleds.c index e41418bf7b..f13ddd40cc 100644 --- a/configs/arduino-due/src/sam_userleds.c +++ b/configs/arduino-due/src/sam_userleds.c @@ -60,10 +60,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/cc3200-launchpad/src/cc3200_autoleds.c b/configs/cc3200-launchpad/src/cc3200_autoleds.c index 6853edc88c..e515b4536a 100644 --- a/configs/cc3200-launchpad/src/cc3200_autoleds.c +++ b/configs/cc3200-launchpad/src/cc3200_autoleds.c @@ -92,10 +92,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/cloudctrl/src/stm32_adc.c b/configs/cloudctrl/src/stm32_adc.c index 9774efba20..ba10061c0b 100644 --- a/configs/cloudctrl/src/stm32_adc.c +++ b/configs/cloudctrl/src/stm32_adc.c @@ -146,7 +146,7 @@ int board_adc_setup(void) adc = stm32_adcinitialize(1, g_chanlist, ADC1_NCHANNELS); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -155,7 +155,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/cloudctrl/src/stm32_autoleds.c b/configs/cloudctrl/src/stm32_autoleds.c index 11de1e7f21..c0a82e6fbd 100644 --- a/configs/cloudctrl/src/stm32_autoleds.c +++ b/configs/cloudctrl/src/stm32_autoleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/cloudctrl/src/stm32_spi.c b/configs/cloudctrl/src/stm32_spi.c index cae199dd0e..5bcfe53763 100644 --- a/configs/cloudctrl/src/stm32_spi.c +++ b/configs/cloudctrl/src/stm32_spi.c @@ -65,14 +65,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -141,7 +141,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); /* SPI1 connects to the SD CARD and to the SPI FLASH */ @@ -163,7 +163,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } diff --git a/configs/cloudctrl/src/stm32_usb.c b/configs/cloudctrl/src/stm32_usb.c index e711536e91..44b6fd02c6 100644 --- a/configs/cloudctrl/src/stm32_usb.c +++ b/configs/cloudctrl/src/stm32_usb.c @@ -185,7 +185,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the mass storage class\n"); + uerr("ERROR: Failed to register the mass storage class\n"); } #endif @@ -195,7 +195,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class\n"); + uerr("ERROR: Failed to register the CDC/ACM serial class\n"); } #endif diff --git a/configs/cloudctrl/src/stm32_userleds.c b/configs/cloudctrl/src/stm32_userleds.c index 4f48929edf..006a62bd45 100644 --- a/configs/cloudctrl/src/stm32_userleds.c +++ b/configs/cloudctrl/src/stm32_userleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/cloudctrl/src/stm32_w25.c b/configs/cloudctrl/src/stm32_w25.c index da059d35b9..df43ab8045 100644 --- a/configs/cloudctrl/src/stm32_w25.c +++ b/configs/cloudctrl/src/stm32_w25.c @@ -107,7 +107,7 @@ int stm32_w25initialize(int minor) spi = stm32_spibus_initialize(1); if (!spi) { - fdbg("ERROR: Failed to initialize SPI port 2\n"); + ferr("ERROR: Failed to initialize SPI port 2\n"); return -ENODEV; } @@ -116,7 +116,7 @@ int stm32_w25initialize(int minor) mtd = w25_initialize(spi); if (!mtd) { - fdbg("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n"); + ferr("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n"); return -ENODEV; } @@ -126,7 +126,7 @@ int stm32_w25initialize(int minor) ret = ftl_initialize(minor, mtd); if (ret < 0) { - fdbg("ERROR: Initialize the FTL layer\n"); + ferr("ERROR: Initialize the FTL layer\n"); return ret; } #else @@ -135,7 +135,7 @@ int stm32_w25initialize(int minor) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", -ret); + ferr("ERROR: NXFFS initialization failed: %d\n", -ret); return ret; } @@ -145,7 +145,7 @@ int stm32_w25initialize(int minor) ret = mount(NULL, devname, "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif diff --git a/configs/compal_e99/src/ssd1783.c b/configs/compal_e99/src/ssd1783.c index b858fef0c2..66831938b4 100644 --- a/configs/compal_e99/src/ssd1783.c +++ b/configs/compal_e99/src/ssd1783.c @@ -78,9 +78,9 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) info(format, ##__VA_ARGS__) +# define lcderr(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) #endif /** This should be put elsewhere */ @@ -250,7 +250,7 @@ static void lcd_write_prepare(unsigned int x1, unsigned int x2, unsigned int y1, { CMD, 0x5c }, /* enter write display ram mode */ { END, 0x00 } }; - dbg("x1:%d, x2:%d, y1:%d, y2:%d\n",x1, x2,y1, y2); + err("x1:%d, x2:%d, y1:%d, y2:%d\n",x1, x2,y1, y2); fb_ssd1783_send_cmdlist(prepare_disp_write_cmds); } diff --git a/configs/demo9s12ne64/src/m9s12_leds.c b/configs/demo9s12ne64/src/m9s12_leds.c index 167a365bb7..8d11ce1e0e 100644 --- a/configs/demo9s12ne64/src/m9s12_leds.c +++ b/configs/demo9s12ne64/src/m9s12_leds.c @@ -55,10 +55,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/demo9s12ne64/src/m9s12_spi.c b/configs/demo9s12ne64/src/m9s12_spi.c index 7348e30f14..312aebffc7 100644 --- a/configs/demo9s12ne64/src/m9s12_spi.c +++ b/configs/demo9s12ne64/src/m9s12_spi.c @@ -60,7 +60,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -68,7 +68,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/dk-tm4c129x/src/tm4c_bringup.c b/configs/dk-tm4c129x/src/tm4c_bringup.c index 72fcac0292..b6ddd0be28 100644 --- a/configs/dk-tm4c129x/src/tm4c_bringup.c +++ b/configs/dk-tm4c129x/src/tm4c_bringup.c @@ -86,14 +86,14 @@ static void tm4c_i2c_register(int bus) i2c = tiva_i2cbus_initialize(bus); if (i2c == NULL) { - dbg("ERROR: Failed to get I2C%d interface\n", bus); + err("ERROR: Failed to get I2C%d interface\n", bus); } else { ret = i2c_register(i2c, bus); if (ret < 0) { - dbg("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); tiva_i2cbus_uninitialize(i2c); } } @@ -174,7 +174,7 @@ int tm4c_bringup(void) ret = tiva_tmp100_initialize(TMP100_DEVNAME); if (ret < 0) { - dbg("ERROR: Failed to initialize TMP100 driver: %d\n", ret); + err("ERROR: Failed to initialize TMP100 driver: %d\n", ret); } #endif @@ -184,7 +184,7 @@ int tm4c_bringup(void) ret = tiva_timer_configure(); if (ret < 0) { - dbg("ERROR: Failed to initialize timer driver: %d\n", ret); + err("ERROR: Failed to initialize timer driver: %d\n", ret); } #endif diff --git a/configs/dk-tm4c129x/src/tm4c_ssi.c b/configs/dk-tm4c129x/src/tm4c_ssi.c index 8164b61e20..5eae9d3c87 100644 --- a/configs/dk-tm4c129x/src/tm4c_ssi.c +++ b/configs/dk-tm4c129x/src/tm4c_ssi.c @@ -62,9 +62,9 @@ /* CONFIG_DEBUG_SPI enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ #ifdef CONFIG_DEBUG_SPI -# define ssidbg llerr +# define ssierr llerr #else -# define ssidbg(x...) +# define ssierr(x...) #endif /* Dump GPIO registers */ @@ -118,14 +118,14 @@ void weak_function tm4c_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); ssi_dumpgpio("tiva_ssiselect() Exit"); } uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssidbg("Returning SPI_STATUS_PRESENT\n"); + ssierr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/dk-tm4c129x/src/tm4c_timer.c b/configs/dk-tm4c129x/src/tm4c_timer.c index 2249293279..1690fd0ba6 100644 --- a/configs/dk-tm4c129x/src/tm4c_timer.c +++ b/configs/dk-tm4c129x/src/tm4c_timer.c @@ -107,7 +107,7 @@ int tiva_timer_configure(void) ret = tiva_timer_register(CONFIG_DK_TM4C129X_TIMER_DEVNAME, GPTM, ALTCLK); if (ret < 0) { - timdbg("ERROR: Failed to register timer driver: %d\n", ret); + timerr("ERROR: Failed to register timer driver: %d\n", ret); } return ret; diff --git a/configs/dk-tm4c129x/src/tm4c_userleds.c b/configs/dk-tm4c129x/src/tm4c_userleds.c index f1d0cc8f59..9ac0b86d8b 100644 --- a/configs/dk-tm4c129x/src/tm4c_userleds.c +++ b/configs/dk-tm4c129x/src/tm4c_userleds.c @@ -71,10 +71,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/ea3131/src/lpc31_leds.c b/configs/ea3131/src/lpc31_leds.c index 82a1c34a61..dcff8610b5 100644 --- a/configs/ea3131/src/lpc31_leds.c +++ b/configs/ea3131/src/lpc31_leds.c @@ -60,10 +60,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/ea3131/src/lpc31_spi.c b/configs/ea3131/src/lpc31_spi.c index c66f53b9ff..e71c7fd974 100644 --- a/configs/ea3131/src/lpc31_spi.c +++ b/configs/ea3131/src/lpc31_spi.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -127,7 +127,7 @@ void weak_function lpc31_spidev_intialize(void) void lpc31_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } diff --git a/configs/ea3131/src/lpc31_usbhost.c b/configs/ea3131/src/lpc31_usbhost.c index 9ab9dd7ffa..a1b86a759f 100644 --- a/configs/ea3131/src/lpc31_usbhost.c +++ b/configs/ea3131/src/lpc31_usbhost.c @@ -206,7 +206,7 @@ int lpc31_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class\n"); + uerr("ERROR: Failed to register the CDC/ACM serial class\n"); } #endif @@ -216,7 +216,7 @@ int lpc31_usbhost_initialize(void) ret = usbhost_kbdinit(); if (ret != OK) { - udbg("ERROR: Failed to register the KBD class\n"); + uerr("ERROR: Failed to register the KBD class\n"); } #endif @@ -225,7 +225,7 @@ int lpc31_usbhost_initialize(void) g_ehciconn = lpc31_ehci_initialize(0); if (!g_ehciconn) { - udbg("ERROR: lpc31_ehci_initialize failed\n"); + uerr("ERROR: lpc31_ehci_initialize failed\n"); return -ENODEV; } @@ -235,7 +235,7 @@ int lpc31_usbhost_initialize(void) (main_t)ehci_waiter, (FAR char * const *)NULL); if (pid < 0) { - udbg("ERROR: Failed to create ehci_waiter task: %d\n", ret); + uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret); return -ENODEV; } diff --git a/configs/ea3152/src/lpc31_leds.c b/configs/ea3152/src/lpc31_leds.c index 986c77af5e..ad0c91bf04 100644 --- a/configs/ea3152/src/lpc31_leds.c +++ b/configs/ea3152/src/lpc31_leds.c @@ -60,10 +60,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/ea3152/src/lpc31_spi.c b/configs/ea3152/src/lpc31_spi.c index 1436e65748..8ecd50e111 100644 --- a/configs/ea3152/src/lpc31_spi.c +++ b/configs/ea3152/src/lpc31_spi.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -127,7 +127,7 @@ void weak_function lpc31_spidev_intialize(void) void lpc31_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } diff --git a/configs/eagle100/src/lm_leds.c b/configs/eagle100/src/lm_leds.c index 03f0b3e510..91cabe6afa 100644 --- a/configs/eagle100/src/lm_leds.c +++ b/configs/eagle100/src/lm_leds.c @@ -60,10 +60,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif @@ -100,7 +100,7 @@ static uint8_t g_nest; #ifdef CONFIG_ARCH_LEDS void board_autoled_initialize(void) { - leddbg("Initializing\n"); + lederr("Initializing\n"); /* Configure Port E, Bit 1 as an output, initial value=OFF */ diff --git a/configs/eagle100/src/lm_ssi.c b/configs/eagle100/src/lm_ssi.c index f106382d05..f0a1fbb28f 100644 --- a/configs/eagle100/src/lm_ssi.c +++ b/configs/eagle100/src/lm_ssi.c @@ -65,7 +65,7 @@ #undef SSI_VERBOSE /* Define to enable verbose debug */ #ifdef SSI_DEBUG -# define ssidbg llerr +# define ssierr llerr # ifdef SSI_VERBOSE # define ssiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SSI_VERBOSE -# define ssidbg(x...) +# define ssierr(x...) # define ssiinfo(x...) #endif @@ -127,7 +127,7 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_MMCSD) { /* Assert the CS pin to the card */ @@ -140,7 +140,7 @@ void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssidbg("Returning SPI_STATUS_PRESENT\n"); + ssierr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/efm32-g8xx-stk/src/efm32_autoleds.c b/configs/efm32-g8xx-stk/src/efm32_autoleds.c index ae7176c7a2..9038b795e3 100644 --- a/configs/efm32-g8xx-stk/src/efm32_autoleds.c +++ b/configs/efm32-g8xx-stk/src/efm32_autoleds.c @@ -64,10 +64,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/efm32-g8xx-stk/src/efm32_userleds.c b/configs/efm32-g8xx-stk/src/efm32_userleds.c index c09254f323..ec4ca87c51 100644 --- a/configs/efm32-g8xx-stk/src/efm32_userleds.c +++ b/configs/efm32-g8xx-stk/src/efm32_userleds.c @@ -64,10 +64,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/efm32gg-stk3700/src/efm32_autoleds.c b/configs/efm32gg-stk3700/src/efm32_autoleds.c index c1f2c8b110..23cf753454 100644 --- a/configs/efm32gg-stk3700/src/efm32_autoleds.c +++ b/configs/efm32gg-stk3700/src/efm32_autoleds.c @@ -98,10 +98,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/efm32gg-stk3700/src/efm32_userleds.c b/configs/efm32gg-stk3700/src/efm32_userleds.c index 53bbf90685..72f808bb31 100644 --- a/configs/efm32gg-stk3700/src/efm32_userleds.c +++ b/configs/efm32gg-stk3700/src/efm32_userleds.c @@ -75,10 +75,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/ekk-lm3s9b96/src/lm_leds.c b/configs/ekk-lm3s9b96/src/lm_leds.c index 0b188a81be..8df76950a4 100644 --- a/configs/ekk-lm3s9b96/src/lm_leds.c +++ b/configs/ekk-lm3s9b96/src/lm_leds.c @@ -61,10 +61,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif @@ -97,7 +97,7 @@ static uint8_t g_nest; #ifdef CONFIG_ARCH_LEDS void board_autoled_initialize(void) { - leddbg("Initializing\n"); + lederr("Initializing\n"); /* Configure Port D, Bit 0 as an output, initial value=OFF */ diff --git a/configs/ekk-lm3s9b96/src/lm_ssi.c b/configs/ekk-lm3s9b96/src/lm_ssi.c index fc402edc1f..1e4e379213 100644 --- a/configs/ekk-lm3s9b96/src/lm_ssi.c +++ b/configs/ekk-lm3s9b96/src/lm_ssi.c @@ -64,7 +64,7 @@ #undef SSI_VERBOSE /* Define to enable verbose debug */ #ifdef SSI_DEBUG -# define ssidbg llerr +# define ssierr llerr # ifdef SSI_VERBOSE # define ssiinfo llerr # else @@ -72,7 +72,7 @@ # endif #else # undef SSI_VERBOSE -# define ssidbg(x...) +# define ssierr(x...) # define ssiinfo(x...) #endif @@ -133,7 +133,7 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); if (devid == SPIDEV_MMCSD) { @@ -154,7 +154,7 @@ void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssidbg("Returning SPI_STATUS_PRESENT\n"); + ssierr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } #endif diff --git a/configs/fire-stm32v2/src/stm32_appinit.c b/configs/fire-stm32v2/src/stm32_appinit.c index e8711ef204..7e894cc4af 100644 --- a/configs/fire-stm32v2/src/stm32_appinit.c +++ b/configs/fire-stm32v2/src/stm32_appinit.c @@ -147,14 +147,14 @@ static void stm32_i2c_register(int bus) i2c = stm32_i2cbus_initialize(bus); if (i2c == NULL) { - dbg("ERROR: Failed to get I2C%d interface\n", bus); + err("ERROR: Failed to get I2C%d interface\n", bus); } else { ret = i2c_register(i2c, bus); if (ret < 0) { - dbg("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); stm32_i2cbus_uninitialize(i2c); } } diff --git a/configs/fire-stm32v2/src/stm32_autoleds.c b/configs/fire-stm32v2/src/stm32_autoleds.c index 2d6b80528e..6db2e6aea5 100644 --- a/configs/fire-stm32v2/src/stm32_autoleds.c +++ b/configs/fire-stm32v2/src/stm32_autoleds.c @@ -62,10 +62,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/fire-stm32v2/src/stm32_mmcsd.c b/configs/fire-stm32v2/src/stm32_mmcsd.c index a356d8eeb9..3bbd49d892 100644 --- a/configs/fire-stm32v2/src/stm32_mmcsd.c +++ b/configs/fire-stm32v2/src/stm32_mmcsd.c @@ -93,7 +93,7 @@ int stm32_sdinitialize(int minor) sdio = sdio_initialize(STM32_MMCSDSLOTNO); if (!sdio) { - fdbg("Failed to initialize SDIO slot %d\n", STM32_MMCSDSLOTNO); + ferr("Failed to initialize SDIO slot %d\n", STM32_MMCSDSLOTNO); return -ENODEV; } @@ -104,7 +104,7 @@ int stm32_sdinitialize(int minor) ret = mmcsd_slotinitialize(minor, sdio); if (ret != OK) { - fdbg("Failed to bind SDIO slot %d to the MMC/SD driver, minor=%d\n", + ferr("Failed to bind SDIO slot %d to the MMC/SD driver, minor=%d\n", STM32_MMCSDSLOTNO, minor); } diff --git a/configs/fire-stm32v2/src/stm32_spi.c b/configs/fire-stm32v2/src/stm32_spi.c index 2b7216e05b..b040fdc0c9 100644 --- a/configs/fire-stm32v2/src/stm32_spi.c +++ b/configs/fire-stm32v2/src/stm32_spi.c @@ -63,7 +63,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -71,7 +71,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -159,7 +159,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #if 0 /* Need to study this */ if (devid == SPIDEV_LCD) @@ -196,7 +196,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_AUDIO) { diff --git a/configs/fire-stm32v2/src/stm32_userleds.c b/configs/fire-stm32v2/src/stm32_userleds.c index 3f2d1ff650..26484ff2e7 100644 --- a/configs/fire-stm32v2/src/stm32_userleds.c +++ b/configs/fire-stm32v2/src/stm32_userleds.c @@ -62,10 +62,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/fire-stm32v2/src/stm32_w25.c b/configs/fire-stm32v2/src/stm32_w25.c index 3fad2929b2..34940b5c62 100644 --- a/configs/fire-stm32v2/src/stm32_w25.c +++ b/configs/fire-stm32v2/src/stm32_w25.c @@ -106,7 +106,7 @@ int stm32_w25initialize(int minor) spi = stm32_spibus_initialize(1); if (!spi) { - fdbg("ERROR: Failed to initialize SPI port 2\n"); + ferr("ERROR: Failed to initialize SPI port 2\n"); return -ENODEV; } @@ -115,7 +115,7 @@ int stm32_w25initialize(int minor) mtd = w25_initialize(spi); if (!mtd) { - fdbg("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n"); + ferr("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n"); return -ENODEV; } @@ -125,7 +125,7 @@ int stm32_w25initialize(int minor) ret = ftl_initialize(minor, mtd); if (ret < 0) { - fdbg("ERROR: Initialize the FTL layer\n"); + ferr("ERROR: Initialize the FTL layer\n"); return ret; } #else @@ -134,7 +134,7 @@ int stm32_w25initialize(int minor) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", -ret); + ferr("ERROR: NXFFS initialization failed: %d\n", -ret); return ret; } @@ -144,7 +144,7 @@ int stm32_w25initialize(int minor) ret = mount(NULL, devname, "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif diff --git a/configs/freedom-kl25z/src/kl_adxl345.c b/configs/freedom-kl25z/src/kl_adxl345.c index a6fab92a64..e0dcd781ea 100644 --- a/configs/freedom-kl25z/src/kl_adxl345.c +++ b/configs/freedom-kl25z/src/kl_adxl345.c @@ -257,7 +257,7 @@ int adxl345_archinitialize(int minor) FAR struct spi_dev_s *dev; int ret; - sndbg("minor %d\n", minor); + snerr("minor %d\n", minor); DEBUGASSERT(minor == 0); /* Check if we are already initialized */ @@ -275,7 +275,7 @@ int adxl345_archinitialize(int minor) dev = kl_spibus_initialize(CONFIG_ADXL345_SPIDEV); if (!dev) { - sndbg("Failed to initialize SPI bus %d\n", CONFIG_ADXL345_SPIDEV); + snerr("Failed to initialize SPI bus %d\n", CONFIG_ADXL345_SPIDEV); return -ENODEV; } @@ -285,7 +285,7 @@ int adxl345_archinitialize(int minor) adxl345_instantiate(dev, (FAR struct adxl345_config_s *)&g_adxl345config); if (!g_adxl345config.handle) { - sndbg("Failed to instantiate the ADXL345 driver\n"); + snerr("Failed to instantiate the ADXL345 driver\n"); return -ENODEV; } @@ -294,7 +294,7 @@ int adxl345_archinitialize(int minor) ret = adxl345_register(g_adxl345config.handle, CONFIG_ADXL345_DEVMINOR); if (ret < 0) { - sndbg("Failed to register ADXL345 driver: %d\n", ret); + snerr("Failed to register ADXL345 driver: %d\n", ret); return ret; } } diff --git a/configs/freedom-kl25z/src/kl_appinit.c b/configs/freedom-kl25z/src/kl_appinit.c index a00e675cdd..f0126fdd31 100644 --- a/configs/freedom-kl25z/src/kl_appinit.c +++ b/configs/freedom-kl25z/src/kl_appinit.c @@ -86,7 +86,7 @@ int board_app_initialize(uintptr_t arg) ret = adxl345_archinitialize(0); if (ret < 0) { - dbg("ERROR: adxl345_archinitialize failed: %d\n", ret); + err("ERROR: adxl345_archinitialize failed: %d\n", ret); } #endif return OK; diff --git a/configs/freedom-kl25z/src/kl_led.c b/configs/freedom-kl25z/src/kl_led.c index 3a0a75d690..dc2a20ee52 100644 --- a/configs/freedom-kl25z/src/kl_led.c +++ b/configs/freedom-kl25z/src/kl_led.c @@ -86,14 +86,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/freedom-kl25z/src/kl_pwm.c b/configs/freedom-kl25z/src/kl_pwm.c index 0d0a73aeb9..18b51097d1 100644 --- a/configs/freedom-kl25z/src/kl_pwm.c +++ b/configs/freedom-kl25z/src/kl_pwm.c @@ -98,7 +98,7 @@ int board_pwm_setup(void) pwm = kl_pwminitialize(0); if (!pwm) { - adbg("Failed to get the KL25 PWM lower half\n"); + aerr("Failed to get the KL25 PWM lower half\n"); return -ENODEV; } @@ -107,7 +107,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/freedom-kl25z/src/kl_spi.c b/configs/freedom-kl25z/src/kl_spi.c index d5c3d56edc..33747807d9 100644 --- a/configs/freedom-kl25z/src/kl_spi.c +++ b/configs/freedom-kl25z/src/kl_spi.c @@ -58,14 +58,14 @@ /* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/freedom-kl25z/src/kl_wifi.c b/configs/freedom-kl25z/src/kl_wifi.c index fa59ac10ae..12924682d8 100644 --- a/configs/freedom-kl25z/src/kl_wifi.c +++ b/configs/freedom-kl25z/src/kl_wifi.c @@ -289,7 +289,7 @@ int wireless_archinitialize(size_t max_rx_size) /* Init SPI bus */ - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(CONFIG_CC3000_DEVMINOR == 0); #ifdef CONFIG_CC3000_PROBES @@ -304,7 +304,7 @@ int wireless_archinitialize(size_t max_rx_size) spi = kl_spibus_initialize(CONFIG_CC3000_SPIDEV); if (!spi) { - idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); + ierr("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); return -ENODEV; } @@ -314,7 +314,7 @@ int wireless_archinitialize(size_t max_rx_size) int ret = cc3000_register(spi, &g_cc3000_info.dev, CONFIG_CC3000_DEVMINOR); if (ret < 0) { - idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); + ierr("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); return -ENODEV; } diff --git a/configs/freedom-kl26z/src/kl_led.c b/configs/freedom-kl26z/src/kl_led.c index 53b328d158..8d4847cda4 100644 --- a/configs/freedom-kl26z/src/kl_led.c +++ b/configs/freedom-kl26z/src/kl_led.c @@ -86,14 +86,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/freedom-kl26z/src/kl_pwm.c b/configs/freedom-kl26z/src/kl_pwm.c index 4faf9cabe8..e57a9936bb 100644 --- a/configs/freedom-kl26z/src/kl_pwm.c +++ b/configs/freedom-kl26z/src/kl_pwm.c @@ -98,7 +98,7 @@ int board_pwm_setup(void) pwm = kl_pwminitialize(0); if (!pwm) { - adbg("Failed to get the KL26 PWM lower half\n"); + aerr("Failed to get the KL26 PWM lower half\n"); return -ENODEV; } @@ -107,7 +107,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/freedom-kl26z/src/kl_spi.c b/configs/freedom-kl26z/src/kl_spi.c index c5d25a96a7..d6e7fbea66 100644 --- a/configs/freedom-kl26z/src/kl_spi.c +++ b/configs/freedom-kl26z/src/kl_spi.c @@ -58,14 +58,14 @@ /* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/hymini-stm32v/src/stm32_leds.c b/configs/hymini-stm32v/src/stm32_leds.c index e669700696..0f72b14429 100644 --- a/configs/hymini-stm32v/src/stm32_leds.c +++ b/configs/hymini-stm32v/src/stm32_leds.c @@ -62,10 +62,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/hymini-stm32v/src/stm32_r61505u.c b/configs/hymini-stm32v/src/stm32_r61505u.c index 579ff1f2ec..8f23b6a344 100644 --- a/configs/hymini-stm32v/src/stm32_r61505u.c +++ b/configs/hymini-stm32v/src/stm32_r61505u.c @@ -94,9 +94,9 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) info(format, ##__VA_ARGS__) +# define lcderr(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) #endif /* This should be put elsewhere (possibly include/nuttx/compiler.h) */ @@ -880,26 +880,26 @@ static void lcd_backlight(void) /* Dump timer3 registers */ - lcddbg("APB1ENR: %08x\n", getreg32(STM32_RCC_APB1ENR)); - lcddbg("CR1: %04x\n", getreg32(STM32_TIM3_CR1)); - lcddbg("CR2: %04x\n", getreg32(STM32_TIM3_CR2)); - lcddbg("SMCR: %04x\n", getreg32(STM32_TIM3_SMCR)); - lcddbg("DIER: %04x\n", getreg32(STM32_TIM3_DIER)); - lcddbg("SR: %04x\n", getreg32(STM32_TIM3_SR)); - lcddbg("EGR: %04x\n", getreg32(STM32_TIM3_EGR)); - lcddbg("CCMR1: %04x\n", getreg32(STM32_TIM3_CCMR1)); - lcddbg("CCMR2: %04x\n", getreg32(STM32_TIM3_CCMR2)); - lcddbg("CCER: %04x\n", getreg32(STM32_TIM3_CCER)); - lcddbg("CNT: %04x\n", getreg32(STM32_TIM3_CNT)); - lcddbg("PSC: %04x\n", getreg32(STM32_TIM3_PSC)); - lcddbg("ARR: %04x\n", getreg32(STM32_TIM3_ARR)); - lcddbg("CCR1: %04x\n", getreg32(STM32_TIM3_CCR1)); - lcddbg("CCR2: %04x\n", getreg32(STM32_TIM3_CCR2)); - lcddbg("CCR3: %04x\n", getreg32(STM32_TIM3_CCR3)); - lcddbg("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); - lcddbg("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); - lcddbg("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); - lcddbg("DMAR: %04x\n", getreg32(STM32_TIM3_DMAR)); + lcderr("APB1ENR: %08x\n", getreg32(STM32_RCC_APB1ENR)); + lcderr("CR1: %04x\n", getreg32(STM32_TIM3_CR1)); + lcderr("CR2: %04x\n", getreg32(STM32_TIM3_CR2)); + lcderr("SMCR: %04x\n", getreg32(STM32_TIM3_SMCR)); + lcderr("DIER: %04x\n", getreg32(STM32_TIM3_DIER)); + lcderr("SR: %04x\n", getreg32(STM32_TIM3_SR)); + lcderr("EGR: %04x\n", getreg32(STM32_TIM3_EGR)); + lcderr("CCMR1: %04x\n", getreg32(STM32_TIM3_CCMR1)); + lcderr("CCMR2: %04x\n", getreg32(STM32_TIM3_CCMR2)); + lcderr("CCER: %04x\n", getreg32(STM32_TIM3_CCER)); + lcderr("CNT: %04x\n", getreg32(STM32_TIM3_CNT)); + lcderr("PSC: %04x\n", getreg32(STM32_TIM3_PSC)); + lcderr("ARR: %04x\n", getreg32(STM32_TIM3_ARR)); + lcderr("CCR1: %04x\n", getreg32(STM32_TIM3_CCR1)); + lcderr("CCR2: %04x\n", getreg32(STM32_TIM3_CCR2)); + lcderr("CCR3: %04x\n", getreg32(STM32_TIM3_CCR3)); + lcderr("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); + lcderr("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); + lcderr("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); + lcderr("DMAR: %04x\n", getreg32(STM32_TIM3_DMAR)); } #endif @@ -938,7 +938,7 @@ int board_lcd_initialize(void) { /* Not a R61505U ? */ - gdbg("board_lcd_initialize: LCD ctrl is not a R61505U"); + gerr("board_lcd_initialize: LCD ctrl is not a R61505U"); return ERROR; } diff --git a/configs/hymini-stm32v/src/stm32_spi.c b/configs/hymini-stm32v/src/stm32_spi.c index 7983b3496a..c8c781f644 100644 --- a/configs/hymini-stm32v/src/stm32_spi.c +++ b/configs/hymini-stm32v/src/stm32_spi.c @@ -64,7 +64,7 @@ #define SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -72,7 +72,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -135,7 +135,7 @@ void stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_TOUCHSCREEN) { @@ -154,7 +154,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -166,7 +166,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/hymini-stm32v/src/stm32_ssd1289.c b/configs/hymini-stm32v/src/stm32_ssd1289.c index 264be5d900..7bd48a1529 100644 --- a/configs/hymini-stm32v/src/stm32_ssd1289.c +++ b/configs/hymini-stm32v/src/stm32_ssd1289.c @@ -104,10 +104,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -359,26 +359,26 @@ static void init_lcd_backlight(void) /* Dump timer3 registers */ - lcddbg("APB1ENR: %08x\n", getreg32(STM32_RCC_APB1ENR)); - lcddbg("CR1: %04x\n", getreg32(STM32_TIM3_CR1)); - lcddbg("CR2: %04x\n", getreg32(STM32_TIM3_CR2)); - lcddbg("SMCR: %04x\n", getreg32(STM32_TIM3_SMCR)); - lcddbg("DIER: %04x\n", getreg32(STM32_TIM3_DIER)); - lcddbg("SR: %04x\n", getreg32(STM32_TIM3_SR)); - lcddbg("EGR: %04x\n", getreg32(STM32_TIM3_EGR)); - lcddbg("CCMR1: %04x\n", getreg32(STM32_TIM3_CCMR1)); - lcddbg("CCMR2: %04x\n", getreg32(STM32_TIM3_CCMR2)); - lcddbg("CCER: %04x\n", getreg32(STM32_TIM3_CCER)); - lcddbg("CNT: %04x\n", getreg32(STM32_TIM3_CNT)); - lcddbg("PSC: %04x\n", getreg32(STM32_TIM3_PSC)); - lcddbg("ARR: %04x\n", getreg32(STM32_TIM3_ARR)); - lcddbg("CCR1: %04x\n", getreg32(STM32_TIM3_CCR1)); - lcddbg("CCR2: %04x\n", getreg32(STM32_TIM3_CCR2)); - lcddbg("CCR3: %04x\n", getreg32(STM32_TIM3_CCR3)); - lcddbg("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); - lcddbg("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); - lcddbg("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); - lcddbg("DMAR: %04x\n", getreg32(STM32_TIM3_DMAR)); + lcderr("APB1ENR: %08x\n", getreg32(STM32_RCC_APB1ENR)); + lcderr("CR1: %04x\n", getreg32(STM32_TIM3_CR1)); + lcderr("CR2: %04x\n", getreg32(STM32_TIM3_CR2)); + lcderr("SMCR: %04x\n", getreg32(STM32_TIM3_SMCR)); + lcderr("DIER: %04x\n", getreg32(STM32_TIM3_DIER)); + lcderr("SR: %04x\n", getreg32(STM32_TIM3_SR)); + lcderr("EGR: %04x\n", getreg32(STM32_TIM3_EGR)); + lcderr("CCMR1: %04x\n", getreg32(STM32_TIM3_CCMR1)); + lcderr("CCMR2: %04x\n", getreg32(STM32_TIM3_CCMR2)); + lcderr("CCER: %04x\n", getreg32(STM32_TIM3_CCER)); + lcderr("CNT: %04x\n", getreg32(STM32_TIM3_CNT)); + lcderr("PSC: %04x\n", getreg32(STM32_TIM3_PSC)); + lcderr("ARR: %04x\n", getreg32(STM32_TIM3_ARR)); + lcderr("CCR1: %04x\n", getreg32(STM32_TIM3_CCR1)); + lcderr("CCR2: %04x\n", getreg32(STM32_TIM3_CCR2)); + lcderr("CCR3: %04x\n", getreg32(STM32_TIM3_CCR3)); + lcderr("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); + lcderr("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); + lcderr("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); + lcderr("DMAR: %04x\n", getreg32(STM32_TIM3_DMAR)); } /************************************************************************************ @@ -496,7 +496,7 @@ int board_lcd_initialize(void) g_ssd1289drvr = ssd1289_lcdinitialize(&g_ssd1289); if (!g_ssd1289drvr) { - lcddbg("ERROR: ssd1289_lcdinitialize failed\n"); + lcderr("ERROR: ssd1289_lcdinitialize failed\n"); return -ENODEV; } } diff --git a/configs/hymini-stm32v/src/stm32_ts.c b/configs/hymini-stm32v/src/stm32_ts.c index 6edda3f41e..77e83d66f2 100644 --- a/configs/hymini-stm32v/src/stm32_ts.c +++ b/configs/hymini-stm32v/src/stm32_ts.c @@ -153,12 +153,12 @@ int board_tsc_setup(int minor) { FAR struct spi_dev_s *dev; - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); dev = stm32_spibus_initialize(1); if (!dev) { - idbg("Failed to initialize SPI bus\n"); + ierr("Failed to initialize SPI bus\n"); return -ENODEV; } diff --git a/configs/kwikstik-k40/src/k40_lcd.c b/configs/kwikstik-k40/src/k40_lcd.c index e9d4b00420..a1d9985531 100644 --- a/configs/kwikstik-k40/src/k40_lcd.c +++ b/configs/kwikstik-k40/src/k40_lcd.c @@ -61,9 +61,9 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) info(format, ##__VA_ARGS__) +# define lcderr(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) #endif /************************************************************************************** diff --git a/configs/kwikstik-k40/src/k40_leds.c b/configs/kwikstik-k40/src/k40_leds.c index 334a038b9d..277da4de96 100644 --- a/configs/kwikstik-k40/src/k40_leds.c +++ b/configs/kwikstik-k40/src/k40_leds.c @@ -52,10 +52,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/kwikstik-k40/src/k40_spi.c b/configs/kwikstik-k40/src/k40_spi.c index 4e55111754..ec06535419 100644 --- a/configs/kwikstik-k40/src/k40_spi.c +++ b/configs/kwikstik-k40/src/k40_spi.c @@ -60,7 +60,7 @@ /* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_SPI_VERBOSE # define spiinfo llerr # else @@ -68,7 +68,7 @@ # endif #else # undef CONFIG_DEBUG_SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -121,7 +121,7 @@ void weak_function kinetis_spidev_initialize(void) #ifdef CONFIG_KINETIS_SPI1 void kinetis_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); # warning "Missing logic" } @@ -135,7 +135,7 @@ uint8_t kinetis_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_KINETIS_SPI2 void kinetis_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); # warning "Missing logic" } @@ -149,7 +149,7 @@ uint8_t kinetis_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_KINETIS_SPI3 void kinetis_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); # warning "Missing logic" } diff --git a/configs/launchxl-tms57004/src/tms570_autoleds.c b/configs/launchxl-tms57004/src/tms570_autoleds.c index b51afadfd7..0bf1c51abd 100644 --- a/configs/launchxl-tms57004/src/tms570_autoleds.c +++ b/configs/launchxl-tms57004/src/tms570_autoleds.c @@ -98,10 +98,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/lincoln60/src/lpc17_leds.c b/configs/lincoln60/src/lpc17_leds.c index 1baafaafa8..9a99465a32 100644 --- a/configs/lincoln60/src/lpc17_leds.c +++ b/configs/lincoln60/src/lpc17_leds.c @@ -65,14 +65,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/lm3s6432-s2e/src/lm_leds.c b/configs/lm3s6432-s2e/src/lm_leds.c index 360a75e1a5..276a168c4a 100644 --- a/configs/lm3s6432-s2e/src/lm_leds.c +++ b/configs/lm3s6432-s2e/src/lm_leds.c @@ -60,10 +60,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif @@ -96,7 +96,7 @@ static uint8_t g_nest; #ifdef CONFIG_ARCH_LEDS void board_autoled_initialize(void) { - leddbg("Initializing\n"); + lederr("Initializing\n"); /* Configure Port F, Bit 2 as an output, initial value=OFF */ diff --git a/configs/lm3s6432-s2e/src/lm_ssi.c b/configs/lm3s6432-s2e/src/lm_ssi.c index 9f2c4818c1..250b29bddc 100644 --- a/configs/lm3s6432-s2e/src/lm_ssi.c +++ b/configs/lm3s6432-s2e/src/lm_ssi.c @@ -63,7 +63,7 @@ #undef SSI_VERBOSE /* Define to enable verbose debug */ #ifdef SSI_DEBUG -# define ssidbg llerr +# define ssierr llerr # ifdef SSI_VERBOSE # define ssiinfo llerr # else @@ -71,7 +71,7 @@ # endif #else # undef SSI_VERBOSE -# define ssidbg(x...) +# define ssierr(x...) # define ssiinfo(x...) #endif @@ -129,7 +129,7 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); if (devid == SPIDEV_MMCSD) @@ -144,7 +144,7 @@ void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssidbg("Returning SPI_STATUS_PRESENT\n"); + ssierr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/lm3s6965-ek/src/lm_leds.c b/configs/lm3s6965-ek/src/lm_leds.c index 7bd3bdea2e..95c4695739 100644 --- a/configs/lm3s6965-ek/src/lm_leds.c +++ b/configs/lm3s6965-ek/src/lm_leds.c @@ -60,10 +60,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif @@ -96,7 +96,7 @@ static uint8_t g_nest; #ifdef CONFIG_ARCH_LEDS void board_autoled_initialize(void) { - leddbg("Initializing\n"); + lederr("Initializing\n"); /* Configure Port E, Bit 1 as an output, initial value=OFF */ diff --git a/configs/lm3s6965-ek/src/lm_oled.c b/configs/lm3s6965-ek/src/lm_oled.c index 0d4f1fb2ba..f9eb8d8644 100644 --- a/configs/lm3s6965-ek/src/lm_oled.c +++ b/configs/lm3s6965-ek/src/lm_oled.c @@ -73,11 +73,11 @@ #endif #ifdef CONFIG_LCD_RITDEBUG -# define ritdbg(format, ...) info(format, ##__VA_ARGS__) +# define riterr(format, ...) info(format, ##__VA_ARGS__) # define oleddc_dumpgpio(m) tiva_dumpgpio(OLEDDC_GPIO, m) # define oledcs_dumpgpio(m) tiva_dumpgpio(OLEDCS_GPIO, m) #else -# define ritdbg(x...) +# define riterr(x...) # define oleddc_dumpgpio(m) # define oledcs_dumpgpio(m) #endif diff --git a/configs/lm3s6965-ek/src/lm_ssi.c b/configs/lm3s6965-ek/src/lm_ssi.c index 12126e6940..600e1f2ccf 100644 --- a/configs/lm3s6965-ek/src/lm_ssi.c +++ b/configs/lm3s6965-ek/src/lm_ssi.c @@ -65,7 +65,7 @@ #undef SSI_VERBOSE /* Define to enable verbose debug */ #ifdef SSI_DEBUG -# define ssidbg llerr +# define ssierr llerr # ifdef SSI_VERBOSE # define ssiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SSI_VERBOSE -# define ssidbg(x...) +# define ssierr(x...) # define ssiinfo(x...) #endif @@ -134,7 +134,7 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); if (devid == SPIDEV_MMCSD) @@ -156,7 +156,7 @@ void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssidbg("Returning SPI_STATUS_PRESENT\n"); + ssierr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/lm3s8962-ek/src/lm_leds.c b/configs/lm3s8962-ek/src/lm_leds.c index b1fa2421d0..bf8eb48ddc 100644 --- a/configs/lm3s8962-ek/src/lm_leds.c +++ b/configs/lm3s8962-ek/src/lm_leds.c @@ -60,10 +60,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif @@ -96,7 +96,7 @@ static uint8_t g_nest; #ifdef CONFIG_ARCH_LEDS void board_autoled_initialize(void) { - leddbg("Initializing\n"); + lederr("Initializing\n"); /* Configure Port E, Bit 1 as an output, initial value=OFF */ diff --git a/configs/lm3s8962-ek/src/lm_oled.c b/configs/lm3s8962-ek/src/lm_oled.c index 93f5344286..d42049227b 100644 --- a/configs/lm3s8962-ek/src/lm_oled.c +++ b/configs/lm3s8962-ek/src/lm_oled.c @@ -72,11 +72,11 @@ #endif #ifdef CONFIG_LCD_RITDEBUG -# define ritdbg(format, ...) info(format, ##__VA_ARGS__) +# define riterr(format, ...) info(format, ##__VA_ARGS__) # define oleddc_dumpgpio(m) tiva_dumpgpio(OLEDDC_GPIO, m) # define oledcs_dumpgpio(m) tiva_dumpgpio(OLEDCS_GPIO, m) #else -# define ritdbg(x...) +# define riterr(x...) # define oleddc_dumpgpio(m) # define oledcs_dumpgpio(m) #endif diff --git a/configs/lm3s8962-ek/src/lm_ssi.c b/configs/lm3s8962-ek/src/lm_ssi.c index 3a068665cb..60fc30bfec 100644 --- a/configs/lm3s8962-ek/src/lm_ssi.c +++ b/configs/lm3s8962-ek/src/lm_ssi.c @@ -65,7 +65,7 @@ #undef SSI_VERBOSE /* Define to enable verbose debug */ #ifdef SSI_DEBUG -# define ssidbg llerr +# define ssierr llerr # ifdef SSI_VERBOSE # define ssiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SSI_VERBOSE -# define ssidbg(x...) +# define ssierr(x...) # define ssiinfo(x...) #endif @@ -134,7 +134,7 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); if (devid == SPIDEV_MMCSD) @@ -156,7 +156,7 @@ void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssidbg("Returning SPI_STATUS_PRESENT\n"); + ssierr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/lm4f120-launchpad/src/lm4f_autoleds.c b/configs/lm4f120-launchpad/src/lm4f_autoleds.c index b55efa7b95..0e7fe05da3 100644 --- a/configs/lm4f120-launchpad/src/lm4f_autoleds.c +++ b/configs/lm4f120-launchpad/src/lm4f_autoleds.c @@ -102,10 +102,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif @@ -140,7 +140,7 @@ #ifdef CONFIG_ARCH_LEDS void lm4f_led_initialize(void) { - leddbg("Initializing\n"); + lederr("Initializing\n"); /* Configure Port E, Bit 1 as an output, initial value=OFF */ diff --git a/configs/lm4f120-launchpad/src/lm4f_ssi.c b/configs/lm4f120-launchpad/src/lm4f_ssi.c index a11a168108..68aaab1553 100644 --- a/configs/lm4f120-launchpad/src/lm4f_ssi.c +++ b/configs/lm4f120-launchpad/src/lm4f_ssi.c @@ -63,9 +63,9 @@ /* CONFIG_DEBUG_SPI enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ #ifdef CONFIG_DEBUG_SPI -# define ssidbg llerr +# define ssierr llerr #else -# define ssidbg(x...) +# define ssierr(x...) #endif /* Dump GPIO registers */ @@ -119,14 +119,14 @@ void weak_function lm4f_spidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); ssi_dumpgpio("tiva_ssiselect() Exit"); } uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssidbg("Returning SPI_STATUS_PRESENT\n"); + ssierr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/lpc4330-xplorer/src/lpc43_appinit.c b/configs/lpc4330-xplorer/src/lpc43_appinit.c index 48225e0dde..751daad901 100644 --- a/configs/lpc4330-xplorer/src/lpc43_appinit.c +++ b/configs/lpc4330-xplorer/src/lpc43_appinit.c @@ -90,7 +90,7 @@ static int nsh_spifi_initialize(void) mtd = lpc43_spifi_initialize(); if (!mtd) { - fdbg("ERROR: lpc43_spifi_initialize failed\n"); + ferr("ERROR: lpc43_spifi_initialize failed\n"); return -ENODEV; } @@ -100,7 +100,7 @@ static int nsh_spifi_initialize(void) ret = ftl_initialize(CONFIG_SPIFI_DEVNO, mtd); if (ret < 0) { - fdbg("ERROR: Initializing the FTL layer: %d\n", ret); + ferr("ERROR: Initializing the FTL layer: %d\n", ret); return ret; } #else @@ -109,7 +109,7 @@ static int nsh_spifi_initialize(void) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", ret); + ferr("ERROR: NXFFS initialization failed: %d\n", ret); return ret; } @@ -118,7 +118,7 @@ static int nsh_spifi_initialize(void) ret = mount(NULL, "/mnt/spifi", "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif diff --git a/configs/lpc4330-xplorer/src/lpc43_autoleds.c b/configs/lpc4330-xplorer/src/lpc43_autoleds.c index c12d1ba62e..5c541622fe 100644 --- a/configs/lpc4330-xplorer/src/lpc43_autoleds.c +++ b/configs/lpc4330-xplorer/src/lpc43_autoleds.c @@ -95,7 +95,7 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define LED_VERBOSE 1 # define ledinfo llerr @@ -105,7 +105,7 @@ # endif #else # undef LED_VERBOSE -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/lpc4330-xplorer/src/lpc43_userleds.c b/configs/lpc4330-xplorer/src/lpc43_userleds.c index 07735ddec1..22db426237 100644 --- a/configs/lpc4330-xplorer/src/lpc43_userleds.c +++ b/configs/lpc4330-xplorer/src/lpc43_userleds.c @@ -72,7 +72,7 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define LED_VERBOSE 1 # define ledinfo llerr @@ -82,7 +82,7 @@ # endif #else # undef LED_VERBOSE -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/lpc4337-ws/src/lpc43_adc.c b/configs/lpc4337-ws/src/lpc43_adc.c index 0bb398369a..0e5f77ca46 100644 --- a/configs/lpc4337-ws/src/lpc43_adc.c +++ b/configs/lpc4337-ws/src/lpc43_adc.c @@ -86,7 +86,7 @@ int board_adc_setup(void) adc = lpc43_adcinitialize(); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -95,7 +95,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/lpc4337-ws/src/lpc43_appinit.c b/configs/lpc4337-ws/src/lpc43_appinit.c index 976b78a418..b9dadd3090 100644 --- a/configs/lpc4337-ws/src/lpc43_appinit.c +++ b/configs/lpc4337-ws/src/lpc43_appinit.c @@ -70,14 +70,14 @@ static void lpc43_i2c_register(int bus) i2c = lpc43_i2cbus_initialize(bus); if (i2c == NULL) { - dbg("ERROR: Failed to get I2C%d interface\n", bus); + err("ERROR: Failed to get I2C%d interface\n", bus); } else { ret = i2c_register(i2c, bus); if (ret < 0) { - dbg("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); lpc43_i2cbus_uninitialize(i2c); } } diff --git a/configs/lpc4357-evb/src/lpc43_appinit.c b/configs/lpc4357-evb/src/lpc43_appinit.c index 43efc040ce..aea4aaaa19 100644 --- a/configs/lpc4357-evb/src/lpc43_appinit.c +++ b/configs/lpc4357-evb/src/lpc43_appinit.c @@ -90,7 +90,7 @@ static int nsh_spifi_initialize(void) mtd = lpc43_spifi_initialize(); if (!mtd) { - fdbg("ERROR: lpc43_spifi_initialize failed\n"); + ferr("ERROR: lpc43_spifi_initialize failed\n"); return -ENODEV; } @@ -100,7 +100,7 @@ static int nsh_spifi_initialize(void) ret = ftl_initialize(CONFIG_SPIFI_DEVNO, mtd); if (ret < 0) { - fdbg("ERROR: Initializing the FTL layer: %d\n", ret); + ferr("ERROR: Initializing the FTL layer: %d\n", ret); return ret; } #else @@ -109,7 +109,7 @@ static int nsh_spifi_initialize(void) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", ret); + ferr("ERROR: NXFFS initialization failed: %d\n", ret); return ret; } @@ -118,7 +118,7 @@ static int nsh_spifi_initialize(void) ret = mount(NULL, "/mnt/spifi", "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif diff --git a/configs/lpc4357-evb/src/lpc43_autoleds.c b/configs/lpc4357-evb/src/lpc43_autoleds.c index dd589c240e..831a65ed2e 100644 --- a/configs/lpc4357-evb/src/lpc43_autoleds.c +++ b/configs/lpc4357-evb/src/lpc43_autoleds.c @@ -92,7 +92,7 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define LED_VERBOSE 1 # define ledinfo llerr @@ -102,7 +102,7 @@ # endif #else # undef LED_VERBOSE -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/lpc4357-evb/src/lpc43_userleds.c b/configs/lpc4357-evb/src/lpc43_userleds.c index 5ac10a9db0..7db57acecd 100644 --- a/configs/lpc4357-evb/src/lpc43_userleds.c +++ b/configs/lpc4357-evb/src/lpc43_userleds.c @@ -83,7 +83,7 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define LED_VERBOSE 1 # define ledinfo llerr @@ -93,7 +93,7 @@ # endif #else # undef LED_VERBOSE -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/lpc4370-link2/src/lpc43_adc.c b/configs/lpc4370-link2/src/lpc43_adc.c index 531b25ad7e..10eeaffcc8 100644 --- a/configs/lpc4370-link2/src/lpc43_adc.c +++ b/configs/lpc4370-link2/src/lpc43_adc.c @@ -86,7 +86,7 @@ int board_adc_setup(void) adc = lpc43_adcinitialize(); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -95,7 +95,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/lpc4370-link2/src/lpc43_appinit.c b/configs/lpc4370-link2/src/lpc43_appinit.c index 660fb2e5f7..a2f013613d 100644 --- a/configs/lpc4370-link2/src/lpc43_appinit.c +++ b/configs/lpc4370-link2/src/lpc43_appinit.c @@ -70,14 +70,14 @@ static void lpc43_i2c_register(int bus) i2c = lpc43_i2cbus_initialize(bus); if (i2c == NULL) { - dbg("ERROR: Failed to get I2C%d interface\n", bus); + err("ERROR: Failed to get I2C%d interface\n", bus); } else { ret = i2c_register(i2c, bus); if (ret < 0) { - dbg("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); lpc43_i2cbus_uninitialize(i2c); } } diff --git a/configs/lpc4370-link2/src/lpc43_autoleds.c b/configs/lpc4370-link2/src/lpc43_autoleds.c index ac30ba5842..63050c2df6 100644 --- a/configs/lpc4370-link2/src/lpc43_autoleds.c +++ b/configs/lpc4370-link2/src/lpc43_autoleds.c @@ -64,7 +64,7 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define LED_VERBOSE 1 # define ledinfo llerr @@ -74,7 +74,7 @@ # endif #else # undef LED_VERBOSE -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/lpc4370-link2/src/lpc43_userleds.c b/configs/lpc4370-link2/src/lpc43_userleds.c index da911674f0..0625b9077c 100644 --- a/configs/lpc4370-link2/src/lpc43_userleds.c +++ b/configs/lpc4370-link2/src/lpc43_userleds.c @@ -65,7 +65,7 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define LED_VERBOSE 1 # define ledinfo llerr @@ -75,7 +75,7 @@ # endif #else # undef LED_VERBOSE -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/lpcxpresso-lpc1115/src/lpc11_adc.c b/configs/lpcxpresso-lpc1115/src/lpc11_adc.c index 0b76f0c41c..93d6c0f7b9 100644 --- a/configs/lpcxpresso-lpc1115/src/lpc11_adc.c +++ b/configs/lpcxpresso-lpc1115/src/lpc11_adc.c @@ -98,7 +98,7 @@ int adc_devinit(void) adc = lpc11_adcinitialize(); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -107,7 +107,7 @@ int adc_devinit(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/lpcxpresso-lpc1115/src/lpc11_dac.c b/configs/lpcxpresso-lpc1115/src/lpc11_dac.c index 3447f33036..420805ae8e 100644 --- a/configs/lpcxpresso-lpc1115/src/lpc11_dac.c +++ b/configs/lpcxpresso-lpc1115/src/lpc11_dac.c @@ -83,14 +83,14 @@ int dac_devinit(void) dac = lpc11_dacinitialize(); if (dac == NULL) { - adbg("ERROR: Failed to get dac interface\n"); + aerr("ERROR: Failed to get dac interface\n"); return -ENODEV; } ret = dac_register("/dev/dac0", dac); if (ret < 0) { - adbg("dac_register failed: %d\n", ret); + aerr("dac_register failed: %d\n", ret); return ret; } diff --git a/configs/lpcxpresso-lpc1115/src/lpc11_leds.c b/configs/lpcxpresso-lpc1115/src/lpc11_leds.c index 8154cfa283..ff96ed7aed 100644 --- a/configs/lpcxpresso-lpc1115/src/lpc11_leds.c +++ b/configs/lpcxpresso-lpc1115/src/lpc11_leds.c @@ -61,14 +61,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/lpcxpresso-lpc1115/src/lpc11_pwm.c b/configs/lpcxpresso-lpc1115/src/lpc11_pwm.c index d42ff511c0..1821e4cd5c 100644 --- a/configs/lpcxpresso-lpc1115/src/lpc11_pwm.c +++ b/configs/lpcxpresso-lpc1115/src/lpc11_pwm.c @@ -96,7 +96,7 @@ int pwm_devinit(void) pwm = lpc11_pwminitialize(0); if (!pwm) { - adbg("Failed to get the LPC17XX PWM lower half\n"); + aerr("Failed to get the LPC17XX PWM lower half\n"); return -ENODEV; } @@ -105,14 +105,14 @@ int pwm_devinit(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } mcpwm = lpc11_mcpwminitialize(0); if (!mcpwm) { - adbg("Failed to get the LPC17XX MOTOR PWM lower half\n"); + aerr("Failed to get the LPC17XX MOTOR PWM lower half\n"); return -ENODEV; } @@ -121,14 +121,14 @@ int pwm_devinit(void) ret = pwm_register("/dev/mcpwm0", mcpwm); if (ret < 0) { - adbg("mcpwm_register failed: %d\n", ret); + aerr("mcpwm_register failed: %d\n", ret); return ret; } timer = lpc11_timerinitialize(0); if (!timer) { - adbg("Failed to get the LPC17XX TIMER lower half\n"); + aerr("Failed to get the LPC17XX TIMER lower half\n"); return -ENODEV; } @@ -137,7 +137,7 @@ int pwm_devinit(void) ret = pwm_register("/dev/timer0", timer); if (ret < 0) { - adbg("timer_register failed: %d\n", ret); + aerr("timer_register failed: %d\n", ret); return ret; } diff --git a/configs/lpcxpresso-lpc1115/src/lpc11_ssp.c b/configs/lpcxpresso-lpc1115/src/lpc11_ssp.c index 22e07f92f3..be82e42668 100644 --- a/configs/lpcxpresso-lpc1115/src/lpc11_ssp.c +++ b/configs/lpcxpresso-lpc1115/src/lpc11_ssp.c @@ -64,7 +64,7 @@ #undef SSP_VERBOSE /* Define to enable verbose debug */ #ifdef SSP_DEBUG -# define sspdbg llerr +# define ssperr llerr # ifdef SSP_VERBOSE # define sspinfo llerr # else @@ -72,7 +72,7 @@ # endif #else # undef SSP_VERBOSE -# define sspdbg(x...) +# define ssperr(x...) # define sspinfo(x...) #endif @@ -154,7 +154,7 @@ void weak_function lpcxpresso_sspdev_initialize(void) #ifdef CONFIG_LPC17_SSP0 void lpc11_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc11_ssp0select() Entry"); #warning "Assert CS here (false)" @@ -164,7 +164,7 @@ void lpc11_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc11_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspdbg("Returning SPI_STATUS_PRESENT\n"); + ssperr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } #endif @@ -172,7 +172,7 @@ uint8_t lpc11_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_LPC17_SSP1 void lpc11_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc11_ssp1select() Entry"); if (devid == SPIDEV_MMCSD) @@ -200,12 +200,12 @@ uint8_t lpc11_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) if (lpc11_gpioread(LPCXPRESSO_SD_CD) == 0) { - sspdbg("Returning SPI_STATUS_PRESENT\n"); + ssperr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } } - sspdbg("Returning zero\n"); + ssperr("Returning zero\n"); return 0; } #endif diff --git a/configs/lpcxpresso-lpc1768/src/lpc17_adc.c b/configs/lpcxpresso-lpc1768/src/lpc17_adc.c index dd7fc837ea..3cb72e2e93 100644 --- a/configs/lpcxpresso-lpc1768/src/lpc17_adc.c +++ b/configs/lpcxpresso-lpc1768/src/lpc17_adc.c @@ -99,7 +99,7 @@ int board_adc_setup(void) adc = lpc17_adcinitialize(); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -108,7 +108,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/lpcxpresso-lpc1768/src/lpc17_dac.c b/configs/lpcxpresso-lpc1768/src/lpc17_dac.c index f27c4edf61..73657d135a 100644 --- a/configs/lpcxpresso-lpc1768/src/lpc17_dac.c +++ b/configs/lpcxpresso-lpc1768/src/lpc17_dac.c @@ -79,14 +79,14 @@ int dac_devinit(void) dac = lpc17_dacinitialize(); if (dac == NULL) { - adbg("ERROR: Failed to get dac interface\n"); + aerr("ERROR: Failed to get dac interface\n"); return -ENODEV; } ret = dac_register("/dev/dac0", dac); if (ret < 0) { - adbg("dac_register failed: %d\n", ret); + aerr("dac_register failed: %d\n", ret); return ret; } diff --git a/configs/lpcxpresso-lpc1768/src/lpc17_leds.c b/configs/lpcxpresso-lpc1768/src/lpc17_leds.c index b6d77696b3..011854e7c3 100644 --- a/configs/lpcxpresso-lpc1768/src/lpc17_leds.c +++ b/configs/lpcxpresso-lpc1768/src/lpc17_leds.c @@ -61,14 +61,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/lpcxpresso-lpc1768/src/lpc17_oled.c b/configs/lpcxpresso-lpc1768/src/lpc17_oled.c index 9b93b6e48b..4b3b9f5e12 100644 --- a/configs/lpcxpresso-lpc1768/src/lpc17_oled.c +++ b/configs/lpcxpresso-lpc1768/src/lpc17_oled.c @@ -85,11 +85,11 @@ #endif #ifdef CONFIG_DEBUG_LCD -# define ugdbg(format, ...) info(format, ##__VA_ARGS__) +# define ugerr(format, ...) info(format, ##__VA_ARGS__) # define oleddc_dumpgpio(m) lpc17_dumpgpio(LPCXPRESSO_OLED_POWER, m) # define oledcs_dumpgpio(m) lpc17_dumpgpio(LPCXPRESSO_OLED_CS, m) #else -# define ugdbg(x...) +# define ugerr(x...) # define oleddc_dumpgpio(m) # define oledcs_dumpgpio(m) #endif diff --git a/configs/lpcxpresso-lpc1768/src/lpc17_pwm.c b/configs/lpcxpresso-lpc1768/src/lpc17_pwm.c index 565c33a181..746a529a3b 100644 --- a/configs/lpcxpresso-lpc1768/src/lpc17_pwm.c +++ b/configs/lpcxpresso-lpc1768/src/lpc17_pwm.c @@ -98,7 +98,7 @@ int board_pwm_setup(void) pwm = lpc17_pwminitialize(0); if (!pwm) { - adbg("Failed to get the LPC17XX PWM lower half\n"); + aerr("Failed to get the LPC17XX PWM lower half\n"); return -ENODEV; } @@ -107,14 +107,14 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } mcpwm = lpc17_mcpwminitialize(0); if (!mcpwm) { - adbg("Failed to get the LPC17XX MOTOR PWM lower half\n"); + aerr("Failed to get the LPC17XX MOTOR PWM lower half\n"); return -ENODEV; } @@ -123,14 +123,14 @@ int board_pwm_setup(void) ret = pwm_register("/dev/mcpwm0", mcpwm); if (ret < 0) { - adbg("mcpwm_register failed: %d\n", ret); + aerr("mcpwm_register failed: %d\n", ret); return ret; } timer = lpc17_timerinitialize(0); if (!timer) { - adbg("Failed to get the LPC17XX TIMER lower half\n"); + aerr("Failed to get the LPC17XX TIMER lower half\n"); return -ENODEV; } @@ -139,7 +139,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/timer0", timer); if (ret < 0) { - adbg("timer_register failed: %d\n", ret); + aerr("timer_register failed: %d\n", ret); return ret; } diff --git a/configs/lpcxpresso-lpc1768/src/lpc17_ssp.c b/configs/lpcxpresso-lpc1768/src/lpc17_ssp.c index 4de4225e13..082210b880 100644 --- a/configs/lpcxpresso-lpc1768/src/lpc17_ssp.c +++ b/configs/lpcxpresso-lpc1768/src/lpc17_ssp.c @@ -64,7 +64,7 @@ #undef SSP_VERBOSE /* Define to enable verbose debug */ #ifdef SSP_DEBUG -# define sspdbg llerr +# define ssperr llerr # ifdef SSP_VERBOSE # define sspinfo llerr # else @@ -72,7 +72,7 @@ # endif #else # undef SSP_VERBOSE -# define sspdbg(x...) +# define ssperr(x...) # define sspinfo(x...) #endif @@ -154,7 +154,7 @@ void weak_function lpcxpresso_sspdev_initialize(void) #ifdef CONFIG_LPC17_SSP0 void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_ssp0select() Entry"); #warning "Assert CS here (false)" @@ -164,7 +164,7 @@ void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspdbg("Returning SPI_STATUS_PRESENT\n"); + ssperr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } #endif @@ -172,7 +172,7 @@ uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_LPC17_SSP1 void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_ssp1select() Entry"); if (devid == SPIDEV_MMCSD) @@ -200,12 +200,12 @@ uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) if (lpc17_gpioread(LPCXPRESSO_SD_CD) == 0) { - sspdbg("Returning SPI_STATUS_PRESENT\n"); + ssperr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } } - sspdbg("Returning zero\n"); + ssperr("Returning zero\n"); return 0; } #endif diff --git a/configs/maple/src/stm32_lcd.c b/configs/maple/src/stm32_lcd.c index 13b7ba2c62..c273ba54c6 100644 --- a/configs/maple/src/stm32_lcd.c +++ b/configs/maple/src/stm32_lcd.c @@ -84,9 +84,9 @@ #endif #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) info(format, ##__VA_ARGS__) +# define lcderr(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) #endif /**************************************************************************** @@ -107,7 +107,7 @@ static int up_lcdextcominisr(int irq, void *context) STM32_TIM_ACKINT(tim, 0); if (g_isr == NULL) { - lcddbg("error, irq not attached, disabled\n"); + lcderr("error, irq not attached, disabled\n"); STM32_TIM_DISABLEINT(tim, 0); return OK; } @@ -117,7 +117,7 @@ static int up_lcdextcominisr(int irq, void *context) static int up_lcdirqattach(xcpt_t isr) { - lcddbg("%s IRQ\n", isr == NULL ? "Detach" : "Attach"); + lcderr("%s IRQ\n", isr == NULL ? "Detach" : "Attach"); if (isr != NULL) { @@ -135,7 +135,7 @@ static int up_lcdirqattach(xcpt_t isr) static void up_lcddispcontrol(bool on) { - lcddbg("set: %s\n", on ? "on" : "off"); + lcderr("set: %s\n", on ? "on" : "off"); if (on) { @@ -159,7 +159,7 @@ static void up_lcdsetpolarity(bool pol) static void up_lcdsetvcomfreq(unsigned int freq) { - lcddbg("freq: %d\n", freq); + lcderr("freq: %d\n", freq); DEBUGASSERT(freq >= 1 && freq <= 60); STM32_TIM_SETPERIOD(tim, TIMER_FREQ / freq); } @@ -190,17 +190,17 @@ static FAR struct memlcd_priv_s memlcd_priv = FAR int board_lcd_initialize(void) { - lcddbg("Initializing lcd\n"); + lcderr("Initializing lcd\n"); - lcddbg("init spi1\n"); + lcderr("init spi1\n"); spi = stm32_spibus_initialize(1); DEBUGASSERT(spi); - lcddbg("configure related io\n"); + lcderr("configure related io\n"); stm32_configgpio(GPIO_MEMLCD_EXTCOMIN); stm32_configgpio(GPIO_MEMLCD_DISP); - lcddbg("configure EXTCOMIN timer\n"); + lcderr("configure EXTCOMIN timer\n"); if (tim == NULL) { tim = stm32_tim_init(2); @@ -210,7 +210,7 @@ FAR int board_lcd_initialize(void) STM32_TIM_SETMODE(tim, STM32_TIM_MODE_UP); } - lcddbg("init lcd\n"); + lcderr("init lcd\n"); l_lcddev = memlcd_initialize(spi, &memlcd_priv, 0); DEBUGASSERT(l_lcddev); diff --git a/configs/maple/src/stm32_leds.c b/configs/maple/src/stm32_leds.c index 21ebcd63e7..dd7bc6d305 100644 --- a/configs/maple/src/stm32_leds.c +++ b/configs/maple/src/stm32_leds.c @@ -62,10 +62,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/maple/src/stm32_spi.c b/configs/maple/src/stm32_spi.c index 367c3923af..881adf8d72 100644 --- a/configs/maple/src/stm32_spi.c +++ b/configs/maple/src/stm32_spi.c @@ -67,14 +67,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -134,7 +134,7 @@ void weak_function stm32_spidev_initialize(void) void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); # if defined(CONFIG_LCD_SHARP_MEMLCD) if (devid == SPIDEV_DISPLAY) diff --git a/configs/mbed/src/lpc17_adc.c b/configs/mbed/src/lpc17_adc.c index aea44427e0..b8f0724d7f 100644 --- a/configs/mbed/src/lpc17_adc.c +++ b/configs/mbed/src/lpc17_adc.c @@ -101,7 +101,7 @@ int board_adc_setup(void) adc = lpc17_adcinitialize(); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -110,7 +110,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/mbed/src/lpc17_dac.c b/configs/mbed/src/lpc17_dac.c index 6f18a1411d..d3a4733278 100644 --- a/configs/mbed/src/lpc17_dac.c +++ b/configs/mbed/src/lpc17_dac.c @@ -81,14 +81,14 @@ int dac_devinit(void) dac = lpc17_dacinitialize(); if (dac == NULL) { - adbg("ERROR: Failed to get dac interface\n"); + aerr("ERROR: Failed to get dac interface\n"); return -ENODEV; } ret = dac_register("/dev/dac0", dac); if (ret < 0) { - adbg("dac_register failed: %d\n", ret); + aerr("dac_register failed: %d\n", ret); return ret; } diff --git a/configs/mbed/src/lpc17_hidkbd.c b/configs/mbed/src/lpc17_hidkbd.c index 38fbca9033..fc17d82de7 100644 --- a/configs/mbed/src/lpc17_hidkbd.c +++ b/configs/mbed/src/lpc17_hidkbd.c @@ -76,7 +76,7 @@ struct usbhost_connection_s *arch_usbhost_initialize(void) ret = usbhost_hub_initialize(); if (ret < 0) { - udbg("ERROR: usbhost_hub_initialize failed: %d\n", ret); + uerr("ERROR: usbhost_hub_initialize failed: %d\n", ret); } #endif diff --git a/configs/mbed/src/lpc17_leds.c b/configs/mbed/src/lpc17_leds.c index ad5d98ad04..9b318c34a7 100644 --- a/configs/mbed/src/lpc17_leds.c +++ b/configs/mbed/src/lpc17_leds.c @@ -65,14 +65,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/mbed/src/lpc17_pwm.c b/configs/mbed/src/lpc17_pwm.c index d3021d7063..6cc6f33101 100644 --- a/configs/mbed/src/lpc17_pwm.c +++ b/configs/mbed/src/lpc17_pwm.c @@ -100,7 +100,7 @@ int board_pwm_setup(void) pwm = lpc17_pwminitialize(0); if (!pwm) { - adbg("Failed to get the LPC17XX PWM lower half\n"); + aerr("Failed to get the LPC17XX PWM lower half\n"); return -ENODEV; } @@ -109,14 +109,14 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } mcpwm = lpc17_mcpwminitialize(0); if (!mcpwm) { - adbg("Failed to get the LPC17XX MOTOR PWM lower half\n"); + aerr("Failed to get the LPC17XX MOTOR PWM lower half\n"); return -ENODEV; } @@ -125,14 +125,14 @@ int board_pwm_setup(void) ret = pwm_register("/dev/mcpwm0", mcpwm); if (ret < 0) { - adbg("mcpwm_register failed: %d\n", ret); + aerr("mcpwm_register failed: %d\n", ret); return ret; } timer = lpc17_timerinitialize(0); if (!timer) { - adbg("Failed to get the LPC17XX TIMER lower half\n"); + aerr("Failed to get the LPC17XX TIMER lower half\n"); return -ENODEV; } @@ -141,7 +141,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/timer0", timer); if (ret < 0) { - adbg("timer_register failed: %d\n", ret); + aerr("timer_register failed: %d\n", ret); return ret; } diff --git a/configs/mcu123-lpc214x/src/lpc2148_spi1.c b/configs/mcu123-lpc214x/src/lpc2148_spi1.c index 1a550e1aaa..336a0b0d61 100644 --- a/configs/mcu123-lpc214x/src/lpc2148_spi1.c +++ b/configs/mcu123-lpc214x/src/lpc2148_spi1.c @@ -89,14 +89,14 @@ /* Enables debug output from this file */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -232,14 +232,14 @@ static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel { /* Enable slave select (low enables) */ - spidbg("CS asserted\n"); + spierr("CS asserted\n"); putreg32(bit, CS_CLR_REGISTER); } else { /* Disable slave select (low enables) */ - spidbg("CS de-asserted\n"); + spierr("CS de-asserted\n"); putreg32(bit, CS_SET_REGISTER); /* Wait for the TX FIFO not full indication */ @@ -296,7 +296,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) divisor = (divisor + 1) & ~1; putreg8(divisor, LPC214X_SPI1_CPSR); - spidbg("Frequency %d->%d\n", frequency, LPC214X_PCLKFREQ / divisor); + spierr("Frequency %d->%d\n", frequency, LPC214X_PCLKFREQ / divisor); return LPC214X_PCLKFREQ / divisor; } @@ -321,7 +321,7 @@ static uint8_t spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) * board. */ - spidbg("Return SPI_STATUS_PRESENT\n"); + spierr("Return SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } @@ -392,7 +392,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) /* Get the value from the RX FIFO and return it */ regval = getreg16(LPC214X_SPI1_DR); - spidbg("%04x->%04x\n", wd, regval); + spierr("%04x->%04x\n", wd, regval); return regval; } @@ -422,7 +422,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size /* Loop while thre are bytes remaining to be sent */ - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords > 0) { /* While the TX FIFO is not full and there are bytes left to send */ @@ -439,7 +439,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size /* Then discard all card responses until the RX & TX FIFOs are emptied. */ - spidbg("discarding\n"); + spierr("discarding\n"); do { /* Is there anything in the RX fifo? */ @@ -493,7 +493,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw /* While there is remaining to be sent (and no synchronization error has occurred) */ - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords || rxpending) { /* Fill the transmit FIFO with 0xff... diff --git a/configs/mikroe-stm32f4/src/stm32_mio283qt2.c b/configs/mikroe-stm32f4/src/stm32_mio283qt2.c index 9abd9ebe04..f889efe80b 100644 --- a/configs/mikroe-stm32f4/src/stm32_mio283qt2.c +++ b/configs/mikroe-stm32f4/src/stm32_mio283qt2.c @@ -120,10 +120,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -519,7 +519,7 @@ int board_lcd_initialize(void) g_stm32f4_lcd.drvr = mio283qt2_lcdinitialize(&g_stm32f4_lcd.dev); if (!g_stm32f4_lcd.drvr) { - lcddbg("ERROR: mio283qt2_lcdinitialize failed\n"); + lcderr("ERROR: mio283qt2_lcdinitialize failed\n"); return -ENODEV; } } diff --git a/configs/mikroe-stm32f4/src/stm32_mio283qt9a.c b/configs/mikroe-stm32f4/src/stm32_mio283qt9a.c index c007e5aebe..ae2e8555a4 100644 --- a/configs/mikroe-stm32f4/src/stm32_mio283qt9a.c +++ b/configs/mikroe-stm32f4/src/stm32_mio283qt9a.c @@ -121,10 +121,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -520,7 +520,7 @@ int board_lcd_initialize(void) g_stm32f4_lcd.drvr = mio283qt9a_lcdinitialize(&g_stm32f4_lcd.dev); if (!g_stm32f4_lcd.drvr) { - lcddbg("ERROR: mio283qt9a_lcdinitialize failed\n"); + lcderr("ERROR: mio283qt9a_lcdinitialize failed\n"); return -ENODEV; } } diff --git a/configs/mikroe-stm32f4/src/stm32_pwm.c b/configs/mikroe-stm32f4/src/stm32_pwm.c index 11f0ea7c25..11a0f2b38c 100644 --- a/configs/mikroe-stm32f4/src/stm32_pwm.c +++ b/configs/mikroe-stm32f4/src/stm32_pwm.c @@ -119,7 +119,7 @@ int board_pwm_setup(void) pwm = stm32_pwminitialize(STM32F4DISCOVERY_PWMTIMER); if (!pwm) { - dbg("Failed to get the STM32 PWM lower half\n"); + err("Failed to get the STM32 PWM lower half\n"); return -ENODEV; } @@ -128,7 +128,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/mikroe-stm32f4/src/stm32_qencoder.c b/configs/mikroe-stm32f4/src/stm32_qencoder.c index e2014a7530..4cd7738402 100644 --- a/configs/mikroe-stm32f4/src/stm32_qencoder.c +++ b/configs/mikroe-stm32f4/src/stm32_qencoder.c @@ -149,7 +149,7 @@ int qe_devinit(void) ret = stm32_qeinitialize("/dev/qe0", TIMID); if (ret < 0) { - sndbg("stm32_qeinitialize failed: %d\n", ret); + snerr("stm32_qeinitialize failed: %d\n", ret); return ret; } diff --git a/configs/mikroe-stm32f4/src/stm32_spi.c b/configs/mikroe-stm32f4/src/stm32_spi.c index 1df1b6ee2f..f38ede5164 100644 --- a/configs/mikroe-stm32f4/src/stm32_spi.c +++ b/configs/mikroe-stm32f4/src/stm32_spi.c @@ -69,7 +69,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -77,7 +77,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -211,7 +211,7 @@ uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -223,7 +223,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/mikroe-stm32f4/src/stm32_touchscreen.c b/configs/mikroe-stm32f4/src/stm32_touchscreen.c index 9965812de8..35b05c439e 100644 --- a/configs/mikroe-stm32f4/src/stm32_touchscreen.c +++ b/configs/mikroe-stm32f4/src/stm32_touchscreen.c @@ -530,7 +530,7 @@ static uint16_t tc_adc_read_sample(void) if (count > 0) { - idbg("Count = %d\n", count); + ierr("Count = %d\n", count); } return retval; @@ -1017,7 +1017,7 @@ static void tc_worker(FAR void *arg) /* Notify any waiters that new touchscreen data is available */ - idbg("1:X=%d, Y=%d\n", priv->sample.x, priv->sample.y); + ierr("1:X=%d, Y=%d\n", priv->sample.x, priv->sample.y); tc_notify(priv); } @@ -1089,7 +1089,7 @@ static void tc_worker(FAR void *arg) /* Notify any waiters that nes touchscreen data is available */ - idbg("2:X=%d, Y=%d\n", priv->sample.x, priv->sample.y); + ierr("2:X=%d, Y=%d\n", priv->sample.x, priv->sample.y); tc_notify(priv); } @@ -1413,7 +1413,7 @@ static int tc_poll(FAR struct file *filep, FAR struct pollfd *fds, if ((fds->events & POLLIN) == 0) { - idbg("Missing POLLIN: revents: %08x\n", fds->revents); + ierr("Missing POLLIN: revents: %08x\n", fds->revents); ret = -EDEADLK; goto errout; } @@ -1438,7 +1438,7 @@ static int tc_poll(FAR struct file *filep, FAR struct pollfd *fds, if (i >= CONFIG_TOUCHSCREEN_NPOLLWAITERS) { - idbg("No availabled slot found: %d\n", i); + ierr("No availabled slot found: %d\n", i); fds->priv = NULL; ret = -EBUSY; goto errout; @@ -1533,7 +1533,7 @@ int board_tsc_setup(int minor) priv = (FAR struct tc_dev_s *)kmm_malloc(sizeof(struct tc_dev_s)); if (!priv) { - idbg("kmm_malloc(%d) failed\n", sizeof(struct tc_dev_s)); + ierr("kmm_malloc(%d) failed\n", sizeof(struct tc_dev_s)); return -ENOMEM; } #endif @@ -1552,7 +1552,7 @@ int board_tsc_setup(int minor) ret = register_driver(devname, &tc_fops, 0666, priv); if (ret < 0) { - idbg("register_driver() failed: %d\n", ret); + ierr("register_driver() failed: %d\n", ret); goto errout_with_priv; } @@ -1564,7 +1564,7 @@ int board_tsc_setup(int minor) ret = work_queue(HPWORK, &priv->work, tc_worker, priv, 0); if (ret != 0) { - idbg("Failed to queue work: %d\n", ret); + ierr("Failed to queue work: %d\n", ret); goto errout_with_priv; } diff --git a/configs/mikroe-stm32f4/src/stm32_usb.c b/configs/mikroe-stm32f4/src/stm32_usb.c index 360dc363ba..2553d0d97d 100644 --- a/configs/mikroe-stm32f4/src/stm32_usb.c +++ b/configs/mikroe-stm32f4/src/stm32_usb.c @@ -184,7 +184,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the mass storage class: %d\n", ret); + uerr("ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -194,7 +194,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + uerr("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif diff --git a/configs/mikroe-stm32f4/src/stm32_vs1053.c b/configs/mikroe-stm32f4/src/stm32_vs1053.c index d8506e34a6..e45ebfad7c 100644 --- a/configs/mikroe-stm32f4/src/stm32_vs1053.c +++ b/configs/mikroe-stm32f4/src/stm32_vs1053.c @@ -197,7 +197,7 @@ void up_vs1053initialize(FAR struct spi_dev_s* spi) ret = audio_register(name, pVs1053); if (ret < 0) { - auddbg("up_vs1053initialize: Failed to register VS1053 Audio device\n"); + auderr("up_vs1053initialize: Failed to register VS1053 Audio device\n"); } audllinfo("Bound SPI port to VS1053 device %s\n", name); diff --git a/configs/mirtoo/README.txt b/configs/mirtoo/README.txt index 483e1d50a2..35fbb83c6a 100644 --- a/configs/mirtoo/README.txt +++ b/configs/mirtoo/README.txt @@ -592,7 +592,7 @@ Analog Input spi = pic32mx_spibus_initialize(2); if (!spi) { - dbg("ERROR: Failed to initialize SPI port 2\n"); + err("ERROR: Failed to initialize SPI port 2\n"); return -ENODEV; } @@ -601,7 +601,7 @@ Analog Input handle = pga11x_initialize(spi); if (!handle) { - dbg("ERROR: Failed to bind SPI port 2 to the PGA117 driver\n"); + err("ERROR: Failed to bind SPI port 2 to the PGA117 driver\n"); return -ENODEV; } @@ -617,7 +617,7 @@ Analog Input ret = pga11x_select(handle, &settings); if (ret < 0) { - dbg("ERROR: Failed to select channel 2, gain 2\n"); + err("ERROR: Failed to select channel 2, gain 2\n"); return -EIO; } diff --git a/configs/mirtoo/src/pic32_appinit.c b/configs/mirtoo/src/pic32_appinit.c index 9fad1495bf..2cf57476dd 100644 --- a/configs/mirtoo/src/pic32_appinit.c +++ b/configs/mirtoo/src/pic32_appinit.c @@ -125,7 +125,7 @@ int board_app_initialize(uintptr_t arg) spi = pic32mx_spibus_initialize(2); if (!spi) { - fdbg("ERROR: Failed to initialize SPI port 2\n"); + ferr("ERROR: Failed to initialize SPI port 2\n"); return -ENODEV; } @@ -134,7 +134,7 @@ int board_app_initialize(uintptr_t arg) mtd = sst25_initialize(spi); if (!mtd) { - fdbg("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n"); + ferr("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n"); return -ENODEV; } @@ -144,7 +144,7 @@ int board_app_initialize(uintptr_t arg) ret = ftl_initialize(CONFIG_NSH_MMCSDMINOR, mtd); if (ret < 0) { - fdbg("ERROR: Initialize the FTL layer\n"); + ferr("ERROR: Initialize the FTL layer\n"); return ret; } #else @@ -153,7 +153,7 @@ int board_app_initialize(uintptr_t arg) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", -ret); + ferr("ERROR: NXFFS initialization failed: %d\n", -ret); return ret; } @@ -162,7 +162,7 @@ int board_app_initialize(uintptr_t arg) ret = mount(NULL, "/mnt/sst25", "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif diff --git a/configs/mirtoo/src/pic32_leds.c b/configs/mirtoo/src/pic32_leds.c index bd5a9cbc3f..9d42fb6c25 100644 --- a/configs/mirtoo/src/pic32_leds.c +++ b/configs/mirtoo/src/pic32_leds.c @@ -94,7 +94,7 @@ /* Debug ********************************************************************/ #if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_LEDS) -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else @@ -103,7 +103,7 @@ #else # undef CONFIG_DEBUG_LEDS # undef CONFIG_DEBUG_INFO -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/mirtoo/src/pic32_spi2.c b/configs/mirtoo/src/pic32_spi2.c index 127c01b833..0a857e9735 100644 --- a/configs/mirtoo/src/pic32_spi2.c +++ b/configs/mirtoo/src/pic32_spi2.c @@ -98,10 +98,10 @@ */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # define spiinfo llinfo #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -175,7 +175,7 @@ enum spi_dev_e; void pic32mx_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_FLASH) { diff --git a/configs/moteino-mega/src/avr_leds.c b/configs/moteino-mega/src/avr_leds.c index 8920ebbe40..c6f7712e33 100644 --- a/configs/moteino-mega/src/avr_leds.c +++ b/configs/moteino-mega/src/avr_leds.c @@ -62,14 +62,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/ne64badge/src/m9s12_buttons.c b/configs/ne64badge/src/m9s12_buttons.c index b4de029b42..ecd4c6741b 100644 --- a/configs/ne64badge/src/m9s12_buttons.c +++ b/configs/ne64badge/src/m9s12_buttons.c @@ -61,7 +61,7 @@ #undef BUTTON_VERBOSE /* Define to enable verbose debug */ #ifdef BUTTON_DEBUG -# define btndbg llerr +# define btnerr llerr # ifdef BUTTON_VERBOSE # define btninfo llerr # else @@ -69,7 +69,7 @@ # endif #else # undef BUTTON_VERBOSE -# define btndbg(x...) +# define btnerr(x...) # define btninfo(x...) #endif diff --git a/configs/ne64badge/src/m9s12_leds.c b/configs/ne64badge/src/m9s12_leds.c index 6d82d0283d..1c8705a0f7 100644 --- a/configs/ne64badge/src/m9s12_leds.c +++ b/configs/ne64badge/src/m9s12_leds.c @@ -57,14 +57,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/ne64badge/src/m9s12_spi.c b/configs/ne64badge/src/m9s12_spi.c index c1586210f2..051c98c065 100644 --- a/configs/ne64badge/src/m9s12_spi.c +++ b/configs/ne64badge/src/m9s12_spi.c @@ -60,7 +60,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -68,7 +68,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/nucleo-144/src/stm32_appinitialize.c b/configs/nucleo-144/src/stm32_appinitialize.c index df411ad94e..447a2ee8f6 100644 --- a/configs/nucleo-144/src/stm32_appinitialize.c +++ b/configs/nucleo-144/src/stm32_appinitialize.c @@ -114,7 +114,7 @@ int board_app_initialize(uintptr_t arg) ret = stm32_spidev_bus_init(); if (ret != OK) { - fdbg("ERROR: Failed to initialize SPI interfaces: %d\n", ret); + ferr("ERROR: Failed to initialize SPI interfaces: %d\n", ret); return ret; } #endif @@ -126,7 +126,7 @@ int board_app_initialize(uintptr_t arg) ret = stm32_sdio_initialize(); if (ret != OK) { - fdbg("ERROR: Failed to initialize MMC/SD driver: %d\n", ret); + ferr("ERROR: Failed to initialize MMC/SD driver: %d\n", ret); return ret; } #endif diff --git a/configs/nucleo-144/src/stm32_autoleds.c b/configs/nucleo-144/src/stm32_autoleds.c index d09ca0114d..1a4756301b 100644 --- a/configs/nucleo-144/src/stm32_autoleds.c +++ b/configs/nucleo-144/src/stm32_autoleds.c @@ -59,10 +59,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/nucleo-144/src/stm32_sdio.c b/configs/nucleo-144/src/stm32_sdio.c index 84c34feae8..447740e40d 100644 --- a/configs/nucleo-144/src/stm32_sdio.c +++ b/configs/nucleo-144/src/stm32_sdio.c @@ -140,7 +140,7 @@ int stm32_sdio_initialize(void) g_sdio_dev = sdio_initialize(SDIO_SLOTNO); if (!g_sdio_dev) { - fdbg("Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); + ferr("Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); return -ENODEV; } @@ -151,7 +151,7 @@ int stm32_sdio_initialize(void) ret = mmcsd_slotinitialize(SDIO_MINOR, g_sdio_dev); if (ret != OK) { - fdbg("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + ferr("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } diff --git a/configs/nucleo-144/src/stm32_spi.c b/configs/nucleo-144/src/stm32_spi.c index 4b3dd05560..f94d02edc4 100644 --- a/configs/nucleo-144/src/stm32_spi.c +++ b/configs/nucleo-144/src/stm32_spi.c @@ -62,7 +62,7 @@ ************************************************************************************/ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -70,7 +70,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -228,7 +228,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32F7_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); stm32_gpiowrite(g_spigpio[i], !selected); } @@ -241,7 +241,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32F7_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); stm32_gpiowrite(g_spigpio[i], !selected); } @@ -254,7 +254,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32F7_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); stm32_gpiowrite(g_spigpio[i], !selected); } @@ -271,7 +271,7 @@ uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) void stm32_spi4select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); stm32_gpiowrite(g_spigpio[i], !selected); } @@ -288,7 +288,7 @@ uint8_t stm32_spi4status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) void stm32_spi5select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); stm32_gpiowrite(g_spigpio[i], !selected); } @@ -304,7 +304,7 @@ uint8_t stm32_spi5status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) # endif void stm32_spi5select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); stm32_gpiowrite(g_spigpio[i], !selected); } diff --git a/configs/nucleo-144/src/stm32_userleds.c b/configs/nucleo-144/src/stm32_userleds.c index 9325e07d19..15eb3039f0 100644 --- a/configs/nucleo-144/src/stm32_userleds.c +++ b/configs/nucleo-144/src/stm32_userleds.c @@ -61,10 +61,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/nucleo-f303re/src/stm32_adc.c b/configs/nucleo-f303re/src/stm32_adc.c index 35d8ad5c3f..98282ba957 100644 --- a/configs/nucleo-f303re/src/stm32_adc.c +++ b/configs/nucleo-f303re/src/stm32_adc.c @@ -222,7 +222,7 @@ int board_adc_setup(void) adc = stm32_adcinitialize(ADC_PORT, g_chanlist, ADC_NCHANNELS); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -231,7 +231,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/nucleo-f303re/src/stm32_autoleds.c b/configs/nucleo-f303re/src/stm32_autoleds.c index cd20b4eea7..5941f5eb9a 100644 --- a/configs/nucleo-f303re/src/stm32_autoleds.c +++ b/configs/nucleo-f303re/src/stm32_autoleds.c @@ -62,10 +62,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/nucleo-f303re/src/stm32_can.c b/configs/nucleo-f303re/src/stm32_can.c index 96d5351f7e..b89826195e 100644 --- a/configs/nucleo-f303re/src/stm32_can.c +++ b/configs/nucleo-f303re/src/stm32_can.c @@ -60,12 +60,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -111,7 +111,7 @@ int board_can_initialize(void) can = stm32_caninitialize(1); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -120,7 +120,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/nucleo-f303re/src/stm32_pwm.c b/configs/nucleo-f303re/src/stm32_pwm.c index fd7bf916e3..da5fc9c2d6 100644 --- a/configs/nucleo-f303re/src/stm32_pwm.c +++ b/configs/nucleo-f303re/src/stm32_pwm.c @@ -61,12 +61,12 @@ /* Non-standard debug that may be enabled just for testing PWM */ #ifdef CONFIG_DEBUG_PWM -# define pwmdbg dbg +# define pwmerr err # define pwminfo info # define pwmllerr llerr # define pwmllinfo llinfo #else -# define pwmdbg(x...) +# define pwmerr(x...) # define pwminfo(x...) # define pwmllerr(x...) # define pwmllinfo(x...) @@ -112,7 +112,7 @@ int board_pwm_setup(void) pwm = stm32_pwminitialize(NUCLEO_F303RE_PWMTIMER); if (pwm == NULL) { - pwmdbg("Failed to get the STM32 PWM lower half\n"); + pwmerr("Failed to get the STM32 PWM lower half\n"); return -ENODEV; } @@ -121,7 +121,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - pwmdbg("pwm_register failed: %d\n", ret); + pwmerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/nucleo-f303re/src/stm32_spi.c b/configs/nucleo-f303re/src/stm32_spi.c index 8bf3a5a270..800b0f0e96 100644 --- a/configs/nucleo-f303re/src/stm32_spi.c +++ b/configs/nucleo-f303re/src/stm32_spi.c @@ -66,7 +66,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -74,7 +74,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -132,7 +132,7 @@ void weak_function stm32_spidev_initialize(void) void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #if defined(CONFIG_LCD_SSD1351) if (devid == SPIDEV_DISPLAY) @@ -152,7 +152,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -165,7 +165,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/nucleo-f303re/src/stm32_ssd1351.c b/configs/nucleo-f303re/src/stm32_ssd1351.c index e58561c53d..b915c110bc 100644 --- a/configs/nucleo-f303re/src/stm32_ssd1351.c +++ b/configs/nucleo-f303re/src/stm32_ssd1351.c @@ -74,10 +74,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lcderr(format, ...) err(format, ##__VA_ARGS__) # define lcdinfo(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -114,7 +114,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) spi = stm32_spibus_initialize(1); if (spi == NULL) { - lcddbg("Failed to initialize SPI port 1\n"); + lcderr("Failed to initialize SPI port 1\n"); } else { @@ -123,7 +123,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) dev = ssd1351_initialize(spi, devno); if (dev == NULL) { - lcddbg("Failed to bind SPI port 1 to OLED %d: %d\n", devno); + lcderr("Failed to bind SPI port 1 to OLED %d: %d\n", devno); } else { diff --git a/configs/nucleo-f303re/src/stm32_userleds.c b/configs/nucleo-f303re/src/stm32_userleds.c index cd23d08ba5..d1969ad0d6 100644 --- a/configs/nucleo-f303re/src/stm32_userleds.c +++ b/configs/nucleo-f303re/src/stm32_userleds.c @@ -61,10 +61,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/nucleo-f4x1re/src/stm32_adc.c b/configs/nucleo-f4x1re/src/stm32_adc.c index e6aaf7cc4c..0a82058cfe 100644 --- a/configs/nucleo-f4x1re/src/stm32_adc.c +++ b/configs/nucleo-f4x1re/src/stm32_adc.c @@ -137,7 +137,7 @@ int board_adc_initialize(void) adc = stm32_adcinitialize(1, g_adc1_chanlist, ADC1_NCHANNELS); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -146,7 +146,7 @@ int board_adc_initialize(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } #endif diff --git a/configs/nucleo-f4x1re/src/stm32_ajoystick.c b/configs/nucleo-f4x1re/src/stm32_ajoystick.c index b412069d54..d4cb9d374e 100644 --- a/configs/nucleo-f4x1re/src/stm32_ajoystick.c +++ b/configs/nucleo-f4x1re/src/stm32_ajoystick.c @@ -212,14 +212,14 @@ static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower, int errcode = get_errno(); if (errcode != EINTR) { - idbg("ERROR: read failed: %d\n", errcode); + ierr("ERROR: read failed: %d\n", errcode); } return -errcode; } else if (nread < NJOYSTICK_CHANNELS * sizeof(struct adc_msg_s)) { - idbg("ERROR: read too small: %ld\n", (long)nread); + ierr("ERROR: read too small: %ld\n", (long)nread); return -EIO; } @@ -266,7 +266,7 @@ static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower, if (have != 3) { - idbg("ERROR: Could not find joystick channels\n"); + ierr("ERROR: Could not find joystick channels\n"); return -EIO; } @@ -460,7 +460,7 @@ int board_ajoy_initialize(void) ret = board_adc_initialize(); if (ret < 0) { - idbg("ERROR: board_adc_initialize() failed: %d\n", ret); + ierr("ERROR: board_adc_initialize() failed: %d\n", ret); return ret; } @@ -470,7 +470,7 @@ int board_ajoy_initialize(void) if (fd < 0) { int errcode = get_errno(); - idbg("ERROR: Failed to open /dev/adc0: %d\n", errcode); + ierr("ERROR: Failed to open /dev/adc0: %d\n", errcode); return -errcode; } @@ -481,7 +481,7 @@ int board_ajoy_initialize(void) ret = file_detach(fd, &g_adcfile); if (ret < 0) { - idbg("ERROR: Failed to detach from file descriptor: %d\n", ret); + ierr("ERROR: Failed to detach from file descriptor: %d\n", ret); (void)close(fd); return ret; } @@ -506,7 +506,7 @@ int board_ajoy_initialize(void) ret = ajoy_register("/dev/ajoy0", &g_ajoylower); if (ret < 0) { - idbg("ERROR: ajoy_register failed: %d\n", ret); + ierr("ERROR: ajoy_register failed: %d\n", ret); #ifndef NO_JOYSTICK_ADC file_close_detached(&g_adcfile); #endif diff --git a/configs/nucleo-f4x1re/src/stm32_autoleds.c b/configs/nucleo-f4x1re/src/stm32_autoleds.c index 306787b1a9..242517858b 100644 --- a/configs/nucleo-f4x1re/src/stm32_autoleds.c +++ b/configs/nucleo-f4x1re/src/stm32_autoleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/nucleo-f4x1re/src/stm32_spi.c b/configs/nucleo-f4x1re/src/stm32_spi.c index 172998ff55..ea86096b6f 100644 --- a/configs/nucleo-f4x1re/src/stm32_spi.c +++ b/configs/nucleo-f4x1re/src/stm32_spi.c @@ -67,14 +67,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -111,7 +111,7 @@ void weak_function stm32_spidev_initialize(void) g_spi1 = stm32_spibus_initialize(1); if (!g_spi1) { - spidbg("[boot] FAILED to initialize SPI port 1\n"); + spierr("[boot] FAILED to initialize SPI port 1\n"); } #ifdef CONFIG_WL_CC3000 @@ -166,7 +166,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #ifdef CONFIG_WL_CC3000 if (devid == SPIDEV_WIRELESS) @@ -192,7 +192,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #ifdef CONFIG_WL_CC3000 if (devid == SPIDEV_WIRELESS) @@ -211,7 +211,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/nucleo-f4x1re/src/stm32_userleds.c b/configs/nucleo-f4x1re/src/stm32_userleds.c index 951b2b7cfe..b75a12d63b 100644 --- a/configs/nucleo-f4x1re/src/stm32_userleds.c +++ b/configs/nucleo-f4x1re/src/stm32_userleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/nucleo-f4x1re/src/stm32_wireless.c b/configs/nucleo-f4x1re/src/stm32_wireless.c index 2ed8a1bd69..07680a724d 100644 --- a/configs/nucleo-f4x1re/src/stm32_wireless.c +++ b/configs/nucleo-f4x1re/src/stm32_wireless.c @@ -280,7 +280,7 @@ int wireless_archinitialize(size_t max_rx_size) /* Init SPI bus */ - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(CONFIG_CC3000_DEVMINOR == 0); #ifdef CONFIG_CC3000_PROBES @@ -295,7 +295,7 @@ int wireless_archinitialize(size_t max_rx_size) spi = stm32_spibus_initialize(CONFIG_CC3000_SPIDEV); if (!spi) { - idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); + ierr("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); return -ENODEV; } @@ -305,7 +305,7 @@ int wireless_archinitialize(size_t max_rx_size) int ret = cc3000_register(spi, &g_cc3000_info.dev, CONFIG_CC3000_DEVMINOR); if (ret < 0) { - idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); + ierr("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); return -ENODEV; } diff --git a/configs/nucleo-l476rg/src/stm32_adc.c b/configs/nucleo-l476rg/src/stm32_adc.c index 45329b3817..0148f769ad 100644 --- a/configs/nucleo-l476rg/src/stm32_adc.c +++ b/configs/nucleo-l476rg/src/stm32_adc.c @@ -137,7 +137,7 @@ int board_adc_initialize(void) adc = stm32_adcinitialize(1, g_adc1_chanlist, ADC1_NCHANNELS); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -146,7 +146,7 @@ int board_adc_initialize(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } #endif diff --git a/configs/nucleo-l476rg/src/stm32_ajoystick.c b/configs/nucleo-l476rg/src/stm32_ajoystick.c index 460440323e..1eaf3db609 100644 --- a/configs/nucleo-l476rg/src/stm32_ajoystick.c +++ b/configs/nucleo-l476rg/src/stm32_ajoystick.c @@ -211,14 +211,14 @@ static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower, int errcode = get_errno(); if (errcode != EINTR) { - idbg("ERROR: read failed: %d\n", errcode); + ierr("ERROR: read failed: %d\n", errcode); } return -errcode; } else if (nread < NJOYSTICK_CHANNELS * sizeof(struct adc_msg_s)) { - idbg("ERROR: read too small: %ld\n", (long)nread); + ierr("ERROR: read too small: %ld\n", (long)nread); return -EIO; } @@ -265,7 +265,7 @@ static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower, if (have != 3) { - idbg("ERROR: Could not find joystick channels\n"); + ierr("ERROR: Could not find joystick channels\n"); return -EIO; } @@ -459,7 +459,7 @@ int board_ajoy_initialize(void) ret = board_adc_initialize(); if (ret < 0) { - idbg("ERROR: board_adc_initialize() failed: %d\n", ret); + ierr("ERROR: board_adc_initialize() failed: %d\n", ret); return ret; } @@ -469,7 +469,7 @@ int board_ajoy_initialize(void) if (fd < 0) { int errcode = get_errno(); - idbg("ERROR: Failed to open /dev/adc0: %d\n", errcode); + ierr("ERROR: Failed to open /dev/adc0: %d\n", errcode); return -errcode; } @@ -480,7 +480,7 @@ int board_ajoy_initialize(void) ret = file_detach(fd, &g_adcfile); if (ret < 0) { - idbg("ERROR: Failed to detach from file descriptor: %d\n", ret); + ierr("ERROR: Failed to detach from file descriptor: %d\n", ret); (void)close(fd); return ret; } @@ -505,7 +505,7 @@ int board_ajoy_initialize(void) ret = ajoy_register("/dev/ajoy0", &g_ajoylower); if (ret < 0) { - idbg("ERROR: ajoy_register failed: %d\n", ret); + ierr("ERROR: ajoy_register failed: %d\n", ret); #ifndef NO_JOYSTICK_ADC file_close_detached(&g_adcfile); #endif diff --git a/configs/nucleo-l476rg/src/stm32_appinit.c b/configs/nucleo-l476rg/src/stm32_appinit.c index 96190c07c5..9910184bf8 100644 --- a/configs/nucleo-l476rg/src/stm32_appinit.c +++ b/configs/nucleo-l476rg/src/stm32_appinit.c @@ -143,7 +143,7 @@ int board_app_initialize(uintptr_t arg) rtclower = stm32l4_rtc_lowerhalf(); if (!rtclower) { - sdbg("ERROR: Failed to instantiate the RTC lower-half driver\n"); + serr("ERROR: Failed to instantiate the RTC lower-half driver\n"); return -ENOMEM; } else @@ -155,7 +155,7 @@ int board_app_initialize(uintptr_t arg) ret = rtc_initialize(0, rtclower); if (ret < 0) { - sdbg("ERROR: Failed to bind/register the RTC driver: %d\n", ret); + serr("ERROR: Failed to bind/register the RTC driver: %d\n", ret); return ret; } } diff --git a/configs/nucleo-l476rg/src/stm32_autoleds.c b/configs/nucleo-l476rg/src/stm32_autoleds.c index c94472e74e..45d84d7778 100644 --- a/configs/nucleo-l476rg/src/stm32_autoleds.c +++ b/configs/nucleo-l476rg/src/stm32_autoleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/nucleo-l476rg/src/stm32_spi.c b/configs/nucleo-l476rg/src/stm32_spi.c index e359670b47..a5dec3a6db 100644 --- a/configs/nucleo-l476rg/src/stm32_spi.c +++ b/configs/nucleo-l476rg/src/stm32_spi.c @@ -67,14 +67,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -111,7 +111,7 @@ void weak_function stm32_spiinitialize(void) g_spi1 = up_spiinitialize(1); if (!g_spi1) { - spidbg("[boot] FAILED to initialize SPI port 1\n"); + spierr("[boot] FAILED to initialize SPI port 1\n"); } #ifdef CONFIG_WL_CC3000 @@ -166,7 +166,7 @@ void weak_function stm32_spiinitialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #ifdef CONFIG_WL_CC3000 if (devid == SPIDEV_WIRELESS) @@ -192,7 +192,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #ifdef CONFIG_WL_CC3000 if (devid == SPIDEV_WIRELESS) @@ -211,7 +211,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/nucleo-l476rg/src/stm32_userleds.c b/configs/nucleo-l476rg/src/stm32_userleds.c index 1745510298..a2ebbe3dd5 100644 --- a/configs/nucleo-l476rg/src/stm32_userleds.c +++ b/configs/nucleo-l476rg/src/stm32_userleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/nucleo-l476rg/src/stm32_wireless.c b/configs/nucleo-l476rg/src/stm32_wireless.c index 10c4c28c1b..bdd8f2f6af 100644 --- a/configs/nucleo-l476rg/src/stm32_wireless.c +++ b/configs/nucleo-l476rg/src/stm32_wireless.c @@ -280,7 +280,7 @@ int wireless_archinitialize(size_t max_rx_size) /* Init SPI bus */ - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(CONFIG_CC3000_DEVMINOR == 0); #ifdef CONFIG_CC3000_PROBES @@ -295,7 +295,7 @@ int wireless_archinitialize(size_t max_rx_size) spi = up_spiinitialize(CONFIG_CC3000_SPIDEV); if (!spi) { - idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); + ierr("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); return -ENODEV; } @@ -305,7 +305,7 @@ int wireless_archinitialize(size_t max_rx_size) int ret = cc3000_register(spi, &g_cc3000_info.dev, CONFIG_CC3000_DEVMINOR); if (ret < 0) { - idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); + ierr("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); return -ENODEV; } diff --git a/configs/nutiny-nuc120/src/nuc_led.c b/configs/nutiny-nuc120/src/nuc_led.c index 8d8596c2f9..2d76cb7489 100644 --- a/configs/nutiny-nuc120/src/nuc_led.c +++ b/configs/nutiny-nuc120/src/nuc_led.c @@ -81,14 +81,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/olimex-lpc-h3131/src/lpc31_leds.c b/configs/olimex-lpc-h3131/src/lpc31_leds.c index 398afab3d3..613e4063dc 100644 --- a/configs/olimex-lpc-h3131/src/lpc31_leds.c +++ b/configs/olimex-lpc-h3131/src/lpc31_leds.c @@ -62,10 +62,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/olimex-lpc-h3131/src/lpc31_mmcsd.c b/configs/olimex-lpc-h3131/src/lpc31_mmcsd.c index 9e243a9a61..e5ccb3691a 100644 --- a/configs/olimex-lpc-h3131/src/lpc31_mmcsd.c +++ b/configs/olimex-lpc-h3131/src/lpc31_mmcsd.c @@ -80,7 +80,7 @@ int lpc31_mmcsd_initialize(int slot, int minor) sdio = sdio_initialize(slot); if (!sdio) { - fdbg("ERROR: Failed to initialize SDIO slot %d\n", slot); + ferr("ERROR: Failed to initialize SDIO slot %d\n", slot); return -ENODEV; } @@ -90,7 +90,7 @@ int lpc31_mmcsd_initialize(int slot, int minor) ret = mmcsd_slotinitialize(minor, sdio); if (ret != OK) { - fdbg("ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + ferr("ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } diff --git a/configs/olimex-lpc-h3131/src/lpc31_spi.c b/configs/olimex-lpc-h3131/src/lpc31_spi.c index 3da8396047..0d91d346b4 100644 --- a/configs/olimex-lpc-h3131/src/lpc31_spi.c +++ b/configs/olimex-lpc-h3131/src/lpc31_spi.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -127,7 +127,7 @@ void weak_function lpc31_spidev_intialize(void) void lpc31_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } diff --git a/configs/olimex-lpc-h3131/src/lpc31_usbhost.c b/configs/olimex-lpc-h3131/src/lpc31_usbhost.c index cb98d49c06..a52f94d458 100644 --- a/configs/olimex-lpc-h3131/src/lpc31_usbhost.c +++ b/configs/olimex-lpc-h3131/src/lpc31_usbhost.c @@ -195,7 +195,7 @@ int lpc31_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the mass storage class: %d\n", ret); + uerr("ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -205,7 +205,7 @@ int lpc31_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class\n"); + uerr("ERROR: Failed to register the CDC/ACM serial class\n"); } #endif @@ -215,7 +215,7 @@ int lpc31_usbhost_initialize(void) ret = usbhost_kbdinit(); if (ret != OK) { - udbg("ERROR: Failed to register the KBD class\n"); + uerr("ERROR: Failed to register the KBD class\n"); } #endif @@ -224,7 +224,7 @@ int lpc31_usbhost_initialize(void) g_ehciconn = lpc31_ehci_initialize(0); if (!g_ehciconn) { - udbg("ERROR: lpc31_ehci_initialize failed\n"); + uerr("ERROR: lpc31_ehci_initialize failed\n"); return -ENODEV; } @@ -234,7 +234,7 @@ int lpc31_usbhost_initialize(void) (main_t)ehci_waiter, (FAR char * const *)NULL); if (pid < 0) { - udbg("ERROR: Failed to create ehci_waiter task: %d\n", ret); + uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret); return -ENODEV; } diff --git a/configs/olimex-lpc1766stk/src/lpc17_can.c b/configs/olimex-lpc1766stk/src/lpc17_can.c index 43bddd81a9..3fe2c05cbf 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_can.c +++ b/configs/olimex-lpc1766stk/src/lpc17_can.c @@ -77,12 +77,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -120,7 +120,7 @@ int board_can_initialize(void) can = lpc17_caninitialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -129,7 +129,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/olimex-lpc1766stk/src/lpc17_hidkbd.c b/configs/olimex-lpc1766stk/src/lpc17_hidkbd.c index 7c0d304fd1..a92e00774e 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_hidkbd.c +++ b/configs/olimex-lpc1766stk/src/lpc17_hidkbd.c @@ -76,7 +76,7 @@ struct usbhost_connection_s *arch_usbhost_initialize(void) ret = usbhost_hub_initialize(); if (ret < 0) { - udbg("ERROR: usbhost_hub_initialize failed: %d\n", ret); + uerr("ERROR: usbhost_hub_initialize failed: %d\n", ret); } #endif diff --git a/configs/olimex-lpc1766stk/src/lpc17_hidmouse.c b/configs/olimex-lpc1766stk/src/lpc17_hidmouse.c index cda2a94a9c..003b6e9e53 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_hidmouse.c +++ b/configs/olimex-lpc1766stk/src/lpc17_hidmouse.c @@ -60,8 +60,8 @@ */ #ifndef CONFIG_DEBUG_INPUT -# undef idbg -# define idbg udbg +# undef ierr +# define ierr uerr # undef illerr # define illerr ullerr # undef iinfo @@ -114,7 +114,7 @@ int board_tsc_setup(int minor) static bool initialized = false; int ret; - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(minor == 0); /* Have we already initialized? Since we never uninitialize we must prevent @@ -131,7 +131,7 @@ int board_tsc_setup(int minor) ret = usbhost_hub_initialize(); if (ret < 0) { - idbg("ERROR: usbhost_hub_initialize failed: %d\n", ret); + ierr("ERROR: usbhost_hub_initialize failed: %d\n", ret); } #endif @@ -140,7 +140,7 @@ int board_tsc_setup(int minor) ret = usbhost_mouse_init(); if (ret < 0) { - idbg("Failed to register USB HID mouse device class\n"); + ierr("Failed to register USB HID mouse device class\n"); return -ENODEV; } diff --git a/configs/olimex-lpc1766stk/src/lpc17_lcd.c b/configs/olimex-lpc1766stk/src/lpc17_lcd.c index 5443ad2e50..9ed0623a0f 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_lcd.c +++ b/configs/olimex-lpc1766stk/src/lpc17_lcd.c @@ -89,10 +89,10 @@ #endif #ifdef CONFIG_LCD_NOKIADBG -# define lcddbg(format, ...) info(format, ##__VA_ARGS__) +# define lcderr(format, ...) info(format, ##__VA_ARGS__) # define lcd_dumpgpio(m) lpc17_dumpgpio(LPC1766STK_LCD_RST, m) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcd_dumpgpio(m) #endif diff --git a/configs/olimex-lpc1766stk/src/lpc17_leds.c b/configs/olimex-lpc1766stk/src/lpc17_leds.c index c26cd776d2..207883a8ea 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_leds.c +++ b/configs/olimex-lpc1766stk/src/lpc17_leds.c @@ -63,14 +63,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/olimex-lpc1766stk/src/lpc17_ssp.c b/configs/olimex-lpc1766stk/src/lpc17_ssp.c index a993baafd6..ed659ad932 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_ssp.c +++ b/configs/olimex-lpc1766stk/src/lpc17_ssp.c @@ -81,7 +81,7 @@ */ #ifdef CONFIG_SSP_DEBUG -# define sspdbg llerr +# define ssperr llerr # ifdef CONFIG_SSP_VERBOSE # define sspinfo llerr # else @@ -89,7 +89,7 @@ # endif #else # undef CONFIG_SSP_VERBOSE -# define sspdbg(x...) +# define ssperr(x...) # define sspinfo(x...) #endif @@ -284,7 +284,7 @@ void weak_function lpc1766stk_sspdev_initialize(void) #ifdef CONFIG_LPC17_SSP0 void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_DISPLAY) { /* Assert/de-assert the CS pin to the card */ @@ -297,7 +297,7 @@ void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspdbg("Returning nothing\n"); + ssperr("Returning nothing\n"); return 0; } #endif @@ -305,7 +305,7 @@ uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_LPC17_SSP1 void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_MMCSD) { /* Assert/de-assert the CS pin to the card */ @@ -318,7 +318,7 @@ void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspdbg("Returning SPI_STATUS_PRESENT\n"); + ssperr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } #endif diff --git a/configs/olimex-stm32-h405/src/stm32_adc.c b/configs/olimex-stm32-h405/src/stm32_adc.c index cc3a9ef0ed..aed729e149 100644 --- a/configs/olimex-stm32-h405/src/stm32_adc.c +++ b/configs/olimex-stm32-h405/src/stm32_adc.c @@ -159,7 +159,7 @@ int stm32_adc_initialize(void) adc = stm32_adcinitialize(1, g_chanlist, ADC1_NCHANNELS); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -168,7 +168,7 @@ int stm32_adc_initialize(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/olimex-stm32-h405/src/stm32_autoleds.c b/configs/olimex-stm32-h405/src/stm32_autoleds.c index c3ce8056ec..884c89bfc3 100644 --- a/configs/olimex-stm32-h405/src/stm32_autoleds.c +++ b/configs/olimex-stm32-h405/src/stm32_autoleds.c @@ -60,10 +60,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/olimex-stm32-h405/src/stm32_can.c b/configs/olimex-stm32-h405/src/stm32_can.c index 695179d017..12e08951f5 100644 --- a/configs/olimex-stm32-h405/src/stm32_can.c +++ b/configs/olimex-stm32-h405/src/stm32_can.c @@ -69,12 +69,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -125,7 +125,7 @@ int stm32_can_initialize(void) can = stm32_caninitialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -134,7 +134,7 @@ int stm32_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/olimex-stm32-h405/src/stm32_userleds.c b/configs/olimex-stm32-h405/src/stm32_userleds.c index 34057f150d..83ab5ee2f3 100644 --- a/configs/olimex-stm32-h405/src/stm32_userleds.c +++ b/configs/olimex-stm32-h405/src/stm32_userleds.c @@ -57,10 +57,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/olimex-stm32-h407/src/stm32_adc.c b/configs/olimex-stm32-h407/src/stm32_adc.c index a7f3e6aa32..211b403eb4 100644 --- a/configs/olimex-stm32-h407/src/stm32_adc.c +++ b/configs/olimex-stm32-h407/src/stm32_adc.c @@ -159,7 +159,7 @@ int stm32_adc_initialize(void) adc = stm32_adcinitialize(1, g_chanlist, ADC1_NCHANNELS); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -168,7 +168,7 @@ int stm32_adc_initialize(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/olimex-stm32-h407/src/stm32_autoleds.c b/configs/olimex-stm32-h407/src/stm32_autoleds.c index f1c65cafbc..5ec4fae864 100644 --- a/configs/olimex-stm32-h407/src/stm32_autoleds.c +++ b/configs/olimex-stm32-h407/src/stm32_autoleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/olimex-stm32-h407/src/stm32_can.c b/configs/olimex-stm32-h407/src/stm32_can.c index 3056d80a27..2ff1514954 100644 --- a/configs/olimex-stm32-h407/src/stm32_can.c +++ b/configs/olimex-stm32-h407/src/stm32_can.c @@ -69,12 +69,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -121,7 +121,7 @@ int stm32_can_initialize(void) can = stm32_caninitialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -130,7 +130,7 @@ int stm32_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/olimex-stm32-h407/src/stm32_sdio.c b/configs/olimex-stm32-h407/src/stm32_sdio.c index 53598f5e80..8c5ffa7cbd 100644 --- a/configs/olimex-stm32-h407/src/stm32_sdio.c +++ b/configs/olimex-stm32-h407/src/stm32_sdio.c @@ -139,7 +139,7 @@ int stm32_sdio_initialize(void) g_sdio_dev = sdio_initialize(SDIO_SLOTNO); if (!g_sdio_dev) { - fdbg("Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); + ferr("Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); return -ENODEV; } @@ -150,7 +150,7 @@ int stm32_sdio_initialize(void) ret = mmcsd_slotinitialize(SDIO_MINOR, g_sdio_dev); if (ret != OK) { - fdbg("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + ferr("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } diff --git a/configs/olimex-stm32-h407/src/stm32_usb.c b/configs/olimex-stm32-h407/src/stm32_usb.c index 2f925d437a..d954374967 100644 --- a/configs/olimex-stm32-h407/src/stm32_usb.c +++ b/configs/olimex-stm32-h407/src/stm32_usb.c @@ -181,7 +181,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_hub_initialize(); if (ret < 0) { - udbg("ERROR: usbhost_hub_initialize failed: %d\n", ret); + uerr("ERROR: usbhost_hub_initialize failed: %d\n", ret); } #endif @@ -191,7 +191,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the mass storage class: %d\n", ret); + uerr("ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -201,7 +201,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + uerr("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif diff --git a/configs/olimex-stm32-h407/src/stm32_userleds.c b/configs/olimex-stm32-h407/src/stm32_userleds.c index 7a5a58049c..859548637e 100644 --- a/configs/olimex-stm32-h407/src/stm32_userleds.c +++ b/configs/olimex-stm32-h407/src/stm32_userleds.c @@ -62,10 +62,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/olimex-stm32-p107/src/stm32_can.c b/configs/olimex-stm32-p107/src/stm32_can.c index dc48f06ae0..84bd103adf 100644 --- a/configs/olimex-stm32-p107/src/stm32_can.c +++ b/configs/olimex-stm32-p107/src/stm32_can.c @@ -65,12 +65,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -108,7 +108,7 @@ int board_can_initialize(void) can = stm32_caninitialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -117,7 +117,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/olimex-stm32-p107/src/stm32_spi.c b/configs/olimex-stm32-p107/src/stm32_spi.c index befcd373a3..3b84b1f907 100644 --- a/configs/olimex-stm32-p107/src/stm32_spi.c +++ b/configs/olimex-stm32-p107/src/stm32_spi.c @@ -64,7 +64,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -72,7 +72,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -136,7 +136,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_ETHERNET) { diff --git a/configs/olimex-stm32-p207/src/stm32_adc.c b/configs/olimex-stm32-p207/src/stm32_adc.c index 96fc837b97..293f4d27d4 100644 --- a/configs/olimex-stm32-p207/src/stm32_adc.c +++ b/configs/olimex-stm32-p207/src/stm32_adc.c @@ -151,7 +151,7 @@ int stm32_adc_initialize(void) adc = stm32_adcinitialize(1, g_chanlist, ADC1_NCHANNELS); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -160,7 +160,7 @@ int stm32_adc_initialize(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/olimex-stm32-p207/src/stm32_autoleds.c b/configs/olimex-stm32-p207/src/stm32_autoleds.c index d4c70ea380..04cca5a6c5 100644 --- a/configs/olimex-stm32-p207/src/stm32_autoleds.c +++ b/configs/olimex-stm32-p207/src/stm32_autoleds.c @@ -60,10 +60,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/olimex-stm32-p207/src/stm32_can.c b/configs/olimex-stm32-p207/src/stm32_can.c index a6441e5513..1c223eb100 100644 --- a/configs/olimex-stm32-p207/src/stm32_can.c +++ b/configs/olimex-stm32-p207/src/stm32_can.c @@ -69,12 +69,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -125,7 +125,7 @@ int stm32_can_initialize(void) can = stm32_caninitialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -134,7 +134,7 @@ int stm32_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/olimex-stm32-p207/src/stm32_usb.c b/configs/olimex-stm32-p207/src/stm32_usb.c index 15358557b1..ed6572dd44 100644 --- a/configs/olimex-stm32-p207/src/stm32_usb.c +++ b/configs/olimex-stm32-p207/src/stm32_usb.c @@ -185,7 +185,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_hub_initialize(); if (ret < 0) { - udbg("ERROR: usbhost_hub_initialize failed: %d\n", ret); + uerr("ERROR: usbhost_hub_initialize failed: %d\n", ret); } #endif @@ -195,7 +195,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the mass storage class: %d\n", ret); + uerr("ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -205,7 +205,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + uerr("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif diff --git a/configs/olimex-stm32-p207/src/stm32_userleds.c b/configs/olimex-stm32-p207/src/stm32_userleds.c index b1656100f7..8d5f76abf1 100644 --- a/configs/olimex-stm32-p207/src/stm32_userleds.c +++ b/configs/olimex-stm32-p207/src/stm32_userleds.c @@ -57,10 +57,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/olimexino-stm32/src/stm32_can.c b/configs/olimexino-stm32/src/stm32_can.c index 8197ca1a3f..1433a60dca 100644 --- a/configs/olimexino-stm32/src/stm32_can.c +++ b/configs/olimexino-stm32/src/stm32_can.c @@ -68,12 +68,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -111,7 +111,7 @@ int board_can_initialize(void) can = stm32_caninitialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -120,7 +120,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/olimexino-stm32/src/stm32_leds.c b/configs/olimexino-stm32/src/stm32_leds.c index 9a972d7983..e0b583b4a7 100644 --- a/configs/olimexino-stm32/src/stm32_leds.c +++ b/configs/olimexino-stm32/src/stm32_leds.c @@ -59,14 +59,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/olimexino-stm32/src/stm32_spi.c b/configs/olimexino-stm32/src/stm32_spi.c index 9fab4ec2e7..8dce537409 100644 --- a/configs/olimexino-stm32/src/stm32_spi.c +++ b/configs/olimexino-stm32/src/stm32_spi.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -135,7 +135,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_USER) { stm32_gpiowrite(USER_CSn, !selected); @@ -151,7 +151,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #if defined(CONFIG_MMCSD) if (devid == SPIDEV_MMCSD) { @@ -171,7 +171,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/open1788/src/lpc17_autoleds.c b/configs/open1788/src/lpc17_autoleds.c index c004063ea0..808ddef8df 100644 --- a/configs/open1788/src/lpc17_autoleds.c +++ b/configs/open1788/src/lpc17_autoleds.c @@ -139,14 +139,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/open1788/src/lpc17_ssp.c b/configs/open1788/src/lpc17_ssp.c index 0cc9039aeb..c8be1a5da0 100644 --- a/configs/open1788/src/lpc17_ssp.c +++ b/configs/open1788/src/lpc17_ssp.c @@ -64,14 +64,14 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_SPI -# define sspdbg llerr +# define ssperr llerr # ifdef CONFIG_DEBUG_INFO # define sspinfo llerr # else # define sspinfo(x...) # endif #else -# define sspdbg(x...) +# define ssperr(x...) # define sspinfo(x...) #endif @@ -158,12 +158,12 @@ void weak_function open1788_sspdev_initialize(void) #ifdef CONFIG_LPC17_SSP0 void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspdbg("Returning nothing\n"); + ssperr("Returning nothing\n"); return 0; } #endif @@ -171,7 +171,7 @@ uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_LPC17_SSP1 void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_TOUCHSCREEN) { /* Assert/de-assert the CS pin to the touchscreen */ @@ -184,7 +184,7 @@ void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspdbg("Returning nothing\n"); + ssperr("Returning nothing\n"); return 0; } #endif @@ -192,12 +192,12 @@ uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_LPC17_SSP2 void lpc17_ssp2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t lpc17_ssp2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspdbg("Returning nothing\n"); + ssperr("Returning nothing\n"); return 0; } #endif diff --git a/configs/open1788/src/lpc17_touchscreen.c b/configs/open1788/src/lpc17_touchscreen.c index 097ec3550f..1dcf9bb560 100644 --- a/configs/open1788/src/lpc17_touchscreen.c +++ b/configs/open1788/src/lpc17_touchscreen.c @@ -277,7 +277,7 @@ int board_tsc_setup(int minor) FAR struct spi_dev_s *dev; int ret; - idbg("initialized:%d minor:%d\n", initialized, minor); + ierr("initialized:%d minor:%d\n", initialized, minor); DEBUGASSERT(minor == 0); /* Since there is no uninitialized logic, this initialization can be @@ -301,7 +301,7 @@ int board_tsc_setup(int minor) dev = lpc17_sspbus_initialize(CONFIG_ADS7843E_SPIDEV); if (!dev) { - idbg("Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV); + ierr("Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV); return -ENODEV; } @@ -310,7 +310,7 @@ int board_tsc_setup(int minor) ret = ads7843e_register(dev, &g_tscinfo, CONFIG_ADS7843E_DEVMINOR); if (ret < 0) { - idbg("Failed to register touchscreen device minor=%d\n", + ierr("Failed to register touchscreen device minor=%d\n", CONFIG_ADS7843E_DEVMINOR); /* up_spiuninitialize(dev); */ return -ENODEV; diff --git a/configs/open1788/src/lpc17_userleds.c b/configs/open1788/src/lpc17_userleds.c index 8a3f1fef4f..8f541c3713 100644 --- a/configs/open1788/src/lpc17_userleds.c +++ b/configs/open1788/src/lpc17_userleds.c @@ -65,14 +65,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c b/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c index 43027711d5..f62dcb0545 100644 --- a/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c +++ b/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c @@ -140,10 +140,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif diff --git a/configs/pcduino-a10/src/a1x_leds.c b/configs/pcduino-a10/src/a1x_leds.c index 9e2c6f2f4b..eaa44f00fc 100644 --- a/configs/pcduino-a10/src/a1x_leds.c +++ b/configs/pcduino-a10/src/a1x_leds.c @@ -95,10 +95,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/pic32mx-starterkit/src/pic32mx_leds.c b/configs/pic32mx-starterkit/src/pic32mx_leds.c index a349698987..9177aa6613 100644 --- a/configs/pic32mx-starterkit/src/pic32mx_leds.c +++ b/configs/pic32mx-starterkit/src/pic32mx_leds.c @@ -98,7 +98,7 @@ /* Debug ********************************************************************/ #if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_LEDS) -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else @@ -107,7 +107,7 @@ #else # undef CONFIG_DEBUG_LEDS # undef CONFIG_DEBUG_INFO -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/pic32mx-starterkit/src/pic32mx_spi.c b/configs/pic32mx-starterkit/src/pic32mx_spi.c index 65374d648e..1884607ad9 100644 --- a/configs/pic32mx-starterkit/src/pic32mx_spi.c +++ b/configs/pic32mx-starterkit/src/pic32mx_spi.c @@ -65,7 +65,7 @@ */ #ifdef CONFIG_SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef CONFIG_SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -134,13 +134,13 @@ enum spi_dev_e; #ifdef CONFIG_PIC32MX_SPI1 void pic32mx_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic32mx_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Returning nothing\n"); + spierr("Returning nothing\n"); #warning "Missing logic" return 0; } @@ -156,13 +156,13 @@ int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #ifdef CONFIG_PIC32MX_SPI1 void pic32mx_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic32mx_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Returning nothing\n"); + spierr("Returning nothing\n"); #warning "Missing logic" return 0; } @@ -178,13 +178,13 @@ int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #ifdef CONFIG_PIC32MX_SPI3 void pic32mx_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic32mx_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Returning nothing\n"); + spierr("Returning nothing\n"); #warning "Missing logic" return 0; } @@ -200,13 +200,13 @@ int pic32mx_spi3cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #ifdef CONFIG_PIC32MX_SPI4 void pic32mx_spi4select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic32mx_spi4status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Returning nothing\n"); + spierr("Returning nothing\n"); #warning "Missing logic" return 0; } diff --git a/configs/pic32mx7mmb/src/pic32_leds.c b/configs/pic32mx7mmb/src/pic32_leds.c index 1cb9a6082f..83c01668cd 100644 --- a/configs/pic32mx7mmb/src/pic32_leds.c +++ b/configs/pic32mx7mmb/src/pic32_leds.c @@ -101,7 +101,7 @@ /* Debug ********************************************************************/ #if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_LEDS) -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else @@ -110,7 +110,7 @@ #else # undef CONFIG_DEBUG_LEDS # undef CONFIG_DEBUG_INFO -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/pic32mx7mmb/src/pic32_mio283qt2.c b/configs/pic32mx7mmb/src/pic32_mio283qt2.c index d083041692..972a2fbd67 100644 --- a/configs/pic32mx7mmb/src/pic32_mio283qt2.c +++ b/configs/pic32mx7mmb/src/pic32_mio283qt2.c @@ -139,10 +139,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -468,7 +468,7 @@ int board_lcd_initialize(void) g_pic32mx7mmb_lcd.drvr = mio283qt2_lcdinitialize(&g_pic32mx7mmb_lcd.dev); if (!g_pic32mx7mmb_lcd.drvr) { - lcddbg("ERROR: mio283qt2_lcdinitialize failed\n"); + lcderr("ERROR: mio283qt2_lcdinitialize failed\n"); return -ENODEV; } } diff --git a/configs/pic32mx7mmb/src/pic32_spi.c b/configs/pic32mx7mmb/src/pic32_spi.c index 58ea77bfa8..1b62c22f0c 100644 --- a/configs/pic32mx7mmb/src/pic32_spi.c +++ b/configs/pic32mx7mmb/src/pic32_spi.c @@ -81,10 +81,10 @@ */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # define spiinfo llinfo #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -150,7 +150,7 @@ enum spi_dev_e; #ifdef CONFIG_PIC32MX_SPI1 void pic32mx_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_MMCSD) { @@ -179,7 +179,7 @@ uint8_t pic32mx_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) } } - spidbg("Returning %02x\n", ret); + spierr("Returning %02x\n", ret); return ret; } #ifdef CONFIG_SPI_CMDDATA @@ -194,13 +194,13 @@ int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #ifdef CONFIG_PIC32MX_SPI2 void pic31mx_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic31mx_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Returning nothing\n"); + spierr("Returning nothing\n"); #warning "Missing logic" return 0; } @@ -217,13 +217,13 @@ int pic31mx_spi2cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #ifdef CONFIG_PIC32MX_SPI3 void pic32mx_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic32mx_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Returning nothing\n"); + spierr("Returning nothing\n"); #warning "Missing logic" return 0; } @@ -240,13 +240,13 @@ int pic32mx_spi3cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #ifdef CONFIG_PIC32MX_SPI4 void pic32mx_spi4select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic32mx_spi4status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Returning nothing\n"); + spierr("Returning nothing\n"); #warning "Missing logic" return 0; } diff --git a/configs/pic32mx7mmb/src/pic32_touchscreen.c b/configs/pic32mx7mmb/src/pic32_touchscreen.c index 1d07e0a06c..6359ea07bd 100644 --- a/configs/pic32mx7mmb/src/pic32_touchscreen.c +++ b/configs/pic32mx7mmb/src/pic32_touchscreen.c @@ -1282,7 +1282,7 @@ static int tc_poll(FAR struct file *filep, FAR struct pollfd *fds, if ((fds->events & POLLIN) == 0) { - idbg("Missing POLLIN: revents: %08x\n", fds->revents); + ierr("Missing POLLIN: revents: %08x\n", fds->revents); ret = -EDEADLK; goto errout; } @@ -1307,7 +1307,7 @@ static int tc_poll(FAR struct file *filep, FAR struct pollfd *fds, if (i >= CONFIG_TOUCHSCREEN_NPOLLWAITERS) { - idbg("No availabled slot found: %d\n", i); + ierr("No availabled slot found: %d\n", i); fds->priv = NULL; ret = -EBUSY; goto errout; @@ -1389,7 +1389,7 @@ int board_tsc_setup(int minor) priv = (FAR struct tc_dev_s *)kmm_malloc(sizeof(struct tc_dev_s)); if (!priv) { - idbg("kmm_malloc(%d) failed\n", sizeof(struct tc_dev_s)); + ierr("kmm_malloc(%d) failed\n", sizeof(struct tc_dev_s)); return -ENOMEM; } #endif @@ -1408,7 +1408,7 @@ int board_tsc_setup(int minor) ret = register_driver(devname, &tc_fops, 0666, priv); if (ret < 0) { - idbg("register_driver() failed: %d\n", ret); + ierr("register_driver() failed: %d\n", ret); goto errout_with_priv; } @@ -1420,7 +1420,7 @@ int board_tsc_setup(int minor) ret = work_queue(HPWORK, &priv->work, tc_worker, priv, 0); if (ret != 0) { - idbg("Failed to queue work: %d\n", ret); + ierr("Failed to queue work: %d\n", ret); goto errout_with_priv; } diff --git a/configs/pic32mz-starterkit/src/pic32mz_autoleds.c b/configs/pic32mz-starterkit/src/pic32mz_autoleds.c index e4f93f0ecd..31d14aa3cf 100644 --- a/configs/pic32mz-starterkit/src/pic32mz_autoleds.c +++ b/configs/pic32mz-starterkit/src/pic32mz_autoleds.c @@ -94,7 +94,7 @@ /* Debug ********************************************************************/ #if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_LEDS) -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else @@ -103,7 +103,7 @@ #else # undef CONFIG_DEBUG_LEDS # undef CONFIG_DEBUG_INFO -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/pic32mz-starterkit/src/pic32mz_spi.c b/configs/pic32mz-starterkit/src/pic32mz_spi.c index 7cac4d15c8..8207b478b6 100644 --- a/configs/pic32mz-starterkit/src/pic32mz_spi.c +++ b/configs/pic32mz-starterkit/src/pic32mz_spi.c @@ -59,7 +59,7 @@ /* Debug */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_SPI_VERBOSE # define spiinfo llerr # else @@ -67,7 +67,7 @@ # endif #else # undef CONFIG_SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -128,13 +128,13 @@ enum spi_dev_e; #ifdef CONFIG_PIC32MZ_SPI1 void pic32mz_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic32mz_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Returning nothing\n"); + spierr("Returning nothing\n"); #warning "Missing logic" return 0; } @@ -150,13 +150,13 @@ int pic32mz_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #ifdef CONFIG_PIC32MZ_SPI2 void pic32mz_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic32mz_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Returning nothing\n"); + spierr("Returning nothing\n"); #warning "Missing logic" return 0; } @@ -172,13 +172,13 @@ int pic32mz_spi2cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #ifdef CONFIG_PIC32MZ_SPI3 void pic32mz_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic32mz_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Returning nothing\n"); + spierr("Returning nothing\n"); #warning "Missing logic" return 0; } @@ -194,13 +194,13 @@ int pic32mz_spi3cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #ifdef CONFIG_PIC32MZ_SPI4 void pic32mz_spi4select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic32mz_spi4status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Returning nothing\n"); + spierr("Returning nothing\n"); #warning "Missing logic" return 0; } @@ -216,13 +216,13 @@ int pic32mz_spi4cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #ifdef CONFIG_PIC32MZ_SPI5 void pic32mz_spi5select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic32mz_spi5status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Returning nothing\n"); + spierr("Returning nothing\n"); #warning "Missing logic" return 0; } @@ -238,13 +238,13 @@ int pic32mz_spi5cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #ifdef CONFIG_PIC32MZ_SPI6 void pic32mz_spi6select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #warning "Missing logic" } uint8_t pic32mz_spi6status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Returning nothing\n"); + spierr("Returning nothing\n"); #warning "Missing logic" return 0; } diff --git a/configs/pic32mz-starterkit/src/pic32mz_userleds.c b/configs/pic32mz-starterkit/src/pic32mz_userleds.c index f70c99c721..169376a691 100644 --- a/configs/pic32mz-starterkit/src/pic32mz_userleds.c +++ b/configs/pic32mz-starterkit/src/pic32mz_userleds.c @@ -74,7 +74,7 @@ /* Debug ********************************************************************/ #if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_LEDS) -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else @@ -83,7 +83,7 @@ #else # undef CONFIG_DEBUG_LEDS # undef CONFIG_DEBUG_INFO -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sabre-6quad/src/imx_autoleds.c b/configs/sabre-6quad/src/imx_autoleds.c index 2c4f5e8fb0..7800acfa9c 100644 --- a/configs/sabre-6quad/src/imx_autoleds.c +++ b/configs/sabre-6quad/src/imx_autoleds.c @@ -87,10 +87,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sabre-6quad/src/imx_bringup.c b/configs/sabre-6quad/src/imx_bringup.c index 2d39dbcfc2..051da9635f 100644 --- a/configs/sabre-6quad/src/imx_bringup.c +++ b/configs/sabre-6quad/src/imx_bringup.c @@ -53,7 +53,7 @@ #ifdef CONFIG_BOARD_INITIALIZE # define SYSLOG llerr #else -# define SYSLOG dbg +# define SYSLOG err #endif /**************************************************************************** diff --git a/configs/sam3u-ek/src/sam_lcd.c b/configs/sam3u-ek/src/sam_lcd.c index 467d199eb8..f93e1e467f 100644 --- a/configs/sam3u-ek/src/sam_lcd.c +++ b/configs/sam3u-ek/src/sam_lcd.c @@ -160,16 +160,16 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_LCD_REGDEBUG -# define regdbg(format, ...) info(format, ##__VA_ARGS__) +# define regerr(format, ...) info(format, ##__VA_ARGS__) #else -# define regdbg(x...) +# define regerr(x...) #endif #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lcderr(format, ...) err(format, ##__VA_ARGS__) # define lcdinfo(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -438,7 +438,7 @@ static struct sam_dev_s g_lcddev_s = static void sam_putreg(uint16_t reg, uint16_t data) { - regdbg("base: %08x RS: %04x data: %04x\n", LCD_BASE, LCD_BASE + HX843X_LCD_RS, data); + regerr("base: %08x RS: %04x data: %04x\n", LCD_BASE, LCD_BASE + HX843X_LCD_RS, data); putreg16(reg, LCD_BASE); putreg16(data, LCD_BASE + HX843X_LCD_RS); } @@ -457,7 +457,7 @@ static uint16_t sam_getreg(uint16_t reg) uint16_t data; putreg16(reg, LCD_BASE); data = getreg16(LCD_BASE + HX843X_LCD_RS); - regdbg("base: %08x RS: %04x data: %04x\n", LCD_BASE, LCD_BASE + HX843X_LCD_RS, data); + regerr("base: %08x RS: %04x data: %04x\n", LCD_BASE, LCD_BASE + HX843X_LCD_RS, data); return data; } #endif @@ -586,7 +586,7 @@ static void sam_dumpreg(uint8_t startreg, uint8_t endreg) for (addr = startreg; addr <= endreg; addr++) { value = sam_getreg(addr); - lcddbg(" %02x: %04x\n", addr, value); + lcderr(" %02x: %04x\n", addr, value); } } #endif @@ -912,7 +912,7 @@ int board_lcd_initialize(void) /* Enable SMC peripheral clock */ putreg32((1 << SAM_PID_SMC), SAM_PMC_PCER); - regdbg("PMC PCSR: %08x SMC: %08x\n", getreg32(SAM_PMC_PCSR), (1 << SAM_PID_SMC)); + regerr("PMC PCSR: %08x SMC: %08x\n", getreg32(SAM_PMC_PCSR), (1 << SAM_PID_SMC)); /* Configure SMC CS2 */ @@ -932,10 +932,10 @@ int board_lcd_initialize(void) regval |= (SMCCS_MODE_READMODE) | (SMCCS_MODE_WRITEMODE) | (SMCCS_MODE_DBW_16BITS); putreg32(regval, SAM_SMCCS_MODE(2)); - regdbg("SMC SETUP[%08x]: %08x PULSE[%08x]: %08x\n", + regerr("SMC SETUP[%08x]: %08x PULSE[%08x]: %08x\n", SAM_SMCCS_SETUP(2), getreg32(SAM_SMCCS_SETUP(2)), SAM_SMCCS_PULSE(2), getreg32(SAM_SMCCS_PULSE(2))); - regdbg(" CYCLE[%08x]: %08x MODE[%08x]: %08x\n", + regerr(" CYCLE[%08x]: %08x MODE[%08x]: %08x\n", SAM_SMCCS_CYCLE(2), getreg32(SAM_SMCCS_CYCLE(2)), SAM_SMCCS_MODE(2), getreg32(SAM_SMCCS_MODE(2))); @@ -946,7 +946,7 @@ int board_lcd_initialize(void) lcdinfo("Chip ID: %04x\n", hxregval); if (hxregval != HX8347_CHIPID) { - lcddbg("Bad chip ID: %04x Expected: %04x\n", hxregval, HX8347_CHIPID); + lcderr("Bad chip ID: %04x Expected: %04x\n", hxregval, HX8347_CHIPID); return -ENODEV; } #endif diff --git a/configs/sam3u-ek/src/sam_leds.c b/configs/sam3u-ek/src/sam_leds.c index abfbe76dba..e84145669d 100644 --- a/configs/sam3u-ek/src/sam_leds.c +++ b/configs/sam3u-ek/src/sam_leds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sam3u-ek/src/sam_spi.c b/configs/sam3u-ek/src/sam_spi.c index 95ec69e2ce..e6546c65e0 100644 --- a/configs/sam3u-ek/src/sam_spi.c +++ b/configs/sam3u-ek/src/sam_spi.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/sam3u-ek/src/sam_touchscreen.c b/configs/sam3u-ek/src/sam_touchscreen.c index 8b7b042a70..0c10f8ae1e 100644 --- a/configs/sam3u-ek/src/sam_touchscreen.c +++ b/configs/sam3u-ek/src/sam_touchscreen.c @@ -238,7 +238,7 @@ int board_tsc_setup(int minor) FAR struct spi_dev_s *dev; int ret; - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(minor == 0); /* Configure and enable the ADS7843E interrupt pin as an input */ @@ -255,7 +255,7 @@ int board_tsc_setup(int minor) dev = sam_spibus_initialize(TSC_CSNUM); if (!dev) { - idbg("Failed to initialize SPI chip select %d\n", TSC_CSNUM); + ierr("Failed to initialize SPI chip select %d\n", TSC_CSNUM); return -ENODEV; } @@ -264,7 +264,7 @@ int board_tsc_setup(int minor) ret = ads7843e_register(dev, &g_tscinfo, CONFIG_ADS7843E_DEVMINOR); if (ret < 0) { - idbg("Failed to initialize SPI chip select %d\n", TSC_CSNUM); + ierr("Failed to initialize SPI chip select %d\n", TSC_CSNUM); /* sam_spibus_uninitialize(dev); */ return -ENODEV; } diff --git a/configs/sam4e-ek/src/sam_ads7843e.c b/configs/sam4e-ek/src/sam_ads7843e.c index 6487c39b29..01e35b06d9 100644 --- a/configs/sam4e-ek/src/sam_ads7843e.c +++ b/configs/sam4e-ek/src/sam_ads7843e.c @@ -235,7 +235,7 @@ int board_tsc_setup(int minor) FAR struct spi_dev_s *dev; int ret; - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(minor == 0); /* Configure and enable the ADS7843E interrupt pin as an input */ @@ -252,7 +252,7 @@ int board_tsc_setup(int minor) dev = sam_spibus_initialize(TSC_CSNUM); if (!dev) { - idbg("Failed to initialize SPI chip select %d\n", TSC_CSNUM); + ierr("Failed to initialize SPI chip select %d\n", TSC_CSNUM); return -ENODEV; } @@ -261,7 +261,7 @@ int board_tsc_setup(int minor) ret = ads7843e_register(dev, &g_tscinfo, CONFIG_ADS7843E_DEVMINOR); if (ret < 0) { - idbg("Failed to initialize SPI chip select %d\n", TSC_CSNUM); + ierr("Failed to initialize SPI chip select %d\n", TSC_CSNUM); /* sam_spibus_uninitialize(dev); */ return -ENODEV; } diff --git a/configs/sam4e-ek/src/sam_at25.c b/configs/sam4e-ek/src/sam_at25.c index 2b3473d6d9..27c61c7c9e 100644 --- a/configs/sam4e-ek/src/sam_at25.c +++ b/configs/sam4e-ek/src/sam_at25.c @@ -88,7 +88,7 @@ int sam_at25_automount(int minor) spi = sam_spibus_initialize(FLASH_CSNUM); if (!spi) { - fdbg("ERROR: Failed to initialize SPI port %d\n", FLASH_CSNUM); + ferr("ERROR: Failed to initialize SPI port %d\n", FLASH_CSNUM); return -ENODEV; } @@ -97,7 +97,7 @@ int sam_at25_automount(int minor) mtd = at25_initialize(spi); if (!mtd) { - fdbg("ERROR: Failed to bind SPI port %d to the AT25 FLASH driver\n"); + ferr("ERROR: Failed to bind SPI port %d to the AT25 FLASH driver\n"); return -ENODEV; } @@ -109,7 +109,7 @@ int sam_at25_automount(int minor) ret = ftl_initialize(minor, mtd); if (ret < 0) { - fdbg("ERROR: Failed to initialize the FTL layer: %d\n", ret); + ferr("ERROR: Failed to initialize the FTL layer: %d\n", ret); return ret; } @@ -119,7 +119,7 @@ int sam_at25_automount(int minor) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", ret); + ferr("ERROR: NXFFS initialization failed: %d\n", ret); return ret; } @@ -128,7 +128,7 @@ int sam_at25_automount(int minor) ret = mount(NULL, "/mnt/at25", "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif diff --git a/configs/sam4e-ek/src/sam_ethernet.c b/configs/sam4e-ek/src/sam_ethernet.c index 69650ec0c9..f243414a50 100644 --- a/configs/sam4e-ek/src/sam_ethernet.c +++ b/configs/sam4e-ek/src/sam_ethernet.c @@ -74,10 +74,10 @@ */ #ifdef CONFIG_NETDEV_PHY_DEBUG -# define phydbg dbg +# define phyerr err # define phyllerr llerr #else -# define phydbg(x...) +# define phyerr(x...) # define phyllerr(x...) #endif @@ -100,7 +100,7 @@ static xcpt_t g_emac_handler; #ifdef CONFIG_SAM34_GPIOD_IRQ static void sam_emac_phy_enable(bool enable) { - phydbg("IRQ%d: enable=%d\n", SAM_PHY_IRQ, enable); + phyerr("IRQ%d: enable=%d\n", SAM_PHY_IRQ, enable); if (enable) { sam_gpioirqenable(SAM_PHY_IRQ); @@ -126,7 +126,7 @@ static void sam_emac_phy_enable(bool enable) void weak_function sam_netinitialize(void) { - phydbg("Configuring %08x\n", GPIO_PHY_IRQ); + phyerr("Configuring %08x\n", GPIO_PHY_IRQ); sam_configgpio(GPIO_PHY_IRQ); } @@ -206,11 +206,11 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) DEBUGASSERT(intf); ninfo("%s: handler=%p\n", intf, handler); - phydbg("EMAC: devname=%s\n", SAM34_EMAC_DEVNAME); + phyerr("EMAC: devname=%s\n", SAM34_EMAC_DEVNAME); if (strcmp(intf, SAM34_EMAC_DEVNAME) == 0) { - phydbg("Select EMAC\n"); + phyerr("Select EMAC\n"); phandler = &g_emac_handler; pinset = GPIO_PHY_IRQ; irq = SAM_PHY_IRQ; @@ -218,7 +218,7 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) } else { - ndbg("Unsupported interface: %s\n", intf); + nerr("Unsupported interface: %s\n", intf); return NULL; } @@ -237,15 +237,15 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) if (handler) { - phydbg("Configure pin: %08x\n", pinset); + phyerr("Configure pin: %08x\n", pinset); sam_gpioirq(pinset); - phydbg("Attach IRQ%d\n", irq); + phyerr("Attach IRQ%d\n", irq); (void)irq_attach(irq, handler); } else { - phydbg("Detach IRQ%d\n", irq); + phyerr("Detach IRQ%d\n", irq); (void)irq_detach(irq); enabler = NULL; } diff --git a/configs/sam4e-ek/src/sam_hsmci.c b/configs/sam4e-ek/src/sam_hsmci.c index 89f332e51f..d9d0d675ab 100644 --- a/configs/sam4e-ek/src/sam_hsmci.c +++ b/configs/sam4e-ek/src/sam_hsmci.c @@ -144,7 +144,7 @@ int sam_hsmci_initialize(int minor) g_hsmci.hsmci = sdio_initialize(0); if (!g_hsmci.hsmci) { - fdbg("Failed to initialize SDIO\n"); + ferr("Failed to initialize SDIO\n"); return -ENODEV; } @@ -153,7 +153,7 @@ int sam_hsmci_initialize(int minor) ret = mmcsd_slotinitialize(minor, g_hsmci.hsmci); if (ret != OK) { - fdbg("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + ferr("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } diff --git a/configs/sam4e-ek/src/sam_ili9325.c b/configs/sam4e-ek/src/sam_ili9325.c index a589d40ab2..ab0bf49c59 100644 --- a/configs/sam4e-ek/src/sam_ili9325.c +++ b/configs/sam4e-ek/src/sam_ili9325.c @@ -269,10 +269,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -1292,7 +1292,7 @@ static inline int sam_lcd_initialize(void) if (id != ILI9325_DEVICE_CODE) { - lcddbg("ERROR: Unsupported LCD: %04x\n", id); + lcderr("ERROR: Unsupported LCD: %04x\n", id); return -ENODEV; } diff --git a/configs/sam4e-ek/src/sam_ili9341.c b/configs/sam4e-ek/src/sam_ili9341.c index 26aa294945..d6164b9e77 100644 --- a/configs/sam4e-ek/src/sam_ili9341.c +++ b/configs/sam4e-ek/src/sam_ili9341.c @@ -272,10 +272,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -1171,7 +1171,7 @@ static inline int sam_lcd_initialize(void) id = ((uint16_t)buffer[2] << 8) | (uint16_t)buffer[3]; if (id != ILI9341_DEVICE_CODE) { - lcddbg("ERROR: Unsupported LCD: %04x\n", id); + lcderr("ERROR: Unsupported LCD: %04x\n", id); return -ENODEV; } diff --git a/configs/sam4e-ek/src/sam_leds.c b/configs/sam4e-ek/src/sam_leds.c index cc405266d5..35bcf7cff4 100644 --- a/configs/sam4e-ek/src/sam_leds.c +++ b/configs/sam4e-ek/src/sam_leds.c @@ -103,10 +103,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sam4e-ek/src/sam_spi.c b/configs/sam4e-ek/src/sam_spi.c index 68b7469d20..a18c85a47a 100644 --- a/configs/sam4e-ek/src/sam_spi.c +++ b/configs/sam4e-ek/src/sam_spi.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/sam4l-xplained/src/sam_autoleds.c b/configs/sam4l-xplained/src/sam_autoleds.c index fca3a16fb0..57b82a508a 100644 --- a/configs/sam4l-xplained/src/sam_autoleds.c +++ b/configs/sam4l-xplained/src/sam_autoleds.c @@ -86,10 +86,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sam4l-xplained/src/sam_mmcsd.c b/configs/sam4l-xplained/src/sam_mmcsd.c index c752a35622..f4603d8107 100644 --- a/configs/sam4l-xplained/src/sam_mmcsd.c +++ b/configs/sam4l-xplained/src/sam_mmcsd.c @@ -99,7 +99,7 @@ int sam_sdinitialize(int minor) spi = sam_spibus_initialize(SD_CSNO); if (!spi) { - fdbg("Failed to initialize SPI chip select %d\n", SD_CSNO); + ferr("Failed to initialize SPI chip select %d\n", SD_CSNO); return -ENODEV; } @@ -113,7 +113,7 @@ int sam_sdinitialize(int minor) ret = mmcsd_spislotinitialize(minor, SAM34_MMCSDSLOTNO, spi); if (ret < 0) { - fdbg("Failed to bind SPI chip select %d to MMC/SD slot %d: %d\n", + ferr("Failed to bind SPI chip select %d to MMC/SD slot %d: %d\n", SD_CSNO, SAM34_MMCSDSLOTNO, ret); return ret; } diff --git a/configs/sam4l-xplained/src/sam_slcd.c b/configs/sam4l-xplained/src/sam_slcd.c index 9b53b14724..391673d521 100644 --- a/configs/sam4l-xplained/src/sam_slcd.c +++ b/configs/sam4l-xplained/src/sam_slcd.c @@ -251,10 +251,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif diff --git a/configs/sam4l-xplained/src/sam_spi.c b/configs/sam4l-xplained/src/sam_spi.c index effc159407..4aad0f04d9 100644 --- a/configs/sam4l-xplained/src/sam_spi.c +++ b/configs/sam4l-xplained/src/sam_spi.c @@ -60,7 +60,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -68,7 +68,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/sam4l-xplained/src/sam_ug2832hsweg04.c b/configs/sam4l-xplained/src/sam_ug2832hsweg04.c index 8cf093533b..a6a7e9cfda 100644 --- a/configs/sam4l-xplained/src/sam_ug2832hsweg04.c +++ b/configs/sam4l-xplained/src/sam_ug2832hsweg04.c @@ -117,10 +117,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lcderr(format, ...) err(format, ##__VA_ARGS__) # define lcdinfo(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -157,7 +157,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) spi = sam_spibus_initialize(OLED_CSNO); if (!spi) { - lcddbg("Failed to initialize SPI port 1\n"); + lcderr("Failed to initialize SPI port 1\n"); } else { @@ -166,7 +166,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) dev = ssd1306_initialize(spi, devno); if (!dev) { - lcddbg("Failed to bind SPI port 1 to OLED %d: %d\n", devno); + lcderr("Failed to bind SPI port 1 to OLED %d: %d\n", devno); } else { diff --git a/configs/sam4l-xplained/src/sam_userleds.c b/configs/sam4l-xplained/src/sam_userleds.c index 3d0c33fa96..ad9d3a3000 100644 --- a/configs/sam4l-xplained/src/sam_userleds.c +++ b/configs/sam4l-xplained/src/sam_userleds.c @@ -71,10 +71,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sam4s-xplained-pro/src/sam_autoleds.c b/configs/sam4s-xplained-pro/src/sam_autoleds.c index 31af4fa757..537892c59a 100644 --- a/configs/sam4s-xplained-pro/src/sam_autoleds.c +++ b/configs/sam4s-xplained-pro/src/sam_autoleds.c @@ -79,10 +79,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sam4s-xplained-pro/src/sam_hsmci.c b/configs/sam4s-xplained-pro/src/sam_hsmci.c index 40cfd428d0..d7404ddd37 100644 --- a/configs/sam4s-xplained-pro/src/sam_hsmci.c +++ b/configs/sam4s-xplained-pro/src/sam_hsmci.c @@ -135,7 +135,7 @@ static int sam_hsmci_cardetect_int(int irq, void *regs) int sam_hsmci_initialize(void) { int ret; - fdbg("Initializing SDIO\n"); + ferr("Initializing SDIO\n"); /* Have we already initialized? */ @@ -147,7 +147,7 @@ int sam_hsmci_initialize(void) g_hsmci.hsmci = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); if (!g_hsmci.hsmci) { - fdbg("Failed to initialize SDIO\n"); + ferr("Failed to initialize SDIO\n"); return -ENODEV; } @@ -156,7 +156,7 @@ int sam_hsmci_initialize(void) ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_hsmci.hsmci); if (ret != OK) { - fdbg("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + ferr("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } diff --git a/configs/sam4s-xplained-pro/src/sam_tc.c b/configs/sam4s-xplained-pro/src/sam_tc.c index 42c2e014fa..ab036d212b 100644 --- a/configs/sam4s-xplained-pro/src/sam_tc.c +++ b/configs/sam4s-xplained-pro/src/sam_tc.c @@ -107,7 +107,7 @@ #endif #ifdef CONFIG_DEBUG_TIMER -# define tcdbg dbg +# define tcerr err # define tcllerr llerr # ifdef CONFIG_DEBUG_INFO # define tcinfo info @@ -117,7 +117,7 @@ # define tcllinfo(x...) # endif #else -# define tcdbg(x...) +# define tcerr(x...) # define tcllerr(x...) # define tcinfo(x...) # define tcllinfo(x...) @@ -211,7 +211,7 @@ int sam_timerinitialize(void) fd = open(CONFIG_SAM4S_XPLAINED_PRO_SCHED_TIMER_DEVPATH, O_RDONLY); if (fd < 0) { - tcdbg("open %s failed: %d\n", + tcerr("open %s failed: %d\n", CONFIG_SAM4S_XPLAINED_PRO_SCHED_TIMER_DEVPATH, errno); goto errout; } @@ -222,7 +222,7 @@ int sam_timerinitialize(void) ret = ioctl(fd, TCIOC_SETTIMEOUT, (unsigned long)USEC_PER_TICK); if (ret < 0) { - tcdbg("ioctl(TCIOC_SETTIMEOUT) failed: %d\n", errno); + tcerr("ioctl(TCIOC_SETTIMEOUT) failed: %d\n", errno); goto errout_with_dev; } @@ -235,7 +235,7 @@ int sam_timerinitialize(void) ret = ioctl(fd, TCIOC_SETHANDLER, (unsigned long)&tccb); if (ret < 0) { - tcdbg("ioctl(TCIOC_SETHANDLER) failed: %d\n", errno); + tcerr("ioctl(TCIOC_SETHANDLER) failed: %d\n", errno); goto errout_with_dev; } } @@ -246,7 +246,7 @@ int sam_timerinitialize(void) ret = ioctl(fd, TCIOC_START, 0); if (ret < 0) { - tcdbg("ioctl(TCIOC_START) failed: %d\n", errno); + tcerr("ioctl(TCIOC_START) failed: %d\n", errno); goto errout_with_dev; } #endif @@ -259,7 +259,7 @@ int sam_timerinitialize(void) fd = open(CONFIG_SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH, O_RDONLY); if (fd < 0) { - tcdbg("open %s failed: %d\n", + tcerr("open %s failed: %d\n", CONFIG_SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH, errno); goto errout; } @@ -272,7 +272,7 @@ int sam_timerinitialize(void) (unsigned long)1000000 / CONFIG_SCHED_CPULOAD_TICKSPERSEC); if (ret < 0) { - tcdbg("ioctl(TCIOC_SETTIMEOUT) failed: %d\n", errno); + tcerr("ioctl(TCIOC_SETTIMEOUT) failed: %d\n", errno); goto errout_with_dev; } @@ -286,7 +286,7 @@ int sam_timerinitialize(void) ret = ioctl(fd, TCIOC_SETHANDLER, (unsigned long)&tccb); if (ret < 0) { - tcdbg("ioctl(TCIOC_SETHANDLER) failed: %d\n", errno); + tcerr("ioctl(TCIOC_SETHANDLER) failed: %d\n", errno); goto errout_with_dev; } } @@ -297,7 +297,7 @@ int sam_timerinitialize(void) ret = ioctl(fd, TCIOC_START, 0); if (ret < 0) { - tcdbg("ioctl(TCIOC_START) failed: %d\n", errno); + tcerr("ioctl(TCIOC_START) failed: %d\n", errno); goto errout_with_dev; } #endif diff --git a/configs/sam4s-xplained-pro/src/sam_userleds.c b/configs/sam4s-xplained-pro/src/sam_userleds.c index bec9332670..4e41ddb13d 100644 --- a/configs/sam4s-xplained-pro/src/sam_userleds.c +++ b/configs/sam4s-xplained-pro/src/sam_userleds.c @@ -61,10 +61,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sam4s-xplained-pro/src/sam_wdt.c b/configs/sam4s-xplained-pro/src/sam_wdt.c index a71115560d..1229069905 100644 --- a/configs/sam4s-xplained-pro/src/sam_wdt.c +++ b/configs/sam4s-xplained-pro/src/sam_wdt.c @@ -90,7 +90,7 @@ #endif #ifdef CONFIG_DEBUG_WATCHDOG -# define wdgdbg dbg +# define wdgerr err # define wdgllerr llerr # ifdef CONFIG_DEBUG_INFO # define wdginfo info @@ -100,7 +100,7 @@ # define wdgllinfo(x...) # endif #else -# define wdgdbg(x...) +# define wdgerr(x...) # define wdgllerr(x...) # define wdginfo(x...) # define wdgllinfo(x...) @@ -128,7 +128,7 @@ static int wdog_daemon(int argc, char *argv[]) fd = open(CONFIG_WATCHDOG_DEVPATH, O_RDONLY); if (fd < 0) { - wdgdbg("open %s failed: %d\n", CONFIG_WATCHDOG_DEVPATH, errno); + wdgerr("open %s failed: %d\n", CONFIG_WATCHDOG_DEVPATH, errno); goto errout; } @@ -138,7 +138,7 @@ static int wdog_daemon(int argc, char *argv[]) ret = ioctl(fd, WDIOC_START, 0); if (ret < 0) { - wdgdbg("ioctl(WDIOC_START) failed: %d\n", errno); + wdgerr("ioctl(WDIOC_START) failed: %d\n", errno); goto errout_with_dev; } @@ -151,7 +151,7 @@ static int wdog_daemon(int argc, char *argv[]) ret = ioctl(fd, WDIOC_KEEPALIVE, 0); if (ret < 0) { - wdgdbg("ioctl(WDIOC_KEEPALIVE) failed: %d\n", errno); + wdgerr("ioctl(WDIOC_KEEPALIVE) failed: %d\n", errno); goto errout_with_dev; } } @@ -190,7 +190,7 @@ int sam_watchdog_initialize(void) fd = open(CONFIG_WATCHDOG_DEVPATH, O_RDONLY); if (fd < 0) { - wdgdbg("open %s failed: %d\n", CONFIG_WATCHDOG_DEVPATH, errno); + wdgerr("open %s failed: %d\n", CONFIG_WATCHDOG_DEVPATH, errno); goto errout; } @@ -200,7 +200,7 @@ int sam_watchdog_initialize(void) ret = ioctl(fd, WDIOC_SETTIMEOUT, (unsigned long)CONFIG_WDT_TIMEOUT); if (ret < 0) { - wdgdbg("ioctl(WDIOC_SETTIMEOUT) failed: %d\n", errno); + wdgerr("ioctl(WDIOC_SETTIMEOUT) failed: %d\n", errno); goto errout_with_dev; } @@ -210,7 +210,7 @@ int sam_watchdog_initialize(void) ret = ioctl(fd, WDIOC_MINTIME, (unsigned long)CONFIG_WDT_MINTIME); if (ret < 0) { - wdgdbg("ioctl(WDIOC_MINTIME) failed: %d\n", errno); + wdgerr("ioctl(WDIOC_MINTIME) failed: %d\n", errno); goto errout_with_dev; } diff --git a/configs/sam4s-xplained/src/sam_autoleds.c b/configs/sam4s-xplained/src/sam_autoleds.c index 238510c7c3..b1763f91bb 100644 --- a/configs/sam4s-xplained/src/sam_autoleds.c +++ b/configs/sam4s-xplained/src/sam_autoleds.c @@ -78,10 +78,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sam4s-xplained/src/sam_userleds.c b/configs/sam4s-xplained/src/sam_userleds.c index 06b3f83097..dbf687bdd4 100644 --- a/configs/sam4s-xplained/src/sam_userleds.c +++ b/configs/sam4s-xplained/src/sam_userleds.c @@ -60,10 +60,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sama5d2-xult/src/sam_autoleds.c b/configs/sama5d2-xult/src/sam_autoleds.c index c18908e056..c565cf8d19 100644 --- a/configs/sama5d2-xult/src/sam_autoleds.c +++ b/configs/sama5d2-xult/src/sam_autoleds.c @@ -94,10 +94,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sama5d2-xult/src/sam_bringup.c b/configs/sama5d2-xult/src/sam_bringup.c index e332c2d4e8..133e3f5199 100644 --- a/configs/sama5d2-xult/src/sam_bringup.c +++ b/configs/sama5d2-xult/src/sam_bringup.c @@ -52,7 +52,7 @@ #ifdef CONFIG_BOARD_INITIALIZE # define SYSLOG llerr #else -# define SYSLOG dbg +# define SYSLOG err #endif /**************************************************************************** diff --git a/configs/sama5d2-xult/src/sam_userleds.c b/configs/sama5d2-xult/src/sam_userleds.c index 11f191b3a1..af44730d15 100644 --- a/configs/sama5d2-xult/src/sam_userleds.c +++ b/configs/sama5d2-xult/src/sam_userleds.c @@ -70,10 +70,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sama5d3-xplained/src/sam_adc.c b/configs/sama5d3-xplained/src/sam_adc.c index f770ba5d22..876669ad56 100644 --- a/configs/sama5d3-xplained/src/sam_adc.c +++ b/configs/sama5d3-xplained/src/sam_adc.c @@ -88,7 +88,7 @@ int board_adc_initialize(void) adc = sam_adc_initialize(); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -97,7 +97,7 @@ int board_adc_initialize(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/sama5d3-xplained/src/sam_ajoystick.c b/configs/sama5d3-xplained/src/sam_ajoystick.c index e1e1a1c485..f068cf2ef9 100644 --- a/configs/sama5d3-xplained/src/sam_ajoystick.c +++ b/configs/sama5d3-xplained/src/sam_ajoystick.c @@ -193,14 +193,14 @@ static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower, int errcode = get_errno(); if (errcode != EINTR) { - idbg("ERROR: read failed: %d\n", errcode); + ierr("ERROR: read failed: %d\n", errcode); } return -errcode; } else if (nread < 2 * sizeof(struct adc_msg_s)) { - idbg("ERROR: read too small: %ld\n", (long)nread); + ierr("ERROR: read too small: %ld\n", (long)nread); return -EIO; } @@ -235,7 +235,7 @@ static int ajoy_sample(FAR const struct ajoy_lowerhalf_s *lower, if (have != 3) { - idbg("ERROR: Could not find joystack channels\n"); + ierr("ERROR: Could not find joystack channels\n"); return -EIO; } @@ -410,7 +410,7 @@ int sam_ajoy_initialization(void) ret = board_adc_initialize(); if (ret < 0) { - idbg("ERROR: board_adc_initialize() failed: %d\n", ret); + ierr("ERROR: board_adc_initialize() failed: %d\n", ret); return ret; } @@ -420,7 +420,7 @@ int sam_ajoy_initialization(void) if (fd < 0) { int errcode = get_errno(); - idbg("ERROR: Failed to open /dev/adc0: %d\n", errcode); + ierr("ERROR: Failed to open /dev/adc0: %d\n", errcode); return -errcode; } @@ -431,7 +431,7 @@ int sam_ajoy_initialization(void) ret = file_detach(fd, &g_adcfile); if (ret < 0) { - idbg("ERROR: Failed to detach from file descriptor: %d\n", ret); + ierr("ERROR: Failed to detach from file descriptor: %d\n", ret); (void)close(fd); return ret; } @@ -458,7 +458,7 @@ int sam_ajoy_initialization(void) ret = ajoy_register("/dev/ajoy0", &g_ajoylower); if (ret < 0) { - idbg("ERROR: ajoy_register failed: %d\n", ret); + ierr("ERROR: ajoy_register failed: %d\n", ret); file_close_detached(&g_adcfile); } diff --git a/configs/sama5d3-xplained/src/sam_at25.c b/configs/sama5d3-xplained/src/sam_at25.c index a6ef86fc06..6e83029119 100644 --- a/configs/sama5d3-xplained/src/sam_at25.c +++ b/configs/sama5d3-xplained/src/sam_at25.c @@ -87,7 +87,7 @@ int sam_at25_automount(int minor) spi = sam_spibus_initialize(AT25_PORT); if (!spi) { - fdbg("ERROR: Failed to initialize SPI port %d\n", AT25_PORT); + ferr("ERROR: Failed to initialize SPI port %d\n", AT25_PORT); return -ENODEV; } @@ -96,7 +96,7 @@ int sam_at25_automount(int minor) mtd = at25_initialize(spi); if (!mtd) { - fdbg("ERROR: Failed to bind SPI port %d to the AT25 FLASH driver\n"); + ferr("ERROR: Failed to bind SPI port %d to the AT25 FLASH driver\n"); return -ENODEV; } @@ -106,7 +106,7 @@ int sam_at25_automount(int minor) ret = ftl_initialize(AT25_MINOR, mtd); if (ret < 0) { - fdbg("ERROR: Failed to initialize the FTL layer: %d\n", ret); + ferr("ERROR: Failed to initialize the FTL layer: %d\n", ret); return ret; } @@ -116,7 +116,7 @@ int sam_at25_automount(int minor) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", ret); + ferr("ERROR: NXFFS initialization failed: %d\n", ret); return ret; } @@ -125,7 +125,7 @@ int sam_at25_automount(int minor) ret = mount(NULL, "/mnt/at25", "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif diff --git a/configs/sama5d3-xplained/src/sam_autoleds.c b/configs/sama5d3-xplained/src/sam_autoleds.c index b9f84bb074..046ab9a7f9 100644 --- a/configs/sama5d3-xplained/src/sam_autoleds.c +++ b/configs/sama5d3-xplained/src/sam_autoleds.c @@ -96,10 +96,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sama5d3-xplained/src/sam_can.c b/configs/sama5d3-xplained/src/sam_can.c index a8c59ecbb5..8cf06c3b9b 100644 --- a/configs/sama5d3-xplained/src/sam_can.c +++ b/configs/sama5d3-xplained/src/sam_can.c @@ -73,12 +73,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -116,7 +116,7 @@ int board_can_initialize(void) can = sam_caninitialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -125,7 +125,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/sama5d3-xplained/src/sam_ethernet.c b/configs/sama5d3-xplained/src/sam_ethernet.c index 75c9a7f0fc..d7a29ed54e 100644 --- a/configs/sama5d3-xplained/src/sam_ethernet.c +++ b/configs/sama5d3-xplained/src/sam_ethernet.c @@ -84,10 +84,10 @@ */ #ifdef CONFIG_NETDEV_PHY_DEBUG -# define phydbg dbg +# define phyerr err # define phyllerr llerr #else -# define phydbg(x...) +# define phyerr(x...) # define phyllerr(x...) #endif @@ -116,7 +116,7 @@ static xcpt_t g_gmac_handler; #ifdef CONFIG_SAMA5_EMACA static void sam_emac_phy_enable(bool enable) { - phydbg("IRQ%d: enable=%d\n", IRQ_INT_ETH1, enable); + phyerr("IRQ%d: enable=%d\n", IRQ_INT_ETH1, enable); if (enable) { sam_pioirqenable(IRQ_INT_ETH1); @@ -132,7 +132,7 @@ static void sam_emac_phy_enable(bool enable) #ifdef CONFIG_SAMA5_GMAC static void sam_gmac_phy_enable(bool enable) { - phydbg("IRQ%d: enable=%d\n", IRQ_INT_ETH0, enable); + phyerr("IRQ%d: enable=%d\n", IRQ_INT_ETH0, enable); if (enable) { sam_pioirqenable(IRQ_INT_ETH0); @@ -179,7 +179,7 @@ void weak_function sam_netinitialize(void) * The KSZ8051 PHY interrupt is available on PE30 INT_ETH1 */ - phydbg("Configuring %08x\n", PIO_INT_ETH1); + phyerr("Configuring %08x\n", PIO_INT_ETH1); sam_configpio(PIO_INT_ETH1); #endif @@ -196,7 +196,7 @@ void weak_function sam_netinitialize(void) * The KSZ9021/31 interrupt is available on PB35 INT_GETH0 */ - phydbg("Configuring %08x\n", PIO_INT_ETH0); + phyerr("Configuring %08x\n", PIO_INT_ETH0); sam_configpio(PIO_INT_ETH0); #endif } @@ -278,16 +278,16 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) ninfo("%s: handler=%p\n", intf, handler); #ifdef CONFIG_SAMA5_EMACA - phydbg("EMAC: devname=%s\n", SAMA5_EMAC_DEVNAME); + phyerr("EMAC: devname=%s\n", SAMA5_EMAC_DEVNAME); #endif #ifdef CONFIG_SAMA5_GMAC - phydbg("GMAC: devname=%s\n", SAMA5_GMAC_DEVNAME); + phyerr("GMAC: devname=%s\n", SAMA5_GMAC_DEVNAME); #endif #ifdef CONFIG_SAMA5_EMACA if (strcmp(intf, SAMA5_EMAC_DEVNAME) == 0) { - phydbg("Select EMAC\n"); + phyerr("Select EMAC\n"); phandler = &g_emac_handler; pinset = PIO_INT_ETH1; irq = IRQ_INT_ETH1; @@ -298,7 +298,7 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) #ifdef CONFIG_SAMA5_GMAC if (strcmp(intf, SAMA5_GMAC_DEVNAME) == 0) { - phydbg("Select GMAC\n"); + phyerr("Select GMAC\n"); phandler = &g_gmac_handler; pinset = PIO_INT_ETH0; irq = IRQ_INT_ETH0; @@ -307,7 +307,7 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) else #endif { - ndbg("Unsupported interface: %s\n", intf); + nerr("Unsupported interface: %s\n", intf); return NULL; } @@ -326,15 +326,15 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) if (handler) { - phydbg("Configure pin: %08x\n", pinset); + phyerr("Configure pin: %08x\n", pinset); sam_pioirq(pinset); - phydbg("Attach IRQ%d\n", irq); + phyerr("Attach IRQ%d\n", irq); (void)irq_attach(irq, handler); } else { - phydbg("Detach IRQ%d\n", irq); + phyerr("Detach IRQ%d\n", irq); (void)irq_detach(irq); enabler = NULL; } diff --git a/configs/sama5d3-xplained/src/sam_hsmci.c b/configs/sama5d3-xplained/src/sam_hsmci.c index 2db5dd8d16..a3416189fb 100644 --- a/configs/sama5d3-xplained/src/sam_hsmci.c +++ b/configs/sama5d3-xplained/src/sam_hsmci.c @@ -257,7 +257,7 @@ int sam_hsmci_initialize(int slotno, int minor) state = sam_hsmci_state(slotno); if (!state) { - fdbg("No state for slotno %d\n", slotno); + ferr("No state for slotno %d\n", slotno); return -EINVAL; } @@ -271,7 +271,7 @@ int sam_hsmci_initialize(int slotno, int minor) state->hsmci = sdio_initialize(slotno); if (!state->hsmci) { - fdbg("Failed to initialize SDIO slot %d\n", slotno); + ferr("Failed to initialize SDIO slot %d\n", slotno); return -ENODEV; } @@ -280,7 +280,7 @@ int sam_hsmci_initialize(int slotno, int minor) ret = mmcsd_slotinitialize(minor, state->hsmci); if (ret != OK) { - fdbg("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + ferr("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } @@ -317,7 +317,7 @@ bool sam_cardinserted(int slotno) state = sam_hsmci_state(slotno); if (!state) { - fdbg("No state for slotno %d\n", slotno); + ferr("No state for slotno %d\n", slotno); return false; } diff --git a/configs/sama5d3-xplained/src/sam_i2schar.c b/configs/sama5d3-xplained/src/sam_i2schar.c index 8842c1046f..67d271edc6 100644 --- a/configs/sama5d3-xplained/src/sam_i2schar.c +++ b/configs/sama5d3-xplained/src/sam_i2schar.c @@ -99,7 +99,7 @@ int i2schar_devinit(void) i2s = sam_ssc_initialize(CONFIG_SAMA5D3XPLAINED_SSC_PORT); if (!i2s) { - dbg("ERROR: Failed to get the SAMA5 SSC/I2S driver for SSC%d\n", + err("ERROR: Failed to get the SAMA5 SSC/I2S driver for SSC%d\n", CONFIG_SAMA5D3XPLAINED_SSC_PORT); return -ENODEV; } @@ -109,7 +109,7 @@ int i2schar_devinit(void) ret = i2schar_register(i2s, CONFIG_SAMA5D3XPLAINED_I2SCHAR_MINOR); if (ret < 0) { - adbg("ERROR: i2schar_register failed: %d\n", ret); + aerr("ERROR: i2schar_register failed: %d\n", ret); return ret; } diff --git a/configs/sama5d3-xplained/src/sam_nandflash.c b/configs/sama5d3-xplained/src/sam_nandflash.c index 270b3624da..69157cc3fa 100644 --- a/configs/sama5d3-xplained/src/sam_nandflash.c +++ b/configs/sama5d3-xplained/src/sam_nandflash.c @@ -186,7 +186,7 @@ int sam_nand_automount(int minor) mtd = sam_nand_initialize(HSMC_CS3); if (!mtd) { - fdbg("ERROR: Failed to create the NAND driver on CS%d\n", HSMC_CS3); + ferr("ERROR: Failed to create the NAND driver on CS%d\n", HSMC_CS3); return -ENODEV; } @@ -196,7 +196,7 @@ int sam_nand_automount(int minor) ret = ftl_initialize(NAND_MINOR, mtd); if (ret < 0) { - fdbg("ERROR: Failed to initialize the FTL layer: %d\n", ret); + ferr("ERROR: Failed to initialize the FTL layer: %d\n", ret); return ret; } @@ -206,7 +206,7 @@ int sam_nand_automount(int minor) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", ret); + ferr("ERROR: NXFFS initialization failed: %d\n", ret); return ret; } @@ -215,7 +215,7 @@ int sam_nand_automount(int minor) ret = mount(NULL, "/mnt/nand", "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif diff --git a/configs/sama5d3-xplained/src/sam_pwm.c b/configs/sama5d3-xplained/src/sam_pwm.c index 59eca5189c..15be11b576 100644 --- a/configs/sama5d3-xplained/src/sam_pwm.c +++ b/configs/sama5d3-xplained/src/sam_pwm.c @@ -139,7 +139,7 @@ int board_pwm_setup(void) pwm = sam_pwminitialize(CONFIG_SAMA5D3XPLAINED_CHANNEL); if (!pwm) { - dbg("Failed to get the SAMA5 PWM lower half\n"); + err("Failed to get the SAMA5 PWM lower half\n"); return -ENODEV; } @@ -148,7 +148,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/sama5d3-xplained/src/sam_spi.c b/configs/sama5d3-xplained/src/sam_spi.c index 4806c9c61c..41a57cd63f 100644 --- a/configs/sama5d3-xplained/src/sam_spi.c +++ b/configs/sama5d3-xplained/src/sam_spi.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/sama5d3-xplained/src/sam_usb.c b/configs/sama5d3-xplained/src/sam_usb.c index d071064d09..a12e09f31b 100644 --- a/configs/sama5d3-xplained/src/sam_usb.c +++ b/configs/sama5d3-xplained/src/sam_usb.c @@ -309,7 +309,7 @@ int sam_usbhost_initialize(void) ret = usbhost_hub_initialize(); if (ret < 0) { - udbg("ERROR: usbhost_hub_initialize failed: %d\n", ret); + uerr("ERROR: usbhost_hub_initialize failed: %d\n", ret); } #endif @@ -319,7 +319,7 @@ int sam_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the mass storage class: %d\n", ret); + uerr("ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -329,7 +329,7 @@ int sam_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + uerr("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif @@ -339,7 +339,7 @@ int sam_usbhost_initialize(void) ret = usbhost_kbdinit(); if (ret != OK) { - udbg("ERROR: Failed to register the KBD class\n"); + uerr("ERROR: Failed to register the KBD class\n"); } #endif @@ -351,7 +351,7 @@ int sam_usbhost_initialize(void) g_ohciconn = sam_ohci_initialize(0); if (!g_ohciconn) { - udbg("ERROR: sam_ohci_initialize failed\n"); + uerr("ERROR: sam_ohci_initialize failed\n"); return -ENODEV; } @@ -362,7 +362,7 @@ int sam_usbhost_initialize(void) (main_t)ohci_waiter, (FAR char * const *)NULL); if (pid < 0) { - udbg("ERROR: Failed to create ohci_waiter task: %d\n", ret); + uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret); return -ENODEV; } #endif @@ -373,7 +373,7 @@ int sam_usbhost_initialize(void) g_ehciconn = sam_ehci_initialize(0); if (!g_ehciconn) { - udbg("ERROR: sam_ehci_initialize failed\n"); + uerr("ERROR: sam_ehci_initialize failed\n"); return -ENODEV; } @@ -384,7 +384,7 @@ int sam_usbhost_initialize(void) (main_t)ehci_waiter, (FAR char * const *)NULL); if (pid < 0) { - udbg("ERROR: Failed to create ehci_waiter task: %d\n", ret); + uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret); return -ENODEV; } #endif @@ -423,13 +423,13 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) { case SAM_RHPORT1: #if !defined(CONFIG_SAMA5_UHPHS_RHPORT1) - udbg("ERROR: RHPort1 is not available in this configuration\n"); + uerr("ERROR: RHPort1 is not available in this configuration\n"); return; #elif !defined(PIO_USBA_VBUS_ENABLE) /* SAMA5D3-Xplained has no port A VBUS enable */ - udbg("ERROR: RHPort1 has no VBUS enable\n"); + uerr("ERROR: RHPort1 has no VBUS enable\n"); return; #else pinset = PIO_USBA_VBUS_ENABLE; @@ -438,7 +438,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) case SAM_RHPORT2: #ifndef CONFIG_SAMA5_UHPHS_RHPORT2 - udbg("ERROR: RHPort2 is not available in this configuration\n"); + uerr("ERROR: RHPort2 is not available in this configuration\n"); return; #else pinset = PIO_USBB_VBUS_ENABLE; @@ -447,7 +447,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) case SAM_RHPORT3: #ifndef CONFIG_SAMA5_UHPHS_RHPORT3 - udbg("ERROR: RHPort3 is not available in this configuration\n"); + uerr("ERROR: RHPort3 is not available in this configuration\n"); return; #else pinset = PIO_USBC_VBUS_ENABLE; @@ -455,7 +455,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) #endif default: - udbg("ERROR: RHPort%d is not supported\n", rhport+1); + uerr("ERROR: RHPort%d is not supported\n", rhport+1); return; } diff --git a/configs/sama5d3-xplained/src/sam_userleds.c b/configs/sama5d3-xplained/src/sam_userleds.c index 2d85d2ef83..0a7ae94e57 100644 --- a/configs/sama5d3-xplained/src/sam_userleds.c +++ b/configs/sama5d3-xplained/src/sam_userleds.c @@ -72,10 +72,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sama5d3x-ek/src/sam_adc.c b/configs/sama5d3x-ek/src/sam_adc.c index f27ba7be0d..2c9c5e974f 100644 --- a/configs/sama5d3x-ek/src/sam_adc.c +++ b/configs/sama5d3x-ek/src/sam_adc.c @@ -92,7 +92,7 @@ int board_adc_setup(void) adc = sam_adc_initialize(); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -101,7 +101,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/sama5d3x-ek/src/sam_at24.c b/configs/sama5d3x-ek/src/sam_at24.c index 39a57464a5..cd8b8cade7 100644 --- a/configs/sama5d3x-ek/src/sam_at24.c +++ b/configs/sama5d3x-ek/src/sam_at24.c @@ -106,7 +106,7 @@ int sam_at24_automount(int minor) i2c = sam_i2cbus_initialize(AT24_BUS); if (!i2c) { - fdbg("ERROR: Failed to initialize TWI%d\n", AT24_BUS); + ferr("ERROR: Failed to initialize TWI%d\n", AT24_BUS); return -ENODEV; } @@ -116,7 +116,7 @@ int sam_at24_automount(int minor) mtd = at24c_initialize(i2c); if (!mtd) { - fdbg("ERROR: Failed to bind TWI%d to the AT24 EEPROM driver\n", + ferr("ERROR: Failed to bind TWI%d to the AT24 EEPROM driver\n", AT24_BUS); return -ENODEV; } @@ -128,7 +128,7 @@ int sam_at24_automount(int minor) ret = ftl_initialize(AT24_MINOR, mtd); if (ret < 0) { - fdbg("ERROR: Failed to initialize the FTL layer: %d\n", ret); + ferr("ERROR: Failed to initialize the FTL layer: %d\n", ret); return ret; } @@ -139,7 +139,7 @@ int sam_at24_automount(int minor) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", ret); + ferr("ERROR: NXFFS initialization failed: %d\n", ret); return ret; } @@ -149,7 +149,7 @@ int sam_at24_automount(int minor) ret = mount(NULL, "/mnt/at24", "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif diff --git a/configs/sama5d3x-ek/src/sam_at25.c b/configs/sama5d3x-ek/src/sam_at25.c index 14a77b9493..8c86d3ccaa 100644 --- a/configs/sama5d3x-ek/src/sam_at25.c +++ b/configs/sama5d3x-ek/src/sam_at25.c @@ -87,7 +87,7 @@ int sam_at25_automount(int minor) spi = sam_spibus_initialize(AT25_PORT); if (!spi) { - fdbg("ERROR: Failed to initialize SPI port %d\n", AT25_PORT); + ferr("ERROR: Failed to initialize SPI port %d\n", AT25_PORT); return -ENODEV; } @@ -96,7 +96,7 @@ int sam_at25_automount(int minor) mtd = at25_initialize(spi); if (!mtd) { - fdbg("ERROR: Failed to bind SPI port %d to the AT25 FLASH driver\n"); + ferr("ERROR: Failed to bind SPI port %d to the AT25 FLASH driver\n"); return -ENODEV; } @@ -106,7 +106,7 @@ int sam_at25_automount(int minor) ret = ftl_initialize(AT25_MINOR, mtd); if (ret < 0) { - fdbg("ERROR: Failed to initialize the FTL layer: %d\n", ret); + ferr("ERROR: Failed to initialize the FTL layer: %d\n", ret); return ret; } @@ -116,7 +116,7 @@ int sam_at25_automount(int minor) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", ret); + ferr("ERROR: NXFFS initialization failed: %d\n", ret); return ret; } @@ -125,7 +125,7 @@ int sam_at25_automount(int minor) ret = mount(NULL, "/mnt/at25", "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif diff --git a/configs/sama5d3x-ek/src/sam_autoleds.c b/configs/sama5d3x-ek/src/sam_autoleds.c index 79188d84f7..12ef20cd8d 100644 --- a/configs/sama5d3x-ek/src/sam_autoleds.c +++ b/configs/sama5d3x-ek/src/sam_autoleds.c @@ -96,10 +96,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sama5d3x-ek/src/sam_can.c b/configs/sama5d3x-ek/src/sam_can.c index 176be69ce6..2cdc4a4816 100644 --- a/configs/sama5d3x-ek/src/sam_can.c +++ b/configs/sama5d3x-ek/src/sam_can.c @@ -73,12 +73,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -116,7 +116,7 @@ int board_can_initialize(void) can = sam_caninitialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -125,7 +125,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/sama5d3x-ek/src/sam_ethernet.c b/configs/sama5d3x-ek/src/sam_ethernet.c index 7a70518fe9..4285577a03 100644 --- a/configs/sama5d3x-ek/src/sam_ethernet.c +++ b/configs/sama5d3x-ek/src/sam_ethernet.c @@ -84,10 +84,10 @@ */ #ifdef CONFIG_NETDEV_PHY_DEBUG -# define phydbg dbg +# define phyerr err # define phyllerr llerr #else -# define phydbg(x...) +# define phyerr(x...) # define phyllerr(x...) #endif @@ -116,7 +116,7 @@ static xcpt_t g_gmac_handler; #ifdef CONFIG_SAMA5_EMACA static void sam_emac_phy_enable(bool enable) { - phydbg("IRQ%d: enable=%d\n", IRQ_INT_ETH1, enable); + phyerr("IRQ%d: enable=%d\n", IRQ_INT_ETH1, enable); if (enable) { sam_pioirqenable(IRQ_INT_ETH1); @@ -132,7 +132,7 @@ static void sam_emac_phy_enable(bool enable) #ifdef CONFIG_SAMA5_GMAC static void sam_gmac_phy_enable(bool enable) { - phydbg("IRQ%d: enable=%d\n", IRQ_INT_ETH0, enable); + phyerr("IRQ%d: enable=%d\n", IRQ_INT_ETH0, enable); if (enable) { sam_pioirqenable(IRQ_INT_ETH0); @@ -179,7 +179,7 @@ void weak_function sam_netinitialize(void) * The KSZ8051 PHY interrupt is available on PE30 INT_ETH1 */ - phydbg("Configuring %08x\n", PIO_INT_ETH1); + phyerr("Configuring %08x\n", PIO_INT_ETH1); sam_configpio(PIO_INT_ETH1); #endif @@ -196,7 +196,7 @@ void weak_function sam_netinitialize(void) * The KSZ9021/31 interrupt is available on PB35 INT_GETH0 */ - phydbg("Configuring %08x\n", PIO_INT_ETH0); + phyerr("Configuring %08x\n", PIO_INT_ETH0); sam_configpio(PIO_INT_ETH0); #endif } @@ -278,16 +278,16 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) ninfo("%s: handler=%p\n", intf, handler); #ifdef CONFIG_SAMA5_EMACA - phydbg("EMAC: devname=%s\n", SAMA5_EMAC_DEVNAME); + phyerr("EMAC: devname=%s\n", SAMA5_EMAC_DEVNAME); #endif #ifdef CONFIG_SAMA5_GMAC - phydbg("GMAC: devname=%s\n", SAMA5_GMAC_DEVNAME); + phyerr("GMAC: devname=%s\n", SAMA5_GMAC_DEVNAME); #endif #ifdef CONFIG_SAMA5_EMACA if (strcmp(intf, SAMA5_EMAC_DEVNAME) == 0) { - phydbg("Select EMAC\n"); + phyerr("Select EMAC\n"); phandler = &g_emac_handler; pinset = PIO_INT_ETH1; irq = IRQ_INT_ETH1; @@ -298,7 +298,7 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) #ifdef CONFIG_SAMA5_GMAC if (strcmp(intf, SAMA5_GMAC_DEVNAME) == 0) { - phydbg("Select GMAC\n"); + phyerr("Select GMAC\n"); phandler = &g_gmac_handler; pinset = PIO_INT_ETH0; irq = IRQ_INT_ETH0; @@ -307,7 +307,7 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) else #endif { - ndbg("Unsupported interface: %s\n", intf); + nerr("Unsupported interface: %s\n", intf); return NULL; } @@ -326,15 +326,15 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) if (handler) { - phydbg("Configure pin: %08x\n", pinset); + phyerr("Configure pin: %08x\n", pinset); sam_pioirq(pinset); - phydbg("Attach IRQ%d\n", irq); + phyerr("Attach IRQ%d\n", irq); (void)irq_attach(irq, handler); } else { - phydbg("Detach IRQ%d\n", irq); + phyerr("Detach IRQ%d\n", irq); (void)irq_detach(irq); enabler = NULL; } diff --git a/configs/sama5d3x-ek/src/sam_hsmci.c b/configs/sama5d3x-ek/src/sam_hsmci.c index 693563f5ca..5976b2ca3e 100644 --- a/configs/sama5d3x-ek/src/sam_hsmci.c +++ b/configs/sama5d3x-ek/src/sam_hsmci.c @@ -257,7 +257,7 @@ int sam_hsmci_initialize(int slotno, int minor) state = sam_hsmci_state(slotno); if (!state) { - fdbg("No state for slotno %d\n", slotno); + ferr("No state for slotno %d\n", slotno); return -EINVAL; } @@ -271,7 +271,7 @@ int sam_hsmci_initialize(int slotno, int minor) state->hsmci = sdio_initialize(slotno); if (!state->hsmci) { - fdbg("Failed to initialize SDIO slot %d\n", slotno); + ferr("Failed to initialize SDIO slot %d\n", slotno); return -ENODEV; } @@ -280,7 +280,7 @@ int sam_hsmci_initialize(int slotno, int minor) ret = mmcsd_slotinitialize(minor, state->hsmci); if (ret != OK) { - fdbg("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + ferr("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } @@ -317,7 +317,7 @@ bool sam_cardinserted(int slotno) state = sam_hsmci_state(slotno); if (!state) { - fdbg("No state for slotno %d\n", slotno); + ferr("No state for slotno %d\n", slotno); return false; } diff --git a/configs/sama5d3x-ek/src/sam_i2schar.c b/configs/sama5d3x-ek/src/sam_i2schar.c index 5fa7c324db..21a88b3743 100644 --- a/configs/sama5d3x-ek/src/sam_i2schar.c +++ b/configs/sama5d3x-ek/src/sam_i2schar.c @@ -99,7 +99,7 @@ int i2schar_devinit(void) i2s = sam_ssc_initialize(CONFIG_SAMA5D3xEK_SSC_PORT); if (!i2s) { - dbg("ERROR: Failed to get the SAMA5 SSC/I2S driver for SSC%d\n", + err("ERROR: Failed to get the SAMA5 SSC/I2S driver for SSC%d\n", CONFIG_SAMA5D3xEK_SSC_PORT); return -ENODEV; } @@ -109,7 +109,7 @@ int i2schar_devinit(void) ret = i2schar_register(i2s, CONFIG_SAMA5D3xEK_I2SCHAR_MINOR); if (ret < 0) { - adbg("ERROR: i2schar_register failed: %d\n", ret); + aerr("ERROR: i2schar_register failed: %d\n", ret); return ret; } diff --git a/configs/sama5d3x-ek/src/sam_nandflash.c b/configs/sama5d3x-ek/src/sam_nandflash.c index 709d3c240c..50c327e9f3 100644 --- a/configs/sama5d3x-ek/src/sam_nandflash.c +++ b/configs/sama5d3x-ek/src/sam_nandflash.c @@ -186,7 +186,7 @@ int sam_nand_automount(int minor) mtd = sam_nand_initialize(HSMC_CS3); if (!mtd) { - fdbg("ERROR: Failed to create the NAND driver on CS%d\n", HSMC_CS3); + ferr("ERROR: Failed to create the NAND driver on CS%d\n", HSMC_CS3); return -ENODEV; } @@ -196,7 +196,7 @@ int sam_nand_automount(int minor) ret = ftl_initialize(NAND_MINOR, mtd); if (ret < 0) { - fdbg("ERROR: Failed to initialize the FTL layer: %d\n", ret); + ferr("ERROR: Failed to initialize the FTL layer: %d\n", ret); return ret; } @@ -206,7 +206,7 @@ int sam_nand_automount(int minor) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", ret); + ferr("ERROR: NXFFS initialization failed: %d\n", ret); return ret; } @@ -215,7 +215,7 @@ int sam_nand_automount(int minor) ret = mount(NULL, "/mnt/nand", "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif diff --git a/configs/sama5d3x-ek/src/sam_ov2640.c b/configs/sama5d3x-ek/src/sam_ov2640.c index f7015f2a3b..dfaf2dbfc1 100644 --- a/configs/sama5d3x-ek/src/sam_ov2640.c +++ b/configs/sama5d3x-ek/src/sam_ov2640.c @@ -88,14 +88,14 @@ static inline FAR struct fb_vtable_s *ov2640_lcd_initialize(void) ret = up_fbinitialize(0); if (ret < 0) { - gdbg("ERROR: up_fbinitialize failed: %d\n", -ret); + gerr("ERROR: up_fbinitialize failed: %d\n", -ret); return NULL; } vplane = up_fbgetvplane(0, 0); if (!vplane) { - gdbg("ERROR: up_fbgetvplane failed\n"); + gerr("ERROR: up_fbgetvplane failed\n"); } return vplane; @@ -161,7 +161,7 @@ static inline int ov2640_camera_initialize(void) i2c = sam_i2cbus_initialize(OV2640_BUS); if (!i2c) { - gdbg("ERROR: Failed to initialize TWI%d\n", OV2640_BUS); + gerr("ERROR: Failed to initialize TWI%d\n", OV2640_BUS); return EXIT_FAILURE; } @@ -210,7 +210,7 @@ static inline int ov2640_camera_initialize(void) ret = ov2640_initialize(i2c); if (ret < 0) { - gdbg("ERROR: Failed to initialize the OV2640: %d\n", ret); + gerr("ERROR: Failed to initialize the OV2640: %d\n", ret); return EXIT_FAILURE; } @@ -239,7 +239,7 @@ int ov2640_main(int argc, char *argv[]) vplane = ov2640_lcd_initialize(); if (!vplane) { - gdbg("ERROR: ov2640_lcd_initialize failed\n"); + gerr("ERROR: ov2640_lcd_initialize failed\n"); return EXIT_FAILURE; } @@ -248,7 +248,7 @@ int ov2640_main(int argc, char *argv[]) ret = ov2640_camera_initialize(); if (ret != EXIT_SUCCESS) { - gdbg("ERROR: ov2640_camera_initialize failed\n"); + gerr("ERROR: ov2640_camera_initialize failed\n"); return EXIT_FAILURE; } diff --git a/configs/sama5d3x-ek/src/sam_pwm.c b/configs/sama5d3x-ek/src/sam_pwm.c index 79ff78e337..6bafa8c2db 100644 --- a/configs/sama5d3x-ek/src/sam_pwm.c +++ b/configs/sama5d3x-ek/src/sam_pwm.c @@ -139,7 +139,7 @@ int board_pwm_setup(void) pwm = sam_pwminitialize(CONFIG_SAMA5D3xEK_CHANNEL); if (!pwm) { - dbg("Failed to get the SAMA5 PWM lower half\n"); + err("Failed to get the SAMA5 PWM lower half\n"); return -ENODEV; } @@ -148,7 +148,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/sama5d3x-ek/src/sam_spi.c b/configs/sama5d3x-ek/src/sam_spi.c index eb0287e72c..0dc1129553 100644 --- a/configs/sama5d3x-ek/src/sam_spi.c +++ b/configs/sama5d3x-ek/src/sam_spi.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/sama5d3x-ek/src/sam_touchscreen.c b/configs/sama5d3x-ek/src/sam_touchscreen.c index 4b69d561ac..2b03f01cb1 100644 --- a/configs/sama5d3x-ek/src/sam_touchscreen.c +++ b/configs/sama5d3x-ek/src/sam_touchscreen.c @@ -108,7 +108,7 @@ int board_tsc_setup(int minor) static bool initialized = false; int ret; - idbg("initialized:%d minor:%d\n", initialized, minor); + ierr("initialized:%d minor:%d\n", initialized, minor); DEBUGASSERT(minor == 0); /* Since there is no uninitialized logic, this initialization can be @@ -122,7 +122,7 @@ int board_tsc_setup(int minor) adc = sam_adc_initialize(); if (!adc) { - idbg("ERROR: Failed to initialize the ADC driver\n"); + ierr("ERROR: Failed to initialize the ADC driver\n"); return -ENODEV; } @@ -131,7 +131,7 @@ int board_tsc_setup(int minor) ret = sam_tsd_register(adc, CONFIG_SAMA5D3xEK_TSD_DEVMINOR); if (ret < 0) { - idbg("ERROR: Failed to register touchscreen device /dev/input%d: %d\n", + ierr("ERROR: Failed to register touchscreen device /dev/input%d: %d\n", CONFIG_SAMA5D3xEK_TSD_DEVMINOR, ret); return -ENODEV; } diff --git a/configs/sama5d3x-ek/src/sam_usb.c b/configs/sama5d3x-ek/src/sam_usb.c index 73d6ab4766..91b5cfbf9c 100644 --- a/configs/sama5d3x-ek/src/sam_usb.c +++ b/configs/sama5d3x-ek/src/sam_usb.c @@ -307,7 +307,7 @@ int sam_usbhost_initialize(void) ret = usbhost_hub_initialize(); if (ret < 0) { - udbg("ERROR: usbhost_hub_initialize failed: %d\n", ret); + uerr("ERROR: usbhost_hub_initialize failed: %d\n", ret); } #endif @@ -317,7 +317,7 @@ int sam_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the mass storage class: %d\n", ret); + uerr("ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -327,7 +327,7 @@ int sam_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + uerr("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif @@ -337,7 +337,7 @@ int sam_usbhost_initialize(void) ret = usbhost_kbdinit(); if (ret != OK) { - udbg("ERROR: Failed to register the KBD class\n"); + uerr("ERROR: Failed to register the KBD class\n"); } #endif @@ -349,7 +349,7 @@ int sam_usbhost_initialize(void) g_ohciconn = sam_ohci_initialize(0); if (!g_ohciconn) { - udbg("ERROR: sam_ohci_initialize failed\n"); + uerr("ERROR: sam_ohci_initialize failed\n"); return -ENODEV; } @@ -360,7 +360,7 @@ int sam_usbhost_initialize(void) (main_t)ohci_waiter, (FAR char * const *)NULL); if (pid < 0) { - udbg("ERROR: Failed to create ohci_waiter task: %d\n", ret); + uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret); return -ENODEV; } #endif @@ -371,7 +371,7 @@ int sam_usbhost_initialize(void) g_ehciconn = sam_ehci_initialize(0); if (!g_ehciconn) { - udbg("ERROR: sam_ehci_initialize failed\n"); + uerr("ERROR: sam_ehci_initialize failed\n"); return -ENODEV; } @@ -382,7 +382,7 @@ int sam_usbhost_initialize(void) (main_t)ehci_waiter, (FAR char * const *)NULL); if (pid < 0) { - udbg("ERROR: Failed to create ehci_waiter task: %d\n", ret); + uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret); return -ENODEV; } #endif @@ -421,7 +421,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) { case SAM_RHPORT1: #ifndef CONFIG_SAMA5_UHPHS_RHPORT1 - udbg("ERROR: RHPort1 is not available in this configuration\n"); + uerr("ERROR: RHPort1 is not available in this configuration\n"); return; #else pinset = PIO_USBA_VBUS_ENABLE; @@ -430,7 +430,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) case SAM_RHPORT2: #ifndef CONFIG_SAMA5_UHPHS_RHPORT2 - udbg("ERROR: RHPort2 is not available in this configuration\n"); + uerr("ERROR: RHPort2 is not available in this configuration\n"); return; #else pinset = PIO_USBB_VBUS_ENABLE; @@ -439,7 +439,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) case SAM_RHPORT3: #ifndef CONFIG_SAMA5_UHPHS_RHPORT3 - udbg("ERROR: RHPort3 is not available in this configuration\n"); + uerr("ERROR: RHPort3 is not available in this configuration\n"); return; #else pinset = PIO_USBC_VBUS_ENABLE; @@ -447,7 +447,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) #endif default: - udbg("ERROR: RHPort%d is not supported\n", rhport+1); + uerr("ERROR: RHPort%d is not supported\n", rhport+1); return; } diff --git a/configs/sama5d3x-ek/src/sam_userleds.c b/configs/sama5d3x-ek/src/sam_userleds.c index 381d1be064..410305f53e 100644 --- a/configs/sama5d3x-ek/src/sam_userleds.c +++ b/configs/sama5d3x-ek/src/sam_userleds.c @@ -72,10 +72,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sama5d3x-ek/src/sam_wm8904.c b/configs/sama5d3x-ek/src/sam_wm8904.c index 70707a3aee..4df81d2178 100644 --- a/configs/sama5d3x-ek/src/sam_wm8904.c +++ b/configs/sama5d3x-ek/src/sam_wm8904.c @@ -253,7 +253,7 @@ int sam_wm8904_initialize(int minor) char devname[12]; int ret; - auddbg("minor %d\n", minor); + auderr("minor %d\n", minor); DEBUGASSERT(minor >= 0 && minor <= 25); /* Have we already initialized? Since we never uninitialize we must prevent @@ -273,7 +273,7 @@ int sam_wm8904_initialize(int minor) i2c = sam_i2cbus_initialize(WM8904_TWI_BUS); if (!i2c) { - auddbg("Failed to initialize TWI%d\n", WM8904_TWI_BUS); + auderr("Failed to initialize TWI%d\n", WM8904_TWI_BUS); ret = -ENODEV; goto errout; } @@ -283,7 +283,7 @@ int sam_wm8904_initialize(int minor) i2s = sam_ssc_initialize(WM8904_SSC_BUS); if (!i2s) { - auddbg("Failed to initialize SSC%d\n", WM8904_SSC_BUS); + auderr("Failed to initialize SSC%d\n", WM8904_SSC_BUS); ret = -ENODEV; goto errout_with_i2c; } @@ -314,7 +314,7 @@ int sam_wm8904_initialize(int minor) ret = irq_attach(IRQ_INT_WM8904, wm8904_interrupt); if (ret < 0) { - auddbg("ERROR: Failed to attach WM8904 interrupt: %d\n", ret); + auderr("ERROR: Failed to attach WM8904 interrupt: %d\n", ret); goto errout_with_i2s; } @@ -325,7 +325,7 @@ int sam_wm8904_initialize(int minor) wm8904 = wm8904_initialize(i2c, i2s, &g_wm8904info.lower); if (!wm8904) { - auddbg("Failed to initialize the WM8904\n"); + auderr("Failed to initialize the WM8904\n"); ret = -ENODEV; goto errout_with_irq; } @@ -338,7 +338,7 @@ int sam_wm8904_initialize(int minor) pcm = pcm_decode_initialize(wm8904); if (!pcm) { - auddbg("ERROR: Failed create the PCM decoder\n"); + auderr("ERROR: Failed create the PCM decoder\n"); ret = -ENODEV; goto errout_with_wm8904; } @@ -355,7 +355,7 @@ int sam_wm8904_initialize(int minor) ret = audio_register(devname, pcm); if (ret < 0) { - auddbg("ERROR: Failed to register /dev/%s device: %d\n", devname, ret); + auderr("ERROR: Failed to register /dev/%s device: %d\n", devname, ret); goto errout_with_pcm; } diff --git a/configs/sama5d4-ek/src/sam_adc.c b/configs/sama5d4-ek/src/sam_adc.c index 13346a91b9..7615553455 100644 --- a/configs/sama5d4-ek/src/sam_adc.c +++ b/configs/sama5d4-ek/src/sam_adc.c @@ -91,7 +91,7 @@ int board_adc_setup(void) adc = sam_adc_initialize(); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -100,7 +100,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/sama5d4-ek/src/sam_at25.c b/configs/sama5d4-ek/src/sam_at25.c index f2a4c4d1d8..4df4e631e5 100644 --- a/configs/sama5d4-ek/src/sam_at25.c +++ b/configs/sama5d4-ek/src/sam_at25.c @@ -92,7 +92,7 @@ int sam_at25_automount(int minor) spi = sam_spibus_initialize(AT25_PORT); if (!spi) { - fdbg("ERROR: Failed to initialize SPI port %d\n", AT25_PORT); + ferr("ERROR: Failed to initialize SPI port %d\n", AT25_PORT); return -ENODEV; } @@ -101,7 +101,7 @@ int sam_at25_automount(int minor) mtd = at25_initialize(spi); if (!mtd) { - fdbg("ERROR: Failed to bind SPI port %d to the AT25 FLASH driver\n"); + ferr("ERROR: Failed to bind SPI port %d to the AT25 FLASH driver\n"); return -ENODEV; } @@ -113,7 +113,7 @@ int sam_at25_automount(int minor) ret = ftl_initialize(minor, mtd); if (ret < 0) { - fdbg("ERROR: Failed to initialize the FTL layer: %d\n", ret); + ferr("ERROR: Failed to initialize the FTL layer: %d\n", ret); return ret; } @@ -123,7 +123,7 @@ int sam_at25_automount(int minor) ret = ftl_initialize(minor, mtd); if (ret < 0) { - fdbg("ERROR: Failed to initialize the FTL layer: %d\n", ret); + ferr("ERROR: Failed to initialize the FTL layer: %d\n", ret); return ret; } @@ -137,7 +137,7 @@ int sam_at25_automount(int minor) ret = bchdev_register(blockdev, chardev, false); if (ret < 0) { - fdbg("ERROR: bchdev_register %s failed: %d\n", chardev, ret); + ferr("ERROR: bchdev_register %s failed: %d\n", chardev, ret); return ret; } @@ -147,7 +147,7 @@ int sam_at25_automount(int minor) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", ret); + ferr("ERROR: NXFFS initialization failed: %d\n", ret); return ret; } @@ -156,7 +156,7 @@ int sam_at25_automount(int minor) ret = mount(NULL, "/mnt/at25", "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } diff --git a/configs/sama5d4-ek/src/sam_audio_null.c b/configs/sama5d4-ek/src/sam_audio_null.c index 654fea6011..f5bf2c5980 100644 --- a/configs/sama5d4-ek/src/sam_audio_null.c +++ b/configs/sama5d4-ek/src/sam_audio_null.c @@ -100,7 +100,7 @@ int sam_audio_null_initialize(int minor) char devname[12]; int ret; - auddbg("minor %d\n", minor); + auderr("minor %d\n", minor); DEBUGASSERT(minor >= 0 && minor <= 25); /* Have we already initialized? Since we never uninitialize we must prevent @@ -117,7 +117,7 @@ int sam_audio_null_initialize(int minor) nullaudio = audio_null_initialize(); if (!nullaudio) { - auddbg("Failed to get the NULL audio interface\n"); + auderr("Failed to get the NULL audio interface\n"); ret = -ENODEV; goto errout; } @@ -130,7 +130,7 @@ int sam_audio_null_initialize(int minor) pcm = pcm_decode_initialize(nullaudio); if (!pcm) { - auddbg("ERROR: Failed create the PCM decoder\n"); + auderr("ERROR: Failed create the PCM decoder\n"); ret = -ENODEV; goto errout_with_nullaudio; } @@ -144,7 +144,7 @@ int sam_audio_null_initialize(int minor) ret = audio_register(devname, pcm); if (ret < 0) { - auddbg("ERROR: Failed to register /dev/%s device: %d\n", devname, ret); + auderr("ERROR: Failed to register /dev/%s device: %d\n", devname, ret); goto errout_with_pcm; } diff --git a/configs/sama5d4-ek/src/sam_autoleds.c b/configs/sama5d4-ek/src/sam_autoleds.c index 0d23aa40db..60b41878e6 100644 --- a/configs/sama5d4-ek/src/sam_autoleds.c +++ b/configs/sama5d4-ek/src/sam_autoleds.c @@ -101,10 +101,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sama5d4-ek/src/sam_automount.c b/configs/sama5d4-ek/src/sam_automount.c index 89b8b20fcc..b838e693d9 100644 --- a/configs/sama5d4-ek/src/sam_automount.c +++ b/configs/sama5d4-ek/src/sam_automount.c @@ -293,7 +293,7 @@ void sam_automount_initialize(void) handle = automount_initialize(&g_hsmci0config.lower); if (!handle) { - fdbg("ERROR: Failed to initialize auto-mounter for HSMCI0\n"); + ferr("ERROR: Failed to initialize auto-mounter for HSMCI0\n"); } #endif @@ -303,7 +303,7 @@ void sam_automount_initialize(void) handle = automount_initialize(&g_hsmci1config.lower); if (!handle) { - fdbg("ERROR: Failed to initialize auto-mounter for HSMCI1\n"); + ferr("ERROR: Failed to initialize auto-mounter for HSMCI1\n"); } #endif } @@ -363,7 +363,7 @@ void sam_automount_event(int slotno, bool inserted) else #endif { - fdbg("ERROR: Unsupported HSCMI%d\n", slotno); + ferr("ERROR: Unsupported HSCMI%d\n", slotno); return; } diff --git a/configs/sama5d4-ek/src/sam_bringup.c b/configs/sama5d4-ek/src/sam_bringup.c index 34b7e3dd43..489249b04a 100644 --- a/configs/sama5d4-ek/src/sam_bringup.c +++ b/configs/sama5d4-ek/src/sam_bringup.c @@ -74,7 +74,7 @@ #ifdef CONFIG_BOARD_INITIALIZE # define SYSLOG llerr #else -# define SYSLOG dbg +# define SYSLOG err #endif /**************************************************************************** @@ -98,14 +98,14 @@ static void sam_i2c_register(int bus) i2c = sam_i2cbus_initialize(bus); if (i2c == NULL) { - dbg("ERROR: Failed to get I2C%d interface\n", bus); + err("ERROR: Failed to get I2C%d interface\n", bus); } else { ret = i2c_register(i2c, bus); if (ret < 0) { - dbg("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); sam_i2cbus_uninitialize(i2c); } } diff --git a/configs/sama5d4-ek/src/sam_ethernet.c b/configs/sama5d4-ek/src/sam_ethernet.c index 25a73b375c..25cf9813b2 100644 --- a/configs/sama5d4-ek/src/sam_ethernet.c +++ b/configs/sama5d4-ek/src/sam_ethernet.c @@ -84,10 +84,10 @@ */ #ifdef CONFIG_NETDEV_PHY_DEBUG -# define phydbg dbg +# define phyerr err # define phyllerr llerr #else -# define phydbg(x...) +# define phyerr(x...) # define phyllerr(x...) #endif @@ -116,7 +116,7 @@ static xcpt_t g_emac1_handler; #ifdef CONFIG_SAMA5_EMAC0 static void sam_emac0_phy_enable(bool enable) { - phydbg("IRQ%d: enable=%d\n", IRQ_INT_ETH0, enable); + phyerr("IRQ%d: enable=%d\n", IRQ_INT_ETH0, enable); if (enable) { sam_pioirqenable(IRQ_INT_ETH0); @@ -132,7 +132,7 @@ static void sam_emac0_phy_enable(bool enable) #ifdef CONFIG_SAMA5_EMAC1 static void sam_emac1_phy_enable(bool enable) { - phydbg("IRQ%d: enable=%d\n", IRQ_INT_ETH1, enable); + phyerr("IRQ%d: enable=%d\n", IRQ_INT_ETH1, enable); if (enable) { sam_pioirqenable(IRQ_INT_ETH1); @@ -160,12 +160,12 @@ static void sam_emac1_phy_enable(bool enable) void weak_function sam_netinitialize(void) { #ifdef CONFIG_SAMA5_EMAC0 - phydbg("Configuring %08x\n", PIO_INT_ETH0); + phyerr("Configuring %08x\n", PIO_INT_ETH0); sam_configpio(PIO_INT_ETH0); #endif #ifdef CONFIG_SAMA5_EMAC1 - phydbg("Configuring %08x\n", PIO_INT_ETH1); + phyerr("Configuring %08x\n", PIO_INT_ETH1); sam_configpio(PIO_INT_ETH1); #endif } @@ -247,16 +247,16 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) ninfo("%s: handler=%p\n", intf, handler); #ifdef CONFIG_SAMA5_EMAC0 - phydbg("EMAC0: devname=%s\n", SAMA5_EMAC0_DEVNAME); + phyerr("EMAC0: devname=%s\n", SAMA5_EMAC0_DEVNAME); #endif #ifdef CONFIG_SAMA5_EMAC1 - phydbg("EMAC1: devname=%s\n", SAMA5_EMAC1_DEVNAME); + phyerr("EMAC1: devname=%s\n", SAMA5_EMAC1_DEVNAME); #endif #ifdef CONFIG_SAMA5_EMAC0 if (strcmp(intf, SAMA5_EMAC0_DEVNAME) == 0) { - phydbg("Select EMAC0\n"); + phyerr("Select EMAC0\n"); phandler = &g_emac0_handler; pinset = PIO_INT_ETH0; irq = IRQ_INT_ETH0; @@ -267,7 +267,7 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) #ifdef CONFIG_SAMA5_EMAC1 if (strcmp(intf, SAMA5_EMAC1_DEVNAME) == 0) { - phydbg("Select EMAC1\n"); + phyerr("Select EMAC1\n"); phandler = &g_emac1_handler; pinset = PIO_INT_ETH1; irq = IRQ_INT_ETH1; @@ -276,7 +276,7 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) else #endif { - ndbg("Unsupported interface: %s\n", intf); + nerr("Unsupported interface: %s\n", intf); return NULL; } @@ -295,15 +295,15 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) if (handler) { - phydbg("Configure pin: %08x\n", pinset); + phyerr("Configure pin: %08x\n", pinset); sam_pioirq(pinset); - phydbg("Attach IRQ%d\n", irq); + phyerr("Attach IRQ%d\n", irq); (void)irq_attach(irq, handler); } else { - phydbg("Detach IRQ%d\n", irq); + phyerr("Detach IRQ%d\n", irq); (void)irq_detach(irq); enabler = NULL; } diff --git a/configs/sama5d4-ek/src/sam_hsmci.c b/configs/sama5d4-ek/src/sam_hsmci.c index c3fbf9671c..f719c5ae81 100644 --- a/configs/sama5d4-ek/src/sam_hsmci.c +++ b/configs/sama5d4-ek/src/sam_hsmci.c @@ -300,7 +300,7 @@ int sam_hsmci_initialize(int slotno, int minor) state = sam_hsmci_state(slotno); if (!state) { - fdbg("ERROR: No state for slotno %d\n", slotno); + ferr("ERROR: No state for slotno %d\n", slotno); return -EINVAL; } @@ -321,7 +321,7 @@ int sam_hsmci_initialize(int slotno, int minor) state->hsmci = sdio_initialize(slotno); if (!state->hsmci) { - fdbg("ERROR: Failed to initialize SDIO slot %d\n", slotno); + ferr("ERROR: Failed to initialize SDIO slot %d\n", slotno); return -ENODEV; } @@ -330,7 +330,7 @@ int sam_hsmci_initialize(int slotno, int minor) ret = mmcsd_slotinitialize(minor, state->hsmci); if (ret != OK) { - fdbg("ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + ferr("ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } @@ -367,7 +367,7 @@ bool sam_cardinserted(int slotno) state = sam_hsmci_state(slotno); if (!state) { - fdbg("ERROR: No state for slotno %d\n", slotno); + ferr("ERROR: No state for slotno %d\n", slotno); return false; } diff --git a/configs/sama5d4-ek/src/sam_maxtouch.c b/configs/sama5d4-ek/src/sam_maxtouch.c index c725f1f17b..1129ba4c4b 100644 --- a/configs/sama5d4-ek/src/sam_maxtouch.c +++ b/configs/sama5d4-ek/src/sam_maxtouch.c @@ -242,7 +242,7 @@ int board_tsc_setup(int minor) static bool initialized = false; int ret; - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(minor == 0); /* Have we already initialized? Since we never uninitialize we must prevent @@ -262,7 +262,7 @@ int board_tsc_setup(int minor) i2c = sam_i2cbus_initialize(MXT_TWI_BUS); if (!i2c) { - idbg("Failed to initialize I2C%d\n", MXT_TWI_BUS); + ierr("Failed to initialize I2C%d\n", MXT_TWI_BUS); return -ENODEV; } @@ -276,7 +276,7 @@ int board_tsc_setup(int minor) ret = mxt_register(i2c, &g_mxtinfo.lower, CONFIG_SAMA5D4EK_MXT_DEVMINOR); if (ret < 0) { - idbg("ERROR: Failed to register touchscreen device\n"); + ierr("ERROR: Failed to register touchscreen device\n"); irq_detach(IRQ_CHG_MXT); /* sam_i2cbus_uninitialize(i2c); */ return -ENODEV; diff --git a/configs/sama5d4-ek/src/sam_nandflash.c b/configs/sama5d4-ek/src/sam_nandflash.c index 9044526b3b..6a5c90db28 100644 --- a/configs/sama5d4-ek/src/sam_nandflash.c +++ b/configs/sama5d4-ek/src/sam_nandflash.c @@ -186,7 +186,7 @@ int sam_nand_automount(int minor) mtd = sam_nand_initialize(HSMC_CS3); if (!mtd) { - fdbg("ERROR: Failed to create the NAND driver on CS%d\n", HSMC_CS3); + ferr("ERROR: Failed to create the NAND driver on CS%d\n", HSMC_CS3); return -ENODEV; } @@ -196,7 +196,7 @@ int sam_nand_automount(int minor) ret = ftl_initialize(NAND_MINOR, mtd); if (ret < 0) { - fdbg("ERROR: Failed to initialize the FTL layer: %d\n", ret); + ferr("ERROR: Failed to initialize the FTL layer: %d\n", ret); return ret; } @@ -206,7 +206,7 @@ int sam_nand_automount(int minor) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", ret); + ferr("ERROR: NXFFS initialization failed: %d\n", ret); return ret; } @@ -215,7 +215,7 @@ int sam_nand_automount(int minor) ret = mount(NULL, "/mnt/nand", "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif diff --git a/configs/sama5d4-ek/src/sam_pmic.c b/configs/sama5d4-ek/src/sam_pmic.c index 0b6344dbf7..ca4edf718e 100644 --- a/configs/sama5d4-ek/src/sam_pmic.c +++ b/configs/sama5d4-ek/src/sam_pmic.c @@ -80,7 +80,7 @@ void sam_pmic_initialize(void) i2c = sam_i2cbus_initialize(PMIC_TWI_BUS); if (!i2c) { - dbg("ERROR: Failed to initialize TWI%d\n", PMIC_TWI_BUS); + err("ERROR: Failed to initialize TWI%d\n", PMIC_TWI_BUS); } else { diff --git a/configs/sama5d4-ek/src/sam_pwm.c b/configs/sama5d4-ek/src/sam_pwm.c index e15e70c5a0..10496a6cd9 100644 --- a/configs/sama5d4-ek/src/sam_pwm.c +++ b/configs/sama5d4-ek/src/sam_pwm.c @@ -139,7 +139,7 @@ int board_pwm_setup(void) pwm = sam_pwminitialize(CONFIG_SAMA5D4EK_CHANNEL); if (!pwm) { - dbg("Failed to get the SAMA5 PWM lower half\n"); + err("Failed to get the SAMA5 PWM lower half\n"); return -ENODEV; } @@ -148,7 +148,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/sama5d4-ek/src/sam_spi.c b/configs/sama5d4-ek/src/sam_spi.c index 1f60c27684..c93158cbdb 100644 --- a/configs/sama5d4-ek/src/sam_spi.c +++ b/configs/sama5d4-ek/src/sam_spi.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/sama5d4-ek/src/sam_usb.c b/configs/sama5d4-ek/src/sam_usb.c index 9540206bbb..f2009f6361 100644 --- a/configs/sama5d4-ek/src/sam_usb.c +++ b/configs/sama5d4-ek/src/sam_usb.c @@ -308,7 +308,7 @@ int sam_usbhost_initialize(void) ret = usbhost_hub_initialize(); if (ret < 0) { - udbg("ERROR: usbhost_hub_initialize failed: %d\n", ret); + uerr("ERROR: usbhost_hub_initialize failed: %d\n", ret); } #endif @@ -318,7 +318,7 @@ int sam_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the mass storage class: %d\n", ret); + uerr("ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -328,7 +328,7 @@ int sam_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + uerr("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif @@ -338,7 +338,7 @@ int sam_usbhost_initialize(void) ret = usbhost_kbdinit(); if (ret != OK) { - udbg("ERROR: Failed to register the KBD class\n"); + uerr("ERROR: Failed to register the KBD class\n"); } #endif @@ -350,7 +350,7 @@ int sam_usbhost_initialize(void) g_ohciconn = sam_ohci_initialize(0); if (!g_ohciconn) { - udbg("ERROR: sam_ohci_initialize failed\n"); + uerr("ERROR: sam_ohci_initialize failed\n"); return -ENODEV; } @@ -361,7 +361,7 @@ int sam_usbhost_initialize(void) (main_t)ohci_waiter, (FAR char * const *)NULL); if (pid < 0) { - udbg("ERROR: Failed to create ohci_waiter task: %d\n", ret); + uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret); return -ENODEV; } #endif @@ -372,7 +372,7 @@ int sam_usbhost_initialize(void) g_ehciconn = sam_ehci_initialize(0); if (!g_ehciconn) { - udbg("ERROR: sam_ehci_initialize failed\n"); + uerr("ERROR: sam_ehci_initialize failed\n"); return -ENODEV; } @@ -383,7 +383,7 @@ int sam_usbhost_initialize(void) (main_t)ehci_waiter, (FAR char * const *)NULL); if (pid < 0) { - udbg("ERROR: Failed to create ehci_waiter task: %d\n", ret); + uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret); return -ENODEV; } #endif @@ -422,7 +422,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) { case SAM_RHPORT1: #ifndef CONFIG_SAMA5_UHPHS_RHPORT1 - udbg("ERROR: RHPort1 is not available in this configuration\n"); + uerr("ERROR: RHPort1 is not available in this configuration\n"); return; #else pinset = PIO_USBA_VBUS_ENABLE; @@ -431,7 +431,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) case SAM_RHPORT2: #ifndef CONFIG_SAMA5_UHPHS_RHPORT2 - udbg("ERROR: RHPort2 is not available in this configuration\n"); + uerr("ERROR: RHPort2 is not available in this configuration\n"); return; #else pinset = PIO_USBB_VBUS_ENABLE; @@ -440,7 +440,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) case SAM_RHPORT3: #ifndef CONFIG_SAMA5_UHPHS_RHPORT3 - udbg("ERROR: RHPort3 is not available in this configuration\n"); + uerr("ERROR: RHPort3 is not available in this configuration\n"); return; #else pinset = PIO_USBC_VBUS_ENABLE; @@ -448,7 +448,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable) #endif default: - udbg("ERROR: RHPort%d is not supported\n", rhport+1); + uerr("ERROR: RHPort%d is not supported\n", rhport+1); return; } diff --git a/configs/sama5d4-ek/src/sam_userleds.c b/configs/sama5d4-ek/src/sam_userleds.c index 93ecf08241..7837bbafb3 100644 --- a/configs/sama5d4-ek/src/sam_userleds.c +++ b/configs/sama5d4-ek/src/sam_userleds.c @@ -76,10 +76,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sama5d4-ek/src/sam_wm8904.c b/configs/sama5d4-ek/src/sam_wm8904.c index 951adc9c86..17c50ffc4d 100644 --- a/configs/sama5d4-ek/src/sam_wm8904.c +++ b/configs/sama5d4-ek/src/sam_wm8904.c @@ -253,7 +253,7 @@ int sam_wm8904_initialize(int minor) char devname[12]; int ret; - auddbg("minor %d\n", minor); + auderr("minor %d\n", minor); DEBUGASSERT(minor >= 0 && minor <= 25); /* Have we already initialized? Since we never uninitialize we must prevent @@ -273,7 +273,7 @@ int sam_wm8904_initialize(int minor) i2c = sam_i2cbus_initialize(WM8904_TWI_BUS); if (!i2c) { - auddbg("Failed to initialize TWI%d\n", WM8904_TWI_BUS); + auderr("Failed to initialize TWI%d\n", WM8904_TWI_BUS); ret = -ENODEV; goto errout; } @@ -283,7 +283,7 @@ int sam_wm8904_initialize(int minor) i2s = sam_ssc_initialize(WM8904_SSC_BUS); if (!i2s) { - auddbg("Failed to initialize SSC%d\n", WM8904_SSC_BUS); + auderr("Failed to initialize SSC%d\n", WM8904_SSC_BUS); ret = -ENODEV; goto errout_with_i2c; } @@ -314,7 +314,7 @@ int sam_wm8904_initialize(int minor) ret = irq_attach(IRQ_INT_WM8904, wm8904_interrupt); if (ret < 0) { - auddbg("ERROR: Failed to attach WM8904 interrupt: %d\n", ret); + auderr("ERROR: Failed to attach WM8904 interrupt: %d\n", ret); goto errout_with_i2s; } @@ -325,7 +325,7 @@ int sam_wm8904_initialize(int minor) wm8904 = wm8904_initialize(i2c, i2s, &g_wm8904info.lower); if (!wm8904) { - auddbg("Failed to initialize the WM8904\n"); + auderr("Failed to initialize the WM8904\n"); ret = -ENODEV; goto errout_with_irq; } @@ -338,7 +338,7 @@ int sam_wm8904_initialize(int minor) pcm = pcm_decode_initialize(wm8904); if (!pcm) { - auddbg("ERROR: Failed create the PCM decoder\n"); + auderr("ERROR: Failed create the PCM decoder\n"); ret = -ENODEV; goto errout_with_wm8904; } @@ -355,7 +355,7 @@ int sam_wm8904_initialize(int minor) ret = audio_register(devname, pcm); if (ret < 0) { - auddbg("ERROR: Failed to register /dev/%s device: %d\n", devname, ret); + auderr("ERROR: Failed to register /dev/%s device: %d\n", devname, ret); goto errout_with_pcm; } diff --git a/configs/samd20-xplained/src/sam_autoleds.c b/configs/samd20-xplained/src/sam_autoleds.c index 8cfd2e49f7..0035691f77 100644 --- a/configs/samd20-xplained/src/sam_autoleds.c +++ b/configs/samd20-xplained/src/sam_autoleds.c @@ -86,10 +86,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/samd20-xplained/src/sam_mmcsd.c b/configs/samd20-xplained/src/sam_mmcsd.c index ef37c260b8..1cfe12e2ec 100644 --- a/configs/samd20-xplained/src/sam_mmcsd.c +++ b/configs/samd20-xplained/src/sam_mmcsd.c @@ -100,7 +100,7 @@ int sam_sdinitialize(int port, int minor) spi = sam_spibus_initialize(port); if (!spi) { - fdbg("Failed to initialize SPI%d\n", port); + ferr("Failed to initialize SPI%d\n", port); return -ENODEV; } @@ -113,7 +113,7 @@ int sam_sdinitialize(int port, int minor) ret = mmcsd_spislotinitialize(minor, SAMDL_MMCSDSLOTNO, spi); if (ret < 0) { - fdbg("Failed to bind SPI%d to MMC/SD slot %d: %d\n", + ferr("Failed to bind SPI%d to MMC/SD slot %d: %d\n", port, SAMDL_MMCSDSLOTNO, ret); return ret; } diff --git a/configs/samd20-xplained/src/sam_spi.c b/configs/samd20-xplained/src/sam_spi.c index c9d6b6aaea..9d13875acc 100644 --- a/configs/samd20-xplained/src/sam_spi.c +++ b/configs/samd20-xplained/src/sam_spi.c @@ -63,7 +63,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -71,7 +71,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/samd20-xplained/src/sam_ug2832hsweg04.c b/configs/samd20-xplained/src/sam_ug2832hsweg04.c index 900c6aefbd..900f6fb0db 100644 --- a/configs/samd20-xplained/src/sam_ug2832hsweg04.c +++ b/configs/samd20-xplained/src/sam_ug2832hsweg04.c @@ -147,10 +147,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lcderr(format, ...) err(format, ##__VA_ARGS__) # define lcdinfo(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -187,7 +187,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) spi = sam_spibus_initialize(OLED_CSNO); if (!spi) { - lcddbg("Failed to initialize SPI port 1\n"); + lcderr("Failed to initialize SPI port 1\n"); } else { @@ -196,7 +196,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) dev = ssd1306_initialize(spi, devno); if (!dev) { - lcddbg("Failed to bind SPI port 1 to OLED %d: %d\n", devno); + lcderr("Failed to bind SPI port 1 to OLED %d: %d\n", devno); } else { diff --git a/configs/samd20-xplained/src/sam_userleds.c b/configs/samd20-xplained/src/sam_userleds.c index 18978a2974..df71687374 100644 --- a/configs/samd20-xplained/src/sam_userleds.c +++ b/configs/samd20-xplained/src/sam_userleds.c @@ -71,10 +71,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/samd21-xplained/src/sam_autoleds.c b/configs/samd21-xplained/src/sam_autoleds.c index 2c5f018024..0613cc6568 100644 --- a/configs/samd21-xplained/src/sam_autoleds.c +++ b/configs/samd21-xplained/src/sam_autoleds.c @@ -86,10 +86,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/samd21-xplained/src/sam_mmcsd.c b/configs/samd21-xplained/src/sam_mmcsd.c index e6e3922b5e..1b828aea17 100644 --- a/configs/samd21-xplained/src/sam_mmcsd.c +++ b/configs/samd21-xplained/src/sam_mmcsd.c @@ -100,7 +100,7 @@ int sam_sdinitialize(int port, int minor) spi = sam_spibus_initialize(port); if (!spi) { - fdbg("Failed to initialize SPI%d\n", port); + ferr("Failed to initialize SPI%d\n", port); return -ENODEV; } @@ -113,7 +113,7 @@ int sam_sdinitialize(int port, int minor) ret = mmcsd_spislotinitialize(minor, SAMDL_MMCSDSLOTNO, spi); if (ret < 0) { - fdbg("Failed to bind SPI%d to MMC/SD slot %d: %d\n", + ferr("Failed to bind SPI%d to MMC/SD slot %d: %d\n", port, SAMDL_MMCSDSLOTNO, ret); return ret; } diff --git a/configs/samd21-xplained/src/sam_spi.c b/configs/samd21-xplained/src/sam_spi.c index 4905e3d4e5..fcebdb5ea0 100644 --- a/configs/samd21-xplained/src/sam_spi.c +++ b/configs/samd21-xplained/src/sam_spi.c @@ -63,7 +63,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -71,7 +71,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/samd21-xplained/src/sam_ug2832hsweg04.c b/configs/samd21-xplained/src/sam_ug2832hsweg04.c index 481c7ec50d..6ecd3320cf 100644 --- a/configs/samd21-xplained/src/sam_ug2832hsweg04.c +++ b/configs/samd21-xplained/src/sam_ug2832hsweg04.c @@ -147,10 +147,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lcderr(format, ...) err(format, ##__VA_ARGS__) # define lcdinfo(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -187,7 +187,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) spi = sam_spibus_initialize(OLED_CSNO); if (!spi) { - lcddbg("Failed to initialize SPI port 1\n"); + lcderr("Failed to initialize SPI port 1\n"); } else { @@ -196,7 +196,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) dev = ssd1306_initialize(spi, devno); if (!dev) { - lcddbg("Failed to bind SPI port 1 to OLED %d: %d\n", devno); + lcderr("Failed to bind SPI port 1 to OLED %d: %d\n", devno); } else { diff --git a/configs/samd21-xplained/src/sam_userleds.c b/configs/samd21-xplained/src/sam_userleds.c index 037641bb5b..6bc4799016 100644 --- a/configs/samd21-xplained/src/sam_userleds.c +++ b/configs/samd21-xplained/src/sam_userleds.c @@ -71,10 +71,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/same70-xplained/src/sam_at24config.c b/configs/same70-xplained/src/sam_at24config.c index aac1de3571..69d27a02ce 100644 --- a/configs/same70-xplained/src/sam_at24config.c +++ b/configs/same70-xplained/src/sam_at24config.c @@ -75,7 +75,7 @@ int sam_at24config(void) i2c = sam_i2cbus_initialize(0); if (!i2c) { - fdbg("ERROR: Failed to initialize TWI0\n"); + ferr("ERROR: Failed to initialize TWI0\n"); return -ENODEV; } @@ -84,7 +84,7 @@ int sam_at24config(void) at24 = at24c_initialize(i2c); if (!at24) { - fdbg("ERROR: Failed to initialize the AT24 driver\n"); + ferr("ERROR: Failed to initialize the AT24 driver\n"); (void)sam_i2cbus_uninitialize(i2c); return -ENODEV; } @@ -94,7 +94,7 @@ int sam_at24config(void) ret = at24->ioctl(at24, MTDIOC_EXTENDED, 0); if (ret < 0) { - fdbg("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); + ferr("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); } /* Bind the instance of an MTD device to the /dev/config device. */ @@ -102,7 +102,7 @@ int sam_at24config(void) ret = mtdconfig_register(at24); if (ret < 0) { - fdbg("ERROR: Failed to bind AT24 driver to the MTD config device\n"); + ferr("ERROR: Failed to bind AT24 driver to the MTD config device\n"); (void)sam_i2cbus_uninitialize(i2c); } diff --git a/configs/same70-xplained/src/sam_autoleds.c b/configs/same70-xplained/src/sam_autoleds.c index bb07aa6e2f..36e0aa41fe 100644 --- a/configs/same70-xplained/src/sam_autoleds.c +++ b/configs/same70-xplained/src/sam_autoleds.c @@ -86,10 +86,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/same70-xplained/src/sam_bringup.c b/configs/same70-xplained/src/sam_bringup.c index 227899e750..23600e6f5d 100644 --- a/configs/same70-xplained/src/sam_bringup.c +++ b/configs/same70-xplained/src/sam_bringup.c @@ -81,7 +81,7 @@ #ifdef CONFIG_BOARD_INITIALIZE # define SYSLOG llerr #else -# define SYSLOG dbg +# define SYSLOG err #endif /**************************************************************************** @@ -105,14 +105,14 @@ static void sam_i2c_register(int bus) i2c = sam_i2cbus_initialize(bus); if (i2c == NULL) { - dbg("ERROR: Failed to get I2C%d interface\n", bus); + err("ERROR: Failed to get I2C%d interface\n", bus); } else { ret = i2c_register(i2c, bus); if (ret < 0) { - dbg("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); sam_i2cbus_uninitialize(i2c); } } diff --git a/configs/same70-xplained/src/sam_ethernet.c b/configs/same70-xplained/src/sam_ethernet.c index aeb40bac36..4f4492692b 100644 --- a/configs/same70-xplained/src/sam_ethernet.c +++ b/configs/same70-xplained/src/sam_ethernet.c @@ -80,10 +80,10 @@ */ #ifdef CONFIG_NETDEV_PHY_DEBUG -# define phydbg dbg +# define phyerr err # define phyllerr llerr #else -# define phydbg(x...) +# define phyerr(x...) # define phyllerr(x...) #endif @@ -106,7 +106,7 @@ static xcpt_t g_emac0_handler; #ifdef CONFIG_SAMV7_GPIOA_IRQ static void sam_emac0_phy_enable(bool enable) { - phydbg("IRQ%d: enable=%d\n", IRQ_EMAC0_INT, enable); + phyerr("IRQ%d: enable=%d\n", IRQ_EMAC0_INT, enable); if (enable) { sam_gpioirqenable(IRQ_EMAC0_INT); @@ -134,7 +134,7 @@ void weak_function sam_netinitialize(void) { /* Configure the PHY interrupt GPIO */ - phydbg("Configuring %08x\n", GPIO_EMAC0_INT); + phyerr("Configuring %08x\n", GPIO_EMAC0_INT); sam_configgpio(GPIO_EMAC0_INT); /* Configure PHY /RESET output */ @@ -165,7 +165,7 @@ int sam_emac0_setmac(void) i2c = sam_i2cbus_initialize(0); if (!i2c) { - ndbg("ERROR: Failed to initialize TWI0\n"); + nerr("ERROR: Failed to initialize TWI0\n"); return -ENODEV; } @@ -174,7 +174,7 @@ int sam_emac0_setmac(void) at24 = at24c_initialize(i2c); if (!at24) { - ndbg("ERROR: Failed to initialize the AT24 driver\n"); + nerr("ERROR: Failed to initialize the AT24 driver\n"); (void)sam_i2cbus_uninitialize(i2c); return -ENODEV; } @@ -184,7 +184,7 @@ int sam_emac0_setmac(void) ret = at24->ioctl(at24, MTDIOC_EXTENDED, 1); if (ret < 0) { - ndbg("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); + nerr("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); (void)sam_i2cbus_uninitialize(i2c); return ret; } @@ -194,7 +194,7 @@ int sam_emac0_setmac(void) nread = at24->read(at24, AT24XX_MACADDR_OFFSET, 6, mac); if (nread < 6) { - ndbg("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread); + nerr("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread); (void)sam_i2cbus_uninitialize(i2c); return (int)nread; } @@ -204,7 +204,7 @@ int sam_emac0_setmac(void) ret = at24->ioctl(at24, MTDIOC_EXTENDED, 0); if (ret < 0) { - ndbg("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); + nerr("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); } /* Release the I2C instance. @@ -214,7 +214,7 @@ int sam_emac0_setmac(void) ret = sam_i2cbus_uninitialize(i2c); if (ret < 0) { - ndbg("ERROR: Failed to release the I2C interface: %d\n", ret); + nerr("ERROR: Failed to release the I2C interface: %d\n", ret); } ninfo("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", @@ -225,7 +225,7 @@ int sam_emac0_setmac(void) ret = sam_emac_setmacaddr(EMAC0_INTF, mac); if (ret < 0) { - ndbg("ERROR: Failed to set MAC address: %d\n", ret); + nerr("ERROR: Failed to set MAC address: %d\n", ret); } return ret; @@ -310,11 +310,11 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) DEBUGASSERT(intf); ninfo("%s: handler=%p\n", intf, handler); - phydbg("EMAC0: devname=%s\n", SAMV7_EMAC0_DEVNAME); + phyerr("EMAC0: devname=%s\n", SAMV7_EMAC0_DEVNAME); if (strcmp(intf, SAMV7_EMAC0_DEVNAME) == 0) { - phydbg("Select EMAC0\n"); + phyerr("Select EMAC0\n"); phandler = &g_emac0_handler; pinset = GPIO_EMAC0_INT; irq = IRQ_EMAC0_INT; @@ -322,7 +322,7 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) } else { - ndbg("Unsupported interface: %s\n", intf); + nerr("Unsupported interface: %s\n", intf); return NULL; } @@ -341,15 +341,15 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) if (handler) { - phydbg("Configure pin: %08x\n", pinset); + phyerr("Configure pin: %08x\n", pinset); sam_gpioirq(pinset); - phydbg("Attach IRQ%d\n", irq); + phyerr("Attach IRQ%d\n", irq); (void)irq_attach(irq, handler); } else { - phydbg("Detach IRQ%d\n", irq); + phyerr("Detach IRQ%d\n", irq); (void)irq_detach(irq); enabler = NULL; } diff --git a/configs/same70-xplained/src/sam_hsmci.c b/configs/same70-xplained/src/sam_hsmci.c index 7d02dd8cc1..ba9e33871d 100644 --- a/configs/same70-xplained/src/sam_hsmci.c +++ b/configs/same70-xplained/src/sam_hsmci.c @@ -226,7 +226,7 @@ int sam_hsmci_initialize(int slotno, int minor) state = sam_hsmci_state(slotno); if (!state) { - fdbg("ERROR: No state for slotno %d\n", slotno); + ferr("ERROR: No state for slotno %d\n", slotno); return -EINVAL; } @@ -247,7 +247,7 @@ int sam_hsmci_initialize(int slotno, int minor) state->hsmci = sdio_initialize(slotno); if (!state->hsmci) { - fdbg("ERROR: Failed to initialize SDIO slot %d\n", slotno); + ferr("ERROR: Failed to initialize SDIO slot %d\n", slotno); return -ENODEV; } @@ -256,7 +256,7 @@ int sam_hsmci_initialize(int slotno, int minor) ret = mmcsd_slotinitialize(minor, state->hsmci); if (ret != OK) { - fdbg("ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + ferr("ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } @@ -293,7 +293,7 @@ bool sam_cardinserted(int slotno) state = sam_hsmci_state(slotno); if (!state) { - fdbg("ERROR: No state for slotno %d\n", slotno); + ferr("ERROR: No state for slotno %d\n", slotno); return false; } diff --git a/configs/same70-xplained/src/sam_mcan.c b/configs/same70-xplained/src/sam_mcan.c index 2ee8c62b1d..9ef3afd4e5 100644 --- a/configs/same70-xplained/src/sam_mcan.c +++ b/configs/same70-xplained/src/sam_mcan.c @@ -71,12 +71,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -110,7 +110,7 @@ int board_can_initialize(void) can = sam_mcan_initialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -119,7 +119,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/same70-xplained/src/sam_spi.c b/configs/same70-xplained/src/sam_spi.c index ffb8c06079..28ea3c2eac 100644 --- a/configs/same70-xplained/src/sam_spi.c +++ b/configs/same70-xplained/src/sam_spi.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/saml21-xplained/src/sam_autoleds.c b/configs/saml21-xplained/src/sam_autoleds.c index 2e60573f18..8ddc16f9ab 100644 --- a/configs/saml21-xplained/src/sam_autoleds.c +++ b/configs/saml21-xplained/src/sam_autoleds.c @@ -86,10 +86,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/saml21-xplained/src/sam_mmcsd.c b/configs/saml21-xplained/src/sam_mmcsd.c index c86b61e440..5dbff63a89 100644 --- a/configs/saml21-xplained/src/sam_mmcsd.c +++ b/configs/saml21-xplained/src/sam_mmcsd.c @@ -100,7 +100,7 @@ int sam_sdinitialize(int port, int minor) spi = sam_spibus_initialize(port); if (!spi) { - fdbg("Failed to initialize SPI%d\n", port); + ferr("Failed to initialize SPI%d\n", port); return -ENODEV; } @@ -113,7 +113,7 @@ int sam_sdinitialize(int port, int minor) ret = mmcsd_spislotinitialize(minor, SAMDL_MMCSDSLOTNO, spi); if (ret < 0) { - fdbg("Failed to bind SPI%d to MMC/SD slot %d: %d\n", + ferr("Failed to bind SPI%d to MMC/SD slot %d: %d\n", port, SAMDL_MMCSDSLOTNO, ret); return ret; } diff --git a/configs/saml21-xplained/src/sam_spi.c b/configs/saml21-xplained/src/sam_spi.c index 6092ef8405..64e94d3896 100644 --- a/configs/saml21-xplained/src/sam_spi.c +++ b/configs/saml21-xplained/src/sam_spi.c @@ -63,7 +63,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -71,7 +71,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/saml21-xplained/src/sam_ug2832hsweg04.c b/configs/saml21-xplained/src/sam_ug2832hsweg04.c index 9ab22a7984..9cbbfab082 100644 --- a/configs/saml21-xplained/src/sam_ug2832hsweg04.c +++ b/configs/saml21-xplained/src/sam_ug2832hsweg04.c @@ -147,10 +147,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lcderr(format, ...) err(format, ##__VA_ARGS__) # define lcdinfo(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -187,7 +187,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) spi = sam_spibus_initialize(OLED_CSNO); if (!spi) { - lcddbg("Failed to initialize SPI port 1\n"); + lcderr("Failed to initialize SPI port 1\n"); } else { @@ -196,7 +196,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) dev = ssd1306_initialize(spi, devno); if (!dev) { - lcddbg("Failed to bind SPI port 1 to OLED %d: %d\n", devno); + lcderr("Failed to bind SPI port 1 to OLED %d: %d\n", devno); } else { diff --git a/configs/saml21-xplained/src/sam_userleds.c b/configs/saml21-xplained/src/sam_userleds.c index 9710c1a7a1..842bd26eba 100644 --- a/configs/saml21-xplained/src/sam_userleds.c +++ b/configs/saml21-xplained/src/sam_userleds.c @@ -71,10 +71,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/samv71-xult/src/sam_at24config.c b/configs/samv71-xult/src/sam_at24config.c index 7191454e47..4a324ac07b 100644 --- a/configs/samv71-xult/src/sam_at24config.c +++ b/configs/samv71-xult/src/sam_at24config.c @@ -75,7 +75,7 @@ int sam_at24config(void) i2c = sam_i2cbus_initialize(0); if (!i2c) { - fdbg("ERROR: Failed to initialize TWI0\n"); + ferr("ERROR: Failed to initialize TWI0\n"); return -ENODEV; } @@ -84,7 +84,7 @@ int sam_at24config(void) at24 = at24c_initialize(i2c); if (!at24) { - fdbg("ERROR: Failed to initialize the AT24 driver\n"); + ferr("ERROR: Failed to initialize the AT24 driver\n"); (void)sam_i2cbus_uninitialize(i2c); return -ENODEV; } @@ -94,7 +94,7 @@ int sam_at24config(void) ret = at24->ioctl(at24, MTDIOC_EXTENDED, 0); if (ret < 0) { - fdbg("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); + ferr("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); } /* Bind the instance of an MTD device to the /dev/config device. */ @@ -102,7 +102,7 @@ int sam_at24config(void) ret = mtdconfig_register(at24); if (ret < 0) { - fdbg("ERROR: Failed to bind AT24 driver to the MTD config device\n"); + ferr("ERROR: Failed to bind AT24 driver to the MTD config device\n"); (void)sam_i2cbus_uninitialize(i2c); } diff --git a/configs/samv71-xult/src/sam_audio_null.c b/configs/samv71-xult/src/sam_audio_null.c index 2dedb31eba..59a599eceb 100644 --- a/configs/samv71-xult/src/sam_audio_null.c +++ b/configs/samv71-xult/src/sam_audio_null.c @@ -100,7 +100,7 @@ int sam_audio_null_initialize(int minor) char devname[12]; int ret; - auddbg("minor %d\n", minor); + auderr("minor %d\n", minor); DEBUGASSERT(minor >= 0 && minor <= 25); /* Have we already initialized? Since we never uninitialize we must prevent @@ -117,7 +117,7 @@ int sam_audio_null_initialize(int minor) nullaudio = audio_null_initialize(); if (!nullaudio) { - auddbg("Failed to get the NULL audio interface\n"); + auderr("Failed to get the NULL audio interface\n"); ret = -ENODEV; goto errout; } @@ -130,7 +130,7 @@ int sam_audio_null_initialize(int minor) pcm = pcm_decode_initialize(nullaudio); if (!pcm) { - auddbg("ERROR: Failed create the PCM decoder\n"); + auderr("ERROR: Failed create the PCM decoder\n"); ret = -ENODEV; goto errout_with_nullaudio; } @@ -144,7 +144,7 @@ int sam_audio_null_initialize(int minor) ret = audio_register(devname, pcm); if (ret < 0) { - auddbg("ERROR: Failed to register /dev/%s device: %d\n", devname, ret); + auderr("ERROR: Failed to register /dev/%s device: %d\n", devname, ret); goto errout_with_pcm; } diff --git a/configs/samv71-xult/src/sam_autoleds.c b/configs/samv71-xult/src/sam_autoleds.c index a08b357467..f0cc48521e 100644 --- a/configs/samv71-xult/src/sam_autoleds.c +++ b/configs/samv71-xult/src/sam_autoleds.c @@ -102,10 +102,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/samv71-xult/src/sam_bringup.c b/configs/samv71-xult/src/sam_bringup.c index 18565d424f..6e00088027 100644 --- a/configs/samv71-xult/src/sam_bringup.c +++ b/configs/samv71-xult/src/sam_bringup.c @@ -104,7 +104,7 @@ #ifdef CONFIG_BOARD_INITIALIZE # define SYSLOG llerr #else -# define SYSLOG dbg +# define SYSLOG err #endif /**************************************************************************** @@ -128,14 +128,14 @@ static void sam_i2c_register(int bus) i2c = sam_i2cbus_initialize(bus); if (i2c == NULL) { - dbg("ERROR: Failed to get I2C%d interface\n", bus); + err("ERROR: Failed to get I2C%d interface\n", bus); } else { ret = i2c_register(i2c, bus); if (ret < 0) { - dbg("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); sam_i2cbus_uninitialize(i2c); } } diff --git a/configs/samv71-xult/src/sam_ethernet.c b/configs/samv71-xult/src/sam_ethernet.c index 88c486a428..4c3b3ad680 100644 --- a/configs/samv71-xult/src/sam_ethernet.c +++ b/configs/samv71-xult/src/sam_ethernet.c @@ -80,10 +80,10 @@ */ #ifdef CONFIG_NETDEV_PHY_DEBUG -# define phydbg dbg +# define phyerr err # define phyllerr llerr #else -# define phydbg(x...) +# define phyerr(x...) # define phyllerr(x...) #endif @@ -106,7 +106,7 @@ static xcpt_t g_emac0_handler; #ifdef CONFIG_SAMV7_GPIOA_IRQ static void sam_emac0_phy_enable(bool enable) { - phydbg("IRQ%d: enable=%d\n", IRQ_EMAC0_INT, enable); + phyerr("IRQ%d: enable=%d\n", IRQ_EMAC0_INT, enable); if (enable) { sam_gpioirqenable(IRQ_EMAC0_INT); @@ -134,7 +134,7 @@ void weak_function sam_netinitialize(void) { /* Configure the PHY interrupt GPIO */ - phydbg("Configuring %08x\n", GPIO_EMAC0_INT); + phyerr("Configuring %08x\n", GPIO_EMAC0_INT); sam_configgpio(GPIO_EMAC0_INT); /* Configure the PHY SIGDET input */ @@ -169,7 +169,7 @@ int sam_emac0_setmac(void) i2c = sam_i2cbus_initialize(0); if (!i2c) { - ndbg("ERROR: Failed to initialize TWI0\n"); + nerr("ERROR: Failed to initialize TWI0\n"); return -ENODEV; } @@ -178,7 +178,7 @@ int sam_emac0_setmac(void) at24 = at24c_initialize(i2c); if (!at24) { - ndbg("ERROR: Failed to initialize the AT24 driver\n"); + nerr("ERROR: Failed to initialize the AT24 driver\n"); (void)sam_i2cbus_uninitialize(i2c); return -ENODEV; } @@ -188,7 +188,7 @@ int sam_emac0_setmac(void) ret = at24->ioctl(at24, MTDIOC_EXTENDED, 1); if (ret < 0) { - ndbg("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); + nerr("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); (void)sam_i2cbus_uninitialize(i2c); return ret; } @@ -198,7 +198,7 @@ int sam_emac0_setmac(void) nread = at24->read(at24, AT24XX_MACADDR_OFFSET, 6, mac); if (nread < 6) { - ndbg("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread); + nerr("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread); (void)sam_i2cbus_uninitialize(i2c); return (int)nread; } @@ -208,7 +208,7 @@ int sam_emac0_setmac(void) ret = at24->ioctl(at24, MTDIOC_EXTENDED, 0); if (ret < 0) { - ndbg("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); + nerr("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); } /* Release the I2C instance. @@ -218,7 +218,7 @@ int sam_emac0_setmac(void) ret = sam_i2cbus_uninitialize(i2c); if (ret < 0) { - ndbg("ERROR: Failed to release the I2C interface: %d\n", ret); + nerr("ERROR: Failed to release the I2C interface: %d\n", ret); } ninfo("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", @@ -229,7 +229,7 @@ int sam_emac0_setmac(void) ret = sam_emac_setmacaddr(EMAC0_INTF, mac); if (ret < 0) { - ndbg("ERROR: Failed to set MAC address: %d\n", ret); + nerr("ERROR: Failed to set MAC address: %d\n", ret); } return ret; @@ -314,11 +314,11 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) DEBUGASSERT(intf); ninfo("%s: handler=%p\n", intf, handler); - phydbg("EMAC0: devname=%s\n", SAMV7_EMAC0_DEVNAME); + phyerr("EMAC0: devname=%s\n", SAMV7_EMAC0_DEVNAME); if (strcmp(intf, SAMV7_EMAC0_DEVNAME) == 0) { - phydbg("Select EMAC0\n"); + phyerr("Select EMAC0\n"); phandler = &g_emac0_handler; pinset = GPIO_EMAC0_INT; irq = IRQ_EMAC0_INT; @@ -326,7 +326,7 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) } else { - ndbg("Unsupported interface: %s\n", intf); + nerr("Unsupported interface: %s\n", intf); return NULL; } @@ -345,15 +345,15 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) if (handler) { - phydbg("Configure pin: %08x\n", pinset); + phyerr("Configure pin: %08x\n", pinset); sam_gpioirq(pinset); - phydbg("Attach IRQ%d\n", irq); + phyerr("Attach IRQ%d\n", irq); (void)irq_attach(irq, handler); } else { - phydbg("Detach IRQ%d\n", irq); + phyerr("Detach IRQ%d\n", irq); (void)irq_detach(irq); enabler = NULL; } diff --git a/configs/samv71-xult/src/sam_hsmci.c b/configs/samv71-xult/src/sam_hsmci.c index 7389e166c6..1e0eb3670e 100644 --- a/configs/samv71-xult/src/sam_hsmci.c +++ b/configs/samv71-xult/src/sam_hsmci.c @@ -226,7 +226,7 @@ int sam_hsmci_initialize(int slotno, int minor) state = sam_hsmci_state(slotno); if (!state) { - fdbg("ERROR: No state for slotno %d\n", slotno); + ferr("ERROR: No state for slotno %d\n", slotno); return -EINVAL; } @@ -247,7 +247,7 @@ int sam_hsmci_initialize(int slotno, int minor) state->hsmci = sdio_initialize(slotno); if (!state->hsmci) { - fdbg("ERROR: Failed to initialize SDIO slot %d\n", slotno); + ferr("ERROR: Failed to initialize SDIO slot %d\n", slotno); return -ENODEV; } @@ -256,7 +256,7 @@ int sam_hsmci_initialize(int slotno, int minor) ret = mmcsd_slotinitialize(minor, state->hsmci); if (ret != OK) { - fdbg("ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + ferr("ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } @@ -293,7 +293,7 @@ bool sam_cardinserted(int slotno) state = sam_hsmci_state(slotno); if (!state) { - fdbg("ERROR: No state for slotno %d\n", slotno); + ferr("ERROR: No state for slotno %d\n", slotno); return false; } diff --git a/configs/samv71-xult/src/sam_ili9488.c b/configs/samv71-xult/src/sam_ili9488.c index ed9dd1d5b7..aba728c7b5 100644 --- a/configs/samv71-xult/src/sam_ili9488.c +++ b/configs/samv71-xult/src/sam_ili9488.c @@ -301,10 +301,10 @@ /* Debug *********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -548,7 +548,7 @@ static int sam_sendcmd(FAR struct sam_dev_s *priv, uint16_t cmd) ret = sam_lcd_txtransfer(priv, &cmd, sizeof(uint16_t)); if (ret < 0) { - lcddbg("ERROR: Failed to send command %02x: %d\n", cmd, ret); + lcderr("ERROR: Failed to send command %02x: %d\n", cmd, ret); } /* Make sure that the CMD/DATA GPIO is reset for commands. I don't understand @@ -592,7 +592,7 @@ static int sam_lcd_put(FAR struct sam_dev_s *priv, uint16_t cmd, ret = sam_lcd_txtransfer(priv, buffer, buflen); if (ret < 0) { - lcddbg("ERROR: Failed to send command %02x data: %d\n", cmd, ret); + lcderr("ERROR: Failed to send command %02x data: %d\n", cmd, ret); } } @@ -874,7 +874,7 @@ static void sam_lcd_dumpone(struct sam_dev_s *priv, int index, } else { - fdbg("%s: Not collected\n", msg); + ferr("%s: Not collected\n", msg); } } #endif @@ -994,7 +994,7 @@ static int sam_lcd_dmawait(FAR struct sam_dev_s *priv, uint32_t timeout) 1, (uint32_t)priv); if (ret < 0) { - lcddbg("ERROR: wd_start failed: %d\n", errno); + lcderr("ERROR: wd_start failed: %d\n", errno); } /* Loop until the event (or the timeout occurs). */ @@ -1160,7 +1160,7 @@ static int sam_putrun(fb_coord_t row, fb_coord_t col, ret = sam_setwindow(priv, row, col, npixels, 1); if (ret < 0) { - lcddbg("ERROR: sam_setwindow failed: %d\n", ret); + lcderr("ERROR: sam_setwindow failed: %d\n", ret); return ret; } @@ -1201,7 +1201,7 @@ static int sam_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, ret = sam_setwindow(priv, row, col, npixels, 1); if (ret < 0) { - lcddbg("ERROR: sam_setwindow failed: %d\n", ret); + lcderr("ERROR: sam_setwindow failed: %d\n", ret); return ret; } @@ -1484,7 +1484,7 @@ static inline int sam_lcd_initialize(void) if (id != ILI9488_DEVICE_CODE) { - lcddbg("ERROR: Unsupported LCD ID: %04x (vs. %04x)\n", + lcderr("ERROR: Unsupported LCD ID: %04x (vs. %04x)\n", id, ILI9488_DEVICE_CODE); return -ENODEV; } @@ -1575,7 +1575,7 @@ int board_lcd_initialize(void) priv->dmach = sam_dmachannel(0, DMA_FLAGS); if (!priv->dmach) { - lcddbg("ERROR: Failed to allocate a DMA channel\n"); + lcderr("ERROR: Failed to allocate a DMA channel\n"); ret = -EAGAIN; goto errout_with_waitsem; } @@ -1585,7 +1585,7 @@ int board_lcd_initialize(void) priv->dmadog = wd_create(); if (!priv->dmadog) { - lcddbg("ERROR: Failed to allocate a timer\n"); + lcderr("ERROR: Failed to allocate a timer\n"); ret = -EAGAIN; goto errout_with_dmach; } @@ -1596,7 +1596,7 @@ int board_lcd_initialize(void) ret = sam_lcd_initialize(); if (ret < 0) { - lcddbg("ERROR: sam_lcd_initialize failed: %d\n", ret); + lcderr("ERROR: sam_lcd_initialize failed: %d\n", ret); goto errout_with_dmadog; } @@ -1609,7 +1609,7 @@ int board_lcd_initialize(void) ret = sam_poweroff(priv); if (ret < 0) { - lcddbg("ERROR: sam_poweroff failed: %d\n", ret); + lcderr("ERROR: sam_poweroff failed: %d\n", ret); goto errout_with_dmadog; } @@ -1705,7 +1705,7 @@ void sam_lcdclear(uint16_t color) ret = sam_setwindow(priv, 0, 0, SAM_XRES, SAM_YRES); if (ret < 0) { - lcddbg("ERROR: sam_setwindow failed: %d\n", ret); + lcderr("ERROR: sam_setwindow failed: %d\n", ret); return; } @@ -1714,7 +1714,7 @@ void sam_lcdclear(uint16_t color) ret = sam_putrun(row, 0, (FAR const uint8_t *)g_runbuffer, SAM_XRES); if (ret < 0) { - lcddbg("ERROR: sam_putrun failed on row %d: %d\n", row, ret); + lcderr("ERROR: sam_putrun failed on row %d: %d\n", row, ret); return; } } diff --git a/configs/samv71-xult/src/sam_maxtouch.c b/configs/samv71-xult/src/sam_maxtouch.c index d085ee6a33..2f44a0759b 100644 --- a/configs/samv71-xult/src/sam_maxtouch.c +++ b/configs/samv71-xult/src/sam_maxtouch.c @@ -241,7 +241,7 @@ int board_tsc_setup(int minor) static bool initialized = false; int ret; - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(minor == 0); /* Have we already initialized? Since we never uninitialize we must prevent @@ -261,7 +261,7 @@ int board_tsc_setup(int minor) i2c = sam_i2cbus_initialize(MXT_TWI_BUS); if (!i2c) { - idbg("Failed to initialize I2C%d\n", MXT_TWI_BUS); + ierr("Failed to initialize I2C%d\n", MXT_TWI_BUS); return -ENODEV; } @@ -275,7 +275,7 @@ int board_tsc_setup(int minor) ret = mxt_register(i2c, &g_mxtinfo.lower, CONFIG_SAMV71XULT_MXT_DEVMINOR); if (ret < 0) { - idbg("ERROR: Failed to register touchscreen device\n"); + ierr("ERROR: Failed to register touchscreen device\n"); irq_detach(IRQ_MXT_CHG); /* sam_i2cbus_uninitialize(i2c); */ return -ENODEV; diff --git a/configs/samv71-xult/src/sam_mcan.c b/configs/samv71-xult/src/sam_mcan.c index c3d4f8bf8d..fa823a7b90 100644 --- a/configs/samv71-xult/src/sam_mcan.c +++ b/configs/samv71-xult/src/sam_mcan.c @@ -71,12 +71,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -110,7 +110,7 @@ int board_can_initialize(void) can = sam_mcan_initialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -119,7 +119,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/samv71-xult/src/sam_spi.c b/configs/samv71-xult/src/sam_spi.c index 35877918bc..ddf7714ecc 100644 --- a/configs/samv71-xult/src/sam_spi.c +++ b/configs/samv71-xult/src/sam_spi.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/samv71-xult/src/sam_wm8904.c b/configs/samv71-xult/src/sam_wm8904.c index f7b3dfc847..352a89c560 100644 --- a/configs/samv71-xult/src/sam_wm8904.c +++ b/configs/samv71-xult/src/sam_wm8904.c @@ -253,7 +253,7 @@ int sam_wm8904_initialize(int minor) char devname[12]; int ret; - auddbg("minor %d\n", minor); + auderr("minor %d\n", minor); DEBUGASSERT(minor >= 0 && minor <= 25); /* Have we already initialized? Since we never uninitialize we must prevent @@ -273,7 +273,7 @@ int sam_wm8904_initialize(int minor) i2c = sam_i2cbus_initialize(WM8904_TWI_BUS); if (!i2c) { - auddbg("Failed to initialize TWI%d\n", WM8904_TWI_BUS); + auderr("Failed to initialize TWI%d\n", WM8904_TWI_BUS); ret = -ENODEV; goto errout; } @@ -283,7 +283,7 @@ int sam_wm8904_initialize(int minor) i2s = sam_ssc_initialize(WM8904_SSC_BUS); if (!i2s) { - auddbg("Failed to initialize SSC%d\n", WM8904_SSC_BUS); + auderr("Failed to initialize SSC%d\n", WM8904_SSC_BUS); ret = -ENODEV; goto errout_with_i2c; } @@ -314,7 +314,7 @@ int sam_wm8904_initialize(int minor) ret = irq_attach(IRQ_INT_WM8904, wm8904_interrupt); if (ret < 0) { - auddbg("ERROR: Failed to attach WM8904 interrupt: %d\n", ret); + auderr("ERROR: Failed to attach WM8904 interrupt: %d\n", ret); goto errout_with_i2s; } @@ -325,7 +325,7 @@ int sam_wm8904_initialize(int minor) wm8904 = wm8904_initialize(i2c, i2s, &g_wm8904info.lower); if (!wm8904) { - auddbg("Failed to initialize the WM8904\n"); + auderr("Failed to initialize the WM8904\n"); ret = -ENODEV; goto errout_with_irq; } @@ -338,7 +338,7 @@ int sam_wm8904_initialize(int minor) pcm = pcm_decode_initialize(wm8904); if (!pcm) { - auddbg("ERROR: Failed create the PCM decoder\n"); + auderr("ERROR: Failed create the PCM decoder\n"); ret = -ENODEV; goto errout_with_wm8904; } @@ -355,7 +355,7 @@ int sam_wm8904_initialize(int minor) ret = audio_register(devname, pcm); if (ret < 0) { - auddbg("ERROR: Failed to register /dev/%s device: %d\n", devname, ret); + auderr("ERROR: Failed to register /dev/%s device: %d\n", devname, ret); goto errout_with_pcm; } diff --git a/configs/shenzhou/src/stm32_adc.c b/configs/shenzhou/src/stm32_adc.c index bd54100a09..dbdc5a2963 100644 --- a/configs/shenzhou/src/stm32_adc.c +++ b/configs/shenzhou/src/stm32_adc.c @@ -145,7 +145,7 @@ int board_adc_setup(void) adc = stm32_adcinitialize(1, g_chanlist, ADC1_NCHANNELS); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -154,7 +154,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/shenzhou/src/stm32_autoleds.c b/configs/shenzhou/src/stm32_autoleds.c index 507caa71f7..e48e6c54f6 100644 --- a/configs/shenzhou/src/stm32_autoleds.c +++ b/configs/shenzhou/src/stm32_autoleds.c @@ -62,10 +62,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/shenzhou/src/stm32_can.c b/configs/shenzhou/src/stm32_can.c index 0e70944eb7..51b6922345 100644 --- a/configs/shenzhou/src/stm32_can.c +++ b/configs/shenzhou/src/stm32_can.c @@ -66,12 +66,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -109,7 +109,7 @@ int board_can_initialize(void) can = stm32_caninitialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -118,7 +118,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/shenzhou/src/stm32_ili93xx.c b/configs/shenzhou/src/stm32_ili93xx.c index 41fef5868b..dfe869e7f6 100644 --- a/configs/shenzhou/src/stm32_ili93xx.c +++ b/configs/shenzhou/src/stm32_ili93xx.c @@ -371,10 +371,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -594,18 +594,18 @@ static struct stm32_dev_s g_lcddev = #ifdef CONFIG_LCD_REGDEBUG static void stm32_lcdshow(FAR struct stm32_lower_s *priv, FAR const char *msg) { - dbg("%s:\n", msg); - dbg(" CRTL RS: %d CS: %d RD: %d WR: %d LE: %d\n", + err("%s:\n", msg); + err(" CRTL RS: %d CS: %d RD: %d WR: %d LE: %d\n", getreg32(LCD_RS_READ), getreg32(LCD_CS_READ), getreg32(LCD_RD_READ), getreg32(LCD_WR_READ), getreg32(LCD_LE_READ)); - dbg(" DATA CR: %08x %08x\n", getreg32(LCD_CRL), getreg32(LCD_CRH)); + err(" DATA CR: %08x %08x\n", getreg32(LCD_CRL), getreg32(LCD_CRH)); if (priv->output) { - dbg(" OUTPUT: %08x\n", getreg32(LCD_ODR)); + err(" OUTPUT: %08x\n", getreg32(LCD_ODR)); } else { - dbg(" INPUT: %08x\n", getreg32(LCD_IDR)); + err(" INPUT: %08x\n", getreg32(LCD_IDR)); } } #endif @@ -1254,7 +1254,7 @@ static int stm32_setpower(struct lcd_dev_s *dev, int power) else #endif { - gdbg("Unsupported LCD: %d\n", priv->type); + gerr("Unsupported LCD: %d\n", priv->type); } up_mdelay(50); @@ -1780,7 +1780,7 @@ static inline int stm32_lcdinitialize(FAR struct stm32_dev_s *priv) up_mdelay(50); id = stm32_readreg(priv, LCD_REG_0); /* Read the ID register */ - lcddbg("LCD ID: %04x\n", id); + lcderr("LCD ID: %04x\n", id); stm32_lcdoutput(priv); up_mdelay(10); @@ -1852,11 +1852,11 @@ static inline int stm32_lcdinitialize(FAR struct stm32_dev_s *priv) else #endif { - lcddbg("Unsupported LCD type\n"); + lcderr("Unsupported LCD type\n"); ret = -ENODEV; } - lcddbg("LCD type: %d\n", priv->type); + lcderr("LCD type: %d\n", priv->type); return ret; } diff --git a/configs/shenzhou/src/stm32_mmcsd.c b/configs/shenzhou/src/stm32_mmcsd.c index 6307bf3391..b1ebe96400 100644 --- a/configs/shenzhou/src/stm32_mmcsd.c +++ b/configs/shenzhou/src/stm32_mmcsd.c @@ -100,7 +100,7 @@ int stm32_sdinitialize(int minor) spi = stm32_spibus_initialize(STM32_MMCSDSPIPORTNO); if (!spi) { - fdbg("Failed to initialize SPI port %d\n", STM32_MMCSDSPIPORTNO); + ferr("Failed to initialize SPI port %d\n", STM32_MMCSDSPIPORTNO); return -ENODEV; } @@ -114,7 +114,7 @@ int stm32_sdinitialize(int minor) ret = mmcsd_spislotinitialize(minor, STM32_MMCSDSLOTNO, spi); if (ret < 0) { - fdbg("Failed to bind SPI port %d to MMC/SD slot %d: %d\n", + ferr("Failed to bind SPI port %d to MMC/SD slot %d: %d\n", STM32_MMCSDSPIPORTNO, STM32_MMCSDSLOTNO, ret); return ret; } diff --git a/configs/shenzhou/src/stm32_spi.c b/configs/shenzhou/src/stm32_spi.c index c0975d6b73..9f85fca6f3 100644 --- a/configs/shenzhou/src/stm32_spi.c +++ b/configs/shenzhou/src/stm32_spi.c @@ -64,14 +64,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -145,7 +145,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); /* SPI1 connects to the SD CARD and to the SPI FLASH */ @@ -181,7 +181,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); /* SPI3 connects to TFT LCD (for touchscreen and SD) and the RF24L01 2.4G * wireless module. diff --git a/configs/shenzhou/src/stm32_ssd1289.c b/configs/shenzhou/src/stm32_ssd1289.c index 868449ee00..7a28c222ca 100644 --- a/configs/shenzhou/src/stm32_ssd1289.c +++ b/configs/shenzhou/src/stm32_ssd1289.c @@ -89,10 +89,10 @@ /* Debug ****************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -277,18 +277,18 @@ static struct stm32_lower_s g_lcdlower = #ifdef CONFIG_LCD_REGDEBUG static void stm32_lcdshow(FAR struct stm32_lower_s *priv, FAR const char *msg) { - dbg("%s:\n", msg); - dbg(" CRTL RS: %d CS: %d RD: %d WR: %d LE: %d\n", + err("%s:\n", msg); + err(" CRTL RS: %d CS: %d RD: %d WR: %d LE: %d\n", getreg32(LCD_RS_READ), getreg32(LCD_CS_READ), getreg32(LCD_RD_READ), getreg32(LCD_WR_READ), getreg32(LCD_LE_READ)); - dbg(" DATA CR: %08x %08x\n", getreg32(LCD_CRL), getreg32(LCD_CRH)); + err(" DATA CR: %08x %08x\n", getreg32(LCD_CRL), getreg32(LCD_CRH)); if (priv->output) { - dbg(" OUTPUT: %08x\n", getreg32(LCD_ODR)); + err(" OUTPUT: %08x\n", getreg32(LCD_ODR)); } else { - dbg(" INPUT: %08x\n", getreg32(LCD_IDR)); + err(" INPUT: %08x\n", getreg32(LCD_IDR)); } } #endif @@ -563,7 +563,7 @@ int board_lcd_initialize(void) priv->drvr = ssd1289_lcdinitialize(&priv->dev); if (!priv->drvr) { - lcddbg("ERROR: ssd1289_lcdinitialize failed\n"); + lcderr("ERROR: ssd1289_lcdinitialize failed\n"); return -ENODEV; } } diff --git a/configs/shenzhou/src/stm32_touchscreen.c b/configs/shenzhou/src/stm32_touchscreen.c index df3943812e..b20789cd9e 100644 --- a/configs/shenzhou/src/stm32_touchscreen.c +++ b/configs/shenzhou/src/stm32_touchscreen.c @@ -251,7 +251,7 @@ int board_tsc_setup(int minor) FAR struct spi_dev_s *dev; int ret; - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(minor == 0); /* Configure and enable the ADS7843E interrupt pin as an input. */ @@ -263,7 +263,7 @@ int board_tsc_setup(int minor) dev = stm32_spibus_initialize(CONFIG_ADS7843E_SPIDEV); if (!dev) { - idbg("Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV); + ierr("Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV); return -ENODEV; } @@ -272,7 +272,7 @@ int board_tsc_setup(int minor) ret = ads7843e_register(dev, &g_tscinfo.dev, CONFIG_ADS7843E_DEVMINOR); if (ret < 0) { - idbg("Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV); + ierr("Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV); /* up_spiuninitialize(dev); */ return -ENODEV; } diff --git a/configs/shenzhou/src/stm32_usb.c b/configs/shenzhou/src/stm32_usb.c index 631e87c94f..054270e04d 100644 --- a/configs/shenzhou/src/stm32_usb.c +++ b/configs/shenzhou/src/stm32_usb.c @@ -184,7 +184,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the mass storage class: %d\n", ret); + uerr("ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -194,7 +194,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + uerr("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif diff --git a/configs/shenzhou/src/stm32_userleds.c b/configs/shenzhou/src/stm32_userleds.c index 7fc3976970..842cebd332 100644 --- a/configs/shenzhou/src/stm32_userleds.c +++ b/configs/shenzhou/src/stm32_userleds.c @@ -62,10 +62,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/shenzhou/src/stm32_w25.c b/configs/shenzhou/src/stm32_w25.c index fe27c8a1d7..68db581ce3 100644 --- a/configs/shenzhou/src/stm32_w25.c +++ b/configs/shenzhou/src/stm32_w25.c @@ -107,7 +107,7 @@ int stm32_w25initialize(int minor) spi = stm32_spibus_initialize(1); if (!spi) { - fdbg("ERROR: Failed to initialize SPI port 2\n"); + ferr("ERROR: Failed to initialize SPI port 2\n"); return -ENODEV; } @@ -116,7 +116,7 @@ int stm32_w25initialize(int minor) mtd = w25_initialize(spi); if (!mtd) { - fdbg("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n"); + ferr("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n"); return -ENODEV; } @@ -126,7 +126,7 @@ int stm32_w25initialize(int minor) ret = ftl_initialize(minor, mtd); if (ret < 0) { - fdbg("ERROR: Initialize the FTL layer\n"); + ferr("ERROR: Initialize the FTL layer\n"); return ret; } #else @@ -135,7 +135,7 @@ int stm32_w25initialize(int minor) ret = nxffs_initialize(mtd); if (ret < 0) { - fdbg("ERROR: NXFFS initialization failed: %d\n", -ret); + ferr("ERROR: NXFFS initialization failed: %d\n", -ret); return ret; } @@ -145,7 +145,7 @@ int stm32_w25initialize(int minor) ret = mount(NULL, devname, "nxffs", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif diff --git a/configs/sim/src/sim_bringup.c b/configs/sim/src/sim_bringup.c index 11489bace7..08b7e9f6ce 100644 --- a/configs/sim/src/sim_bringup.c +++ b/configs/sim/src/sim_bringup.c @@ -62,7 +62,7 @@ int trv_mount_world(int minor, FAR const char *mountpoint); #ifdef CONFIG_BOARD_INITIALIZE # define SYSLOG llerr #else -# define SYSLOG dbg +# define SYSLOG err #endif /**************************************************************************** diff --git a/configs/sim/src/sim_touchscreen.c b/configs/sim/src/sim_touchscreen.c index d52b4133d9..622e631382 100644 --- a/configs/sim/src/sim_touchscreen.c +++ b/configs/sim/src/sim_touchscreen.c @@ -111,14 +111,14 @@ int board_tsc_setup(int minor) ret = up_fbinitialize(0); if (ret < 0) { - idbg("up_fbinitialize failed: %d\n", -ret); + ierr("up_fbinitialize failed: %d\n", -ret); goto errout; } dev = up_fbgetvplane(0, 0); if (!dev) { - idbg("up_fbgetvplane 0 failed\n"); + ierr("up_fbgetvplane 0 failed\n"); ret = -ENODEV; goto errout_with_fb; } @@ -130,7 +130,7 @@ int board_tsc_setup(int minor) if (!g_simtc.hnx) { ret = -errno; - idbg("nx_open failed: %d\n", ret); + ierr("nx_open failed: %d\n", ret); goto errout_with_fb; } @@ -140,7 +140,7 @@ int board_tsc_setup(int minor) ret = vnc_default_fbinitialize(0, g_simtc.hnx); if (ret < 0) { - idbg("vnc_default_fbinitialize failed: %d\n", ret); + ierr("vnc_default_fbinitialize failed: %d\n", ret); goto errout_with_fb; } #endif @@ -153,7 +153,7 @@ int board_tsc_setup(int minor) ret = nx_setbgcolor(g_simtc.hnx, &color); if (ret < 0) { - idbg("nx_setbgcolor failed: %d\n", ret); + ierr("nx_setbgcolor failed: %d\n", ret); goto errout_with_nx; } @@ -162,7 +162,7 @@ int board_tsc_setup(int minor) ret = board_tsc_setup(minor); if (ret < 0) { - idbg("board_tsc_setup failed: %d\n", ret); + ierr("board_tsc_setup failed: %d\n", ret); goto errout_with_nx; } return OK; diff --git a/configs/spark/src/stm32_appinit.c b/configs/spark/src/stm32_appinit.c index c91969cd59..ebb3518af7 100644 --- a/configs/spark/src/stm32_appinit.c +++ b/configs/spark/src/stm32_appinit.c @@ -206,7 +206,7 @@ int board_app_initialize(uintptr_t arg) ret = ftl_initialize(CONFIG_SPARK_FLASH_MINOR, mtd); if (ret < 0) { - fdbg("ERROR: Initialize the FTL layer\n"); + ferr("ERROR: Initialize the FTL layer\n"); return ret; } @@ -227,7 +227,7 @@ int board_app_initialize(uintptr_t arg) ret = mount(partname, mntpoint, "vfat", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the FAT volume: %d\n", errno); + ferr("ERROR: Failed to mount the FAT volume: %d\n", errno); return ret; } } @@ -261,7 +261,7 @@ int board_app_initialize(uintptr_t arg) ret = ftl_initialize(partno, mtd_part); if (ret < 0) { - fdbg("ERROR: Initialize the FTL layer\n"); + ferr("ERROR: Initialize the FTL layer\n"); return ret; } @@ -274,7 +274,7 @@ int board_app_initialize(uintptr_t arg) ret = mount(partname, mntpoint, "vfat", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the FAT volume: %d\n", errno); + ferr("ERROR: Failed to mount the FAT volume: %d\n", errno); return ret; } diff --git a/configs/spark/src/stm32_autoleds.c b/configs/spark/src/stm32_autoleds.c index f085b71a7b..8e3d002c77 100644 --- a/configs/spark/src/stm32_autoleds.c +++ b/configs/spark/src/stm32_autoleds.c @@ -64,10 +64,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/spark/src/stm32_composite.c b/configs/spark/src/stm32_composite.c index 8893c12c92..e38c769e64 100644 --- a/configs/spark/src/stm32_composite.c +++ b/configs/spark/src/stm32_composite.c @@ -145,7 +145,7 @@ static int stm32_composite_initialize(void) spi = stm32_spibus_initialize(CONFIG_SPARK_FLASH_SPI); if (!spi) { - fdbg("ERROR: Failed to initialize SPI port %d\n", + ferr("ERROR: Failed to initialize SPI port %d\n", CONFIG_SPARK_FLASH_SPI); return -ENODEV; } @@ -158,7 +158,7 @@ static int stm32_composite_initialize(void) mtd = sst25_initialize(spi); if (!mtd) { - fdbg("ERROR: Failed to bind SPI port %d to the SPI FLASH driver\n", + ferr("ERROR: Failed to bind SPI port %d to the SPI FLASH driver\n", CONFIG_SPARK_FLASH_SPI); } else @@ -174,7 +174,7 @@ static int stm32_composite_initialize(void) ret = ftl_initialize(CONFIG_SPARK_FLASH_MINOR, mtd); if (ret < 0) { - fdbg("ERROR: Initialize the FTL layer\n"); + ferr("ERROR: Initialize the FTL layer\n"); return ret; } @@ -194,7 +194,7 @@ static int stm32_composite_initialize(void) ret = mount(partname, mntpoint, "vfat", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the FAT volume: %d\n", errno); + ferr("ERROR: Failed to mount the FAT volume: %d\n", errno); return ret; } @@ -228,7 +228,7 @@ static int stm32_composite_initialize(void) ret = ftl_initialize(partno, mtd_part); if (ret < 0) { - fdbg("ERROR: Initialize the FTL layer\n"); + ferr("ERROR: Initialize the FTL layer\n"); return ret; } @@ -241,7 +241,7 @@ static int stm32_composite_initialize(void) ret = mount(partname, mntpoint, "vfat", 0, NULL); if (ret < 0) { - fdbg("ERROR: Failed to mount the FAT volume: %d\n", errno); + ferr("ERROR: Failed to mount the FAT volume: %d\n", errno); return ret; } @@ -272,7 +272,7 @@ static int stm32_composite_initialize(void) ret = usbmonitor_start(0, NULL); if (ret != OK) { - fdbg("ERROR: Failed to start USB monitor: %d\n", ret); + ferr("ERROR: Failed to start USB monitor: %d\n", ret); } #endif diff --git a/configs/spark/src/stm32_spi.c b/configs/spark/src/stm32_spi.c index 92015ce1ef..8c12859c49 100644 --- a/configs/spark/src/stm32_spi.c +++ b/configs/spark/src/stm32_spi.c @@ -69,7 +69,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -77,7 +77,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -144,7 +144,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -156,7 +156,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #if defined(CONFIG_MTD_SST25) @@ -186,7 +186,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } diff --git a/configs/spark/src/stm32_userleds.c b/configs/spark/src/stm32_userleds.c index 63fb4df0e2..d8e6608429 100644 --- a/configs/spark/src/stm32_userleds.c +++ b/configs/spark/src/stm32_userleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/spark/src/stm32_wireless.c b/configs/spark/src/stm32_wireless.c index 3feb345e5a..69a73be746 100644 --- a/configs/spark/src/stm32_wireless.c +++ b/configs/spark/src/stm32_wireless.c @@ -281,7 +281,7 @@ int wireless_archinitialize(size_t max_rx_size) /* Init SPI bus */ - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(CONFIG_CC3000_DEVMINOR == 0); #ifdef CONFIG_CC3000_PROBES @@ -296,7 +296,7 @@ int wireless_archinitialize(size_t max_rx_size) spi = stm32_spibus_initialize(CONFIG_CC3000_SPIDEV); if (!spi) { - idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); + ierr("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); return -ENODEV; } @@ -305,7 +305,7 @@ int wireless_archinitialize(size_t max_rx_size) int ret = cc3000_register(spi, &g_cc3000_info.dev, CONFIG_CC3000_DEVMINOR); if (ret < 0) { - idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); + ierr("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); return -ENODEV; } diff --git a/configs/stm3210e-eval/src/stm32_adc.c b/configs/stm3210e-eval/src/stm32_adc.c index a3beeab10f..38a55145cb 100644 --- a/configs/stm3210e-eval/src/stm32_adc.c +++ b/configs/stm3210e-eval/src/stm32_adc.c @@ -136,7 +136,7 @@ int board_adc_setup(void) adc = stm32_adcinitialize(1, g_chanlist, ADC1_NCHANNELS); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -145,7 +145,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/stm3210e-eval/src/stm32_appinit.c b/configs/stm3210e-eval/src/stm32_appinit.c index 4a5d55c9eb..831a4f341e 100644 --- a/configs/stm3210e-eval/src/stm32_appinit.c +++ b/configs/stm3210e-eval/src/stm32_appinit.c @@ -129,14 +129,14 @@ static void stm32_i2c_register(int bus) i2c = stm32_i2cbus_initialize(bus); if (i2c == NULL) { - dbg("ERROR: Failed to get I2C%d interface\n", bus); + err("ERROR: Failed to get I2C%d interface\n", bus); } else { ret = i2c_register(i2c, bus); if (ret < 0) { - dbg("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); stm32_i2cbus_uninitialize(i2c); } } diff --git a/configs/stm3210e-eval/src/stm32_can.c b/configs/stm3210e-eval/src/stm32_can.c index 4b2f506538..9ff5ebec86 100644 --- a/configs/stm3210e-eval/src/stm32_can.c +++ b/configs/stm3210e-eval/src/stm32_can.c @@ -66,12 +66,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -109,7 +109,7 @@ int board_can_initialize(void) can = stm32_caninitialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -118,7 +118,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/stm3210e-eval/src/stm32_lcd.c b/configs/stm3210e-eval/src/stm32_lcd.c index a0b4062d3b..302a8c25a4 100644 --- a/configs/stm3210e-eval/src/stm32_lcd.c +++ b/configs/stm3210e-eval/src/stm32_lcd.c @@ -312,9 +312,9 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) info(format, ##__VA_ARGS__) +# define lcderr(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) #endif /************************************************************************************** @@ -742,7 +742,7 @@ static int stm3210e_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *bu /* Buffer must be provided and aligned to a 16-bit address boundary */ - lcddbg("row: %d col: %d npixels: %d\n", row, col, npixels); + lcderr("row: %d col: %d npixels: %d\n", row, col, npixels); DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0); /* Write the run to GRAM. */ @@ -835,7 +835,7 @@ static int stm3210e_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, /* Buffer must be provided and aligned to a 16-bit address boundary */ - lcddbg("row: %d col: %d npixels: %d\n", row, col, npixels); + lcderr("row: %d col: %d npixels: %d\n", row, col, npixels); DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0); /* Configure according to the LCD type */ @@ -1321,7 +1321,7 @@ static inline void stm3210e_lcdinitialize(void) */ id = stm3210e_readreg(LCD_REG_0); - lcddbg("LCD ID: %04x\n", id); + lcderr("LCD ID: %04x\n", id); /* Check if the ID is for the SPFD5408B */ @@ -1331,7 +1331,7 @@ static inline void stm3210e_lcdinitialize(void) /* Set the LCD type for the SPFD5408B */ g_lcddev.type = LCD_TYPE_SPFD5408B; - lcddbg("LCD type: %d\n", g_lcddev.type); + lcderr("LCD type: %d\n", g_lcddev.type); /* Start Initial Sequence */ @@ -1436,7 +1436,7 @@ static inline void stm3210e_lcdinitialize(void) /* Set the LCD type for the R61580 */ g_lcddev.type = LCD_TYPE_R61580; - lcddbg("LCD type: %d\n", g_lcddev.type); + lcderr("LCD type: %d\n", g_lcddev.type); /* Start Initial Sequence */ @@ -1506,7 +1506,7 @@ static inline void stm3210e_lcdinitialize(void) /* Set the LCD type for the AM240320 */ g_lcddev.type = LCD_TYPE_AM240320; - lcddbg("LCD type: %d\n", g_lcddev.type); + lcderr("LCD type: %d\n", g_lcddev.type); /* Start Initial Sequence */ @@ -1595,7 +1595,7 @@ static inline void stm3210e_lcdinitialize(void) stm3210e_writereg(LCD_REG_3, 0x1018); stm3210e_writereg(LCD_REG_7, 0); /* Display off */ #else - lcddbg("Unsupported LCD type\n"); + lcderr("Unsupported LCD type\n"); #endif } } @@ -1743,25 +1743,25 @@ static void stm3210e_backlight(void) /* Dump timer1 registers */ - lcddbg("APB2ENR: %08x\n", getreg32(STM32_RCC_APB2ENR)); - lcddbg("CR1: %04x\n", getreg32(STM32_TIM1_CR1)); - lcddbg("CR2: %04x\n", getreg32(STM32_TIM1_CR2)); - lcddbg("SMCR: %04x\n", getreg32(STM32_TIM1_SMCR)); - lcddbg("DIER: %04x\n", getreg32(STM32_TIM1_DIER)); - lcddbg("SR: %04x\n", getreg32(STM32_TIM1_SR)); - lcddbg("BDTR: %04x\n", getreg32(STM32_TIM1_BDTR)); - lcddbg("CCMR1: %04x\n", getreg32(STM32_TIM1_CCMR1)); - lcddbg("CCMR2: %04x\n", getreg32(STM32_TIM1_CCMR2)); - lcddbg("CCER: %04x\n", getreg32(STM32_TIM1_CCER)); - lcddbg("CNT: %04x\n", getreg32(STM32_TIM1_CNT)); - lcddbg("PSC: %04x\n", getreg32(STM32_TIM1_PSC)); - lcddbg("ARR: %04x\n", getreg32(STM32_TIM1_ARR)); - lcddbg("RCR: %04x\n", getreg32(STM32_TIM1_RCR)); - lcddbg("CCR1: %04x\n", getreg32(STM32_TIM1_CCR1)); - lcddbg("CCR2: %04x\n", getreg32(STM32_TIM1_CCR2)); - lcddbg("CCR3: %04x\n", getreg32(STM32_TIM1_CCR3)); - lcddbg("CCR4: %04x\n", getreg32(STM32_TIM1_CCR4)); - lcddbg("DMAR: %04x\n", getreg32(STM32_TIM1_DMAR)); + lcderr("APB2ENR: %08x\n", getreg32(STM32_RCC_APB2ENR)); + lcderr("CR1: %04x\n", getreg32(STM32_TIM1_CR1)); + lcderr("CR2: %04x\n", getreg32(STM32_TIM1_CR2)); + lcderr("SMCR: %04x\n", getreg32(STM32_TIM1_SMCR)); + lcderr("DIER: %04x\n", getreg32(STM32_TIM1_DIER)); + lcderr("SR: %04x\n", getreg32(STM32_TIM1_SR)); + lcderr("BDTR: %04x\n", getreg32(STM32_TIM1_BDTR)); + lcderr("CCMR1: %04x\n", getreg32(STM32_TIM1_CCMR1)); + lcderr("CCMR2: %04x\n", getreg32(STM32_TIM1_CCMR2)); + lcderr("CCER: %04x\n", getreg32(STM32_TIM1_CCER)); + lcderr("CNT: %04x\n", getreg32(STM32_TIM1_CNT)); + lcderr("PSC: %04x\n", getreg32(STM32_TIM1_PSC)); + lcderr("ARR: %04x\n", getreg32(STM32_TIM1_ARR)); + lcderr("RCR: %04x\n", getreg32(STM32_TIM1_RCR)); + lcderr("CCR1: %04x\n", getreg32(STM32_TIM1_CCR1)); + lcderr("CCR2: %04x\n", getreg32(STM32_TIM1_CCR2)); + lcderr("CCR3: %04x\n", getreg32(STM32_TIM1_CCR3)); + lcderr("CCR4: %04x\n", getreg32(STM32_TIM1_CCR4)); + lcderr("DMAR: %04x\n", getreg32(STM32_TIM1_DMAR)); #endif } #endif @@ -1794,7 +1794,7 @@ int board_lcd_initialize(void) ret = pm_register(&g_lcdcb); if (ret != OK) { - lcddbg("ERROR: pm_register failed: %d\n", ret); + lcderr("ERROR: pm_register failed: %d\n", ret); } #endif diff --git a/configs/stm3210e-eval/src/stm32_leds.c b/configs/stm3210e-eval/src/stm32_leds.c index ba5876f4ff..b54282ab3c 100644 --- a/configs/stm3210e-eval/src/stm32_leds.c +++ b/configs/stm3210e-eval/src/stm32_leds.c @@ -62,10 +62,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm3210e-eval/src/stm32_spi.c b/configs/stm3210e-eval/src/stm32_spi.c index 833bce97fe..623363ca7c 100644 --- a/configs/stm3210e-eval/src/stm32_spi.c +++ b/configs/stm3210e-eval/src/stm32_spi.c @@ -63,7 +63,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -71,7 +71,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -134,7 +134,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); if (devid == SPIDEV_FLASH) { @@ -153,7 +153,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -165,7 +165,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/stm3220g-eval/src/stm32_adc.c b/configs/stm3220g-eval/src/stm32_adc.c index f79ca23c53..2d9041c6ec 100644 --- a/configs/stm3220g-eval/src/stm32_adc.c +++ b/configs/stm3220g-eval/src/stm32_adc.c @@ -140,7 +140,7 @@ int board_adc_setup(void) adc = stm32_adcinitialize(3, g_chanlist, ADC3_NCHANNELS); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -149,7 +149,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/stm3220g-eval/src/stm32_appinit.c b/configs/stm3220g-eval/src/stm32_appinit.c index 89795b54d5..e763f2fbe4 100644 --- a/configs/stm3220g-eval/src/stm32_appinit.c +++ b/configs/stm3220g-eval/src/stm32_appinit.c @@ -142,14 +142,14 @@ static void stm32_i2c_register(int bus) i2c = stm32_i2cbus_initialize(bus); if (i2c == NULL) { - dbg("ERROR: Failed to get I2C%d interface\n", bus); + err("ERROR: Failed to get I2C%d interface\n", bus); } else { ret = i2c_register(i2c, bus); if (ret < 0) { - dbg("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); stm32_i2cbus_uninitialize(i2c); } } diff --git a/configs/stm3220g-eval/src/stm32_autoleds.c b/configs/stm3220g-eval/src/stm32_autoleds.c index 688e1aa1ee..ee9e22af14 100644 --- a/configs/stm3220g-eval/src/stm32_autoleds.c +++ b/configs/stm3220g-eval/src/stm32_autoleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm3220g-eval/src/stm32_can.c b/configs/stm3220g-eval/src/stm32_can.c index 9e32e3c27b..c01a0d6df9 100644 --- a/configs/stm3220g-eval/src/stm32_can.c +++ b/configs/stm3220g-eval/src/stm32_can.c @@ -74,12 +74,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -117,7 +117,7 @@ int board_can_initialize(void) can = stm32_caninitialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -126,7 +126,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/stm3220g-eval/src/stm32_lcd.c b/configs/stm3220g-eval/src/stm32_lcd.c index 392c4f3990..b7f4b1ec4d 100644 --- a/configs/stm3220g-eval/src/stm32_lcd.c +++ b/configs/stm3220g-eval/src/stm32_lcd.c @@ -265,10 +265,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -967,7 +967,7 @@ static inline void stm3220g_lcdinitialize(void) /* Check LCD ID */ id = stm3220g_readreg(LCD_REG_0); - lcddbg("LCD ID: %04x\n", id); + lcderr("LCD ID: %04x\n", id); /* Check if the ID is for the STM32_ILI9320 (or ILI9321) or STM32_ILI9325 */ @@ -996,7 +996,7 @@ static inline void stm3220g_lcdinitialize(void) #else /* if !defined(CONFIG_STM32_ILI9325_DISABLE) */ g_lcddev.type = LCD_TYPE_ILI9325; #endif - lcddbg("LCD type: %d\n", g_lcddev.type); + lcderr("LCD type: %d\n", g_lcddev.type); /* Start Initial Sequence */ @@ -1114,7 +1114,7 @@ static inline void stm3220g_lcdinitialize(void) } else { - lcddbg("Unsupported LCD type\n"); + lcderr("Unsupported LCD type\n"); } } diff --git a/configs/stm3220g-eval/src/stm32_pwm.c b/configs/stm3220g-eval/src/stm32_pwm.c index 9c0467138a..c5c26352e0 100644 --- a/configs/stm3220g-eval/src/stm32_pwm.c +++ b/configs/stm3220g-eval/src/stm32_pwm.c @@ -97,7 +97,7 @@ int board_pwm_setup(void) pwm = stm32_pwminitialize(STM3220G_EVAL_PWMTIMER); if (!pwm) { - dbg("Failed to get the STM32 PWM lower half\n"); + err("Failed to get the STM32 PWM lower half\n"); return -ENODEV; } @@ -106,7 +106,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/stm3220g-eval/src/stm32_spi.c b/configs/stm3220g-eval/src/stm32_spi.c index 3980b6e7d5..8cb939c519 100644 --- a/configs/stm3220g-eval/src/stm32_spi.c +++ b/configs/stm3220g-eval/src/stm32_spi.c @@ -63,7 +63,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -71,7 +71,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -124,7 +124,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -136,7 +136,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -148,7 +148,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/stm3220g-eval/src/stm32_stmpe811.c b/configs/stm3220g-eval/src/stm32_stmpe811.c index b8832734c8..03d5cff876 100644 --- a/configs/stm3220g-eval/src/stm32_stmpe811.c +++ b/configs/stm3220g-eval/src/stm32_stmpe811.c @@ -279,7 +279,7 @@ int board_tsc_setup(int minor) FAR struct i2c_master_s *dev; int ret; - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(minor == 0); /* Check if we are already initialized */ @@ -297,7 +297,7 @@ int board_tsc_setup(int minor) dev = stm32_i2cbus_initialize(CONFIG_STMPE811_I2CDEV); if (!dev) { - idbg("Failed to initialize I2C bus %d\n", CONFIG_STMPE811_I2CDEV); + ierr("Failed to initialize I2C bus %d\n", CONFIG_STMPE811_I2CDEV); return -ENODEV; } @@ -307,7 +307,7 @@ int board_tsc_setup(int minor) stmpe811_instantiate(dev, (FAR struct stmpe811_config_s *)&g_stmpe811config); if (!g_stmpe811config.handle) { - idbg("Failed to instantiate the STMPE811 driver\n"); + ierr("Failed to instantiate the STMPE811 driver\n"); return -ENODEV; } @@ -316,7 +316,7 @@ int board_tsc_setup(int minor) ret = stmpe811_register(g_stmpe811config.handle, CONFIG_STMPE811_DEVMINOR); if (ret < 0) { - idbg("Failed to register STMPE driver: %d\n", ret); + ierr("Failed to register STMPE driver: %d\n", ret); /* stm32_i2cbus_uninitialize(dev); */ return -ENODEV; } diff --git a/configs/stm3220g-eval/src/stm32_usb.c b/configs/stm3220g-eval/src/stm32_usb.c index db13541bb6..1fc1fdf74a 100644 --- a/configs/stm3220g-eval/src/stm32_usb.c +++ b/configs/stm3220g-eval/src/stm32_usb.c @@ -184,7 +184,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the mass storage class: %d\n", ret); + uerr("ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -194,7 +194,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + uerr("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif diff --git a/configs/stm3220g-eval/src/stm32_userleds.c b/configs/stm3220g-eval/src/stm32_userleds.c index 0fc42a3da1..09299ae8ca 100644 --- a/configs/stm3220g-eval/src/stm32_userleds.c +++ b/configs/stm3220g-eval/src/stm32_userleds.c @@ -62,10 +62,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm3240g-eval/src/stm32_adc.c b/configs/stm3240g-eval/src/stm32_adc.c index da37355e50..8ca5ae99b0 100644 --- a/configs/stm3240g-eval/src/stm32_adc.c +++ b/configs/stm3240g-eval/src/stm32_adc.c @@ -140,7 +140,7 @@ int board_adc_setup(void) adc = stm32_adcinitialize(3, g_chanlist, ADC3_NCHANNELS); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -149,7 +149,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/stm3240g-eval/src/stm32_appinit.c b/configs/stm3240g-eval/src/stm32_appinit.c index 469180c390..144f237c1a 100644 --- a/configs/stm3240g-eval/src/stm32_appinit.c +++ b/configs/stm3240g-eval/src/stm32_appinit.c @@ -160,14 +160,14 @@ static void stm32_i2c_register(int bus) i2c = stm32_i2cbus_initialize(bus); if (i2c == NULL) { - dbg("ERROR: Failed to get I2C%d interface\n", bus); + err("ERROR: Failed to get I2C%d interface\n", bus); } else { ret = i2c_register(i2c, bus); if (ret < 0) { - dbg("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); stm32_i2cbus_uninitialize(i2c); } } @@ -254,7 +254,7 @@ int board_app_initialize(uintptr_t arg) lower = stm32_rtc_lowerhalf(); if (!lower) { - sdbg("ERROR: Failed to instantiate the RTC lower-half driver\n"); + serr("ERROR: Failed to instantiate the RTC lower-half driver\n"); return -ENOMEM; } else @@ -266,7 +266,7 @@ int board_app_initialize(uintptr_t arg) ret = rtc_initialize(0, lower); if (ret < 0) { - sdbg("ERROR: Failed to bind/register the RTC driver: %d\n", ret); + serr("ERROR: Failed to bind/register the RTC driver: %d\n", ret); return ret; } } diff --git a/configs/stm3240g-eval/src/stm32_autoleds.c b/configs/stm3240g-eval/src/stm32_autoleds.c index 500b834af8..d2c68f0280 100644 --- a/configs/stm3240g-eval/src/stm32_autoleds.c +++ b/configs/stm3240g-eval/src/stm32_autoleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm3240g-eval/src/stm32_boot.c b/configs/stm3240g-eval/src/stm32_boot.c index 09b3b82eed..bfab437e4a 100644 --- a/configs/stm3240g-eval/src/stm32_boot.c +++ b/configs/stm3240g-eval/src/stm32_boot.c @@ -164,7 +164,7 @@ static int board_initthread(int argc, char *argv[]) ret = board_app_initialize(0); if (ret < 0) { - gdbg("ERROR: board_app_initialize failed: %d\n", ret); + gerr("ERROR: board_app_initialize failed: %d\n", ret); } #endif @@ -174,7 +174,7 @@ static int board_initthread(int argc, char *argv[]) ret = nx_start(); if (ret < 0) { - gdbg("ERROR: nx_start failed: %d\n", ret); + gerr("ERROR: nx_start failed: %d\n", ret); } #endif @@ -184,7 +184,7 @@ static int board_initthread(int argc, char *argv[]) ret = board_tsc_setup(CONFIG_NXWM_TOUCHSCREEN_DEVNO); if (ret < 0) { - gdbg("ERROR: board_tsc_setup failed: %d\n", ret); + gerr("ERROR: board_tsc_setup failed: %d\n", ret); } #endif diff --git a/configs/stm3240g-eval/src/stm32_can.c b/configs/stm3240g-eval/src/stm32_can.c index 2af6a8add7..265ee1b9ec 100644 --- a/configs/stm3240g-eval/src/stm32_can.c +++ b/configs/stm3240g-eval/src/stm32_can.c @@ -74,12 +74,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -117,7 +117,7 @@ int board_can_initialize(void) can = stm32_caninitialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -126,7 +126,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/stm3240g-eval/src/stm32_lcd.c b/configs/stm3240g-eval/src/stm32_lcd.c index 9ac96ce3b5..676bb777e8 100644 --- a/configs/stm3240g-eval/src/stm32_lcd.c +++ b/configs/stm3240g-eval/src/stm32_lcd.c @@ -265,10 +265,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -966,7 +966,7 @@ static inline void stm3240g_lcdinitialize(void) /* Check LCD ID */ id = stm3240g_readreg(LCD_REG_0); - lcddbg("LCD ID: %04x\n", id); + lcderr("LCD ID: %04x\n", id); /* Check if the ID is for the STM32_ILI9320 (or ILI9321) or STM32_ILI9325 */ @@ -995,7 +995,7 @@ static inline void stm3240g_lcdinitialize(void) #else /* if !defined(CONFIG_STM3240G_ILI9325_DISABLE) */ g_lcddev.type = LCD_TYPE_ILI9325; #endif - lcddbg("LCD type: %d\n", g_lcddev.type); + lcderr("LCD type: %d\n", g_lcddev.type); /* Start Initial Sequence */ @@ -1113,7 +1113,7 @@ static inline void stm3240g_lcdinitialize(void) } else { - lcddbg("Unsupported LCD type\n"); + lcderr("Unsupported LCD type\n"); } } diff --git a/configs/stm3240g-eval/src/stm32_pwm.c b/configs/stm3240g-eval/src/stm32_pwm.c index c10853a1b9..bc3054e477 100644 --- a/configs/stm3240g-eval/src/stm32_pwm.c +++ b/configs/stm3240g-eval/src/stm32_pwm.c @@ -97,7 +97,7 @@ int board_pwm_setup(void) pwm = stm32_pwminitialize(STM3240G_EVAL_PWMTIMER); if (!pwm) { - dbg("Failed to get the STM32 PWM lower half\n"); + err("Failed to get the STM32 PWM lower half\n"); return -ENODEV; } @@ -106,7 +106,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/stm3240g-eval/src/stm32_spi.c b/configs/stm3240g-eval/src/stm32_spi.c index 6a88d07937..a89daa6521 100644 --- a/configs/stm3240g-eval/src/stm32_spi.c +++ b/configs/stm3240g-eval/src/stm32_spi.c @@ -63,7 +63,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -71,7 +71,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -124,7 +124,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -136,7 +136,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -148,7 +148,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/stm3240g-eval/src/stm32_stmpe811.c b/configs/stm3240g-eval/src/stm32_stmpe811.c index 87a4a3e4b9..77b9ffadf3 100644 --- a/configs/stm3240g-eval/src/stm32_stmpe811.c +++ b/configs/stm3240g-eval/src/stm32_stmpe811.c @@ -279,7 +279,7 @@ int board_tsc_setup(int minor) FAR struct i2c_master_s *dev; int ret; - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(minor == 0); /* Check if we are already initialized */ @@ -297,7 +297,7 @@ int board_tsc_setup(int minor) dev = stm32_i2cbus_initialize(CONFIG_STMPE811_I2CDEV); if (!dev) { - idbg("Failed to initialize I2C bus %d\n", CONFIG_STMPE811_I2CDEV); + ierr("Failed to initialize I2C bus %d\n", CONFIG_STMPE811_I2CDEV); return -ENODEV; } @@ -307,7 +307,7 @@ int board_tsc_setup(int minor) stmpe811_instantiate(dev, (FAR struct stmpe811_config_s *)&g_stmpe811config); if (!g_stmpe811config.handle) { - idbg("Failed to instantiate the STMPE811 driver\n"); + ierr("Failed to instantiate the STMPE811 driver\n"); return -ENODEV; } @@ -316,7 +316,7 @@ int board_tsc_setup(int minor) ret = stmpe811_register(g_stmpe811config.handle, CONFIG_STMPE811_DEVMINOR); if (ret < 0) { - idbg("Failed to register STMPE driver: %d\n", ret); + ierr("Failed to register STMPE driver: %d\n", ret); /* stm32_i2cbus_uninitialize(dev); */ return -ENODEV; } diff --git a/configs/stm3240g-eval/src/stm32_usb.c b/configs/stm3240g-eval/src/stm32_usb.c index 6d65e66750..48f2f392b9 100644 --- a/configs/stm3240g-eval/src/stm32_usb.c +++ b/configs/stm3240g-eval/src/stm32_usb.c @@ -184,7 +184,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the mass storage class: %d\n", ret); + uerr("ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -194,7 +194,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + uerr("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif diff --git a/configs/stm3240g-eval/src/stm32_userleds.c b/configs/stm3240g-eval/src/stm32_userleds.c index 781c36d6fc..14bed2ac69 100644 --- a/configs/stm3240g-eval/src/stm32_userleds.c +++ b/configs/stm3240g-eval/src/stm32_userleds.c @@ -62,10 +62,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32_tiny/src/stm32_leds.c b/configs/stm32_tiny/src/stm32_leds.c index a57f77513a..1c136fdc09 100644 --- a/configs/stm32_tiny/src/stm32_leds.c +++ b/configs/stm32_tiny/src/stm32_leds.c @@ -61,10 +61,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32_tiny/src/stm32_pwm.c b/configs/stm32_tiny/src/stm32_pwm.c index 715d8d3a70..46bddca185 100644 --- a/configs/stm32_tiny/src/stm32_pwm.c +++ b/configs/stm32_tiny/src/stm32_pwm.c @@ -95,7 +95,7 @@ int board_pwm_setup(void) pwm = stm32_pwminitialize(STM32TINY_PWMTIMER); if (!pwm) { - adbg("Failed to get the STM32 PWM lower half\n"); + aerr("Failed to get the STM32 PWM lower half\n"); return -ENODEV; } @@ -104,7 +104,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/stm32_tiny/src/stm32_spi.c b/configs/stm32_tiny/src/stm32_spi.c index 41c30adfbe..a723fd689e 100644 --- a/configs/stm32_tiny/src/stm32_spi.c +++ b/configs/stm32_tiny/src/stm32_spi.c @@ -66,14 +66,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/stm32_tiny/src/stm32_wireless.c b/configs/stm32_tiny/src/stm32_wireless.c index 81e51afc85..842cb51c59 100644 --- a/configs/stm32_tiny/src/stm32_wireless.c +++ b/configs/stm32_tiny/src/stm32_wireless.c @@ -114,14 +114,14 @@ void stm32_wlinitialize(void) spidev = stm32_spibus_initialize(2); if (!spidev) { - dbg("Failed to initialize SPI bus\n"); + err("Failed to initialize SPI bus\n"); return; } result = nrf24l01_register(spidev, &nrf_cfg); if (result != OK) { - dbg("Failed to register initialize SPI bus\n"); + err("Failed to register initialize SPI bus\n"); return; } } diff --git a/configs/stm32f103-minimum/src/stm32_autoleds.c b/configs/stm32f103-minimum/src/stm32_autoleds.c index 4c4c6e9707..ca3215bba5 100644 --- a/configs/stm32f103-minimum/src/stm32_autoleds.c +++ b/configs/stm32f103-minimum/src/stm32_autoleds.c @@ -61,10 +61,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32f103-minimum/src/stm32_spi.c b/configs/stm32f103-minimum/src/stm32_spi.c index 0463578cc7..3d1577346c 100644 --- a/configs/stm32f103-minimum/src/stm32_spi.c +++ b/configs/stm32f103-minimum/src/stm32_spi.c @@ -66,14 +66,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/stm32f3discovery/src/stm32_autoleds.c b/configs/stm32f3discovery/src/stm32_autoleds.c index de7c528095..f6046e4b21 100644 --- a/configs/stm32f3discovery/src/stm32_autoleds.c +++ b/configs/stm32f3discovery/src/stm32_autoleds.c @@ -61,10 +61,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32f3discovery/src/stm32_pwm.c b/configs/stm32f3discovery/src/stm32_pwm.c index 7b1dd6830a..bb419cb6b8 100644 --- a/configs/stm32f3discovery/src/stm32_pwm.c +++ b/configs/stm32f3discovery/src/stm32_pwm.c @@ -119,7 +119,7 @@ int board_pwm_setup(void) pwm = stm32_pwminitialize(STM32F3DISCOVERY_PWMTIMER); if (!pwm) { - dbg("Failed to get the STM32 PWM lower half\n"); + err("Failed to get the STM32 PWM lower half\n"); return -ENODEV; } @@ -128,7 +128,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/stm32f3discovery/src/stm32_qencoder.c b/configs/stm32f3discovery/src/stm32_qencoder.c index c3773e552c..45d7f274c4 100644 --- a/configs/stm32f3discovery/src/stm32_qencoder.c +++ b/configs/stm32f3discovery/src/stm32_qencoder.c @@ -149,7 +149,7 @@ int qe_devinit(void) ret = stm32_qeinitialize("/dev/qe0", TIMID); if (ret < 0) { - sndbg("stm32_qeinitialize failed: %d\n", ret); + snerr("stm32_qeinitialize failed: %d\n", ret); return ret; } diff --git a/configs/stm32f3discovery/src/stm32_spi.c b/configs/stm32f3discovery/src/stm32_spi.c index 29cdb076a4..cd082fc996 100644 --- a/configs/stm32f3discovery/src/stm32_spi.c +++ b/configs/stm32f3discovery/src/stm32_spi.c @@ -64,7 +64,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -72,7 +72,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -129,7 +129,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); stm32_gpiowrite(GPIO_MEMS_CS, !selected); } @@ -143,7 +143,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -155,7 +155,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/stm32f3discovery/src/stm32_userleds.c b/configs/stm32f3discovery/src/stm32_userleds.c index ed7e2dacdd..adacc7cdaf 100644 --- a/configs/stm32f3discovery/src/stm32_userleds.c +++ b/configs/stm32f3discovery/src/stm32_userleds.c @@ -60,10 +60,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32f429i-disco/src/stm32_appinit.c b/configs/stm32f429i-disco/src/stm32_appinit.c index 29bbb24320..4f2eca3b31 100644 --- a/configs/stm32f429i-disco/src/stm32_appinit.c +++ b/configs/stm32f429i-disco/src/stm32_appinit.c @@ -205,7 +205,7 @@ int board_app_initialize(uintptr_t arg) ret = mtd->ioctl(mtd, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&geo)); if (ret < 0) { - fdbg("ERROR: mtd->ioctl failed: %d\n", ret); + ferr("ERROR: mtd->ioctl failed: %d\n", ret); return ret; } @@ -242,7 +242,7 @@ int board_app_initialize(uintptr_t arg) if (partszbytes < erasesize) { - fdbg("ERROR: Partition size is lesser than erasesize!\n"); + ferr("ERROR: Partition size is lesser than erasesize!\n"); return -1; } @@ -250,7 +250,7 @@ int board_app_initialize(uintptr_t arg) if ((partszbytes % erasesize) != 0) { - fdbg("ERROR: Partition size is not multiple of erasesize!\n"); + ferr("ERROR: Partition size is not multiple of erasesize!\n"); return -1; } @@ -284,7 +284,7 @@ int board_app_initialize(uintptr_t arg) if (mtd_part == NULL) { - dbg("Error: failed to create partition %s\n", partname); + err("Error: failed to create partition %s\n", partname); return -1; } diff --git a/configs/stm32f429i-disco/src/stm32_autoleds.c b/configs/stm32f429i-disco/src/stm32_autoleds.c index 4bec7993f2..b362bbb4b2 100644 --- a/configs/stm32f429i-disco/src/stm32_autoleds.c +++ b/configs/stm32f429i-disco/src/stm32_autoleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32f429i-disco/src/stm32_ili93414ws.c b/configs/stm32f429i-disco/src/stm32_ili93414ws.c index b83d16b061..c2cfffd44a 100644 --- a/configs/stm32f429i-disco/src/stm32_ili93414ws.c +++ b/configs/stm32f429i-disco/src/stm32_ili93414ws.c @@ -135,10 +135,10 @@ /* Debug option */ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -587,7 +587,7 @@ static uint16_t stm32_ili93414ws_recvword(void) } } - dbg("Timeout during receiving pixel word\n"); + err("Timeout during receiving pixel word\n"); return 0; } @@ -1174,7 +1174,7 @@ FAR struct ili9341_lcd_s *stm32_ili93414ws_initialize(void) FAR struct spi_dev_s *spi; FAR struct ili93414ws_lcd_s *priv = &g_lcddev; - lcddbg("initialize ili9341 4-wire serial subdriver\n"); + lcderr("initialize ili9341 4-wire serial subdriver\n"); lcdinfo("initialize spi device: %d\n", ILI93414WS_SPI_DEVICE); spi = stm32_spi5initialize(); @@ -1206,7 +1206,7 @@ FAR struct ili9341_lcd_s *stm32_ili93414ws_initialize(void) uint32_t regval; FAR struct ili93414ws_lcd_s *priv = &g_lcddev; - lcddbg("initialize ili9341 4-wire serial subdriver\n"); + lcderr("initialize ili9341 4-wire serial subdriver\n"); /* Enable spi bus */ diff --git a/configs/stm32f429i-disco/src/stm32_lcd.c b/configs/stm32f429i-disco/src/stm32_lcd.c index 40edd632c4..0624b68809 100644 --- a/configs/stm32f429i-disco/src/stm32_lcd.c +++ b/configs/stm32f429i-disco/src/stm32_lcd.c @@ -317,7 +317,7 @@ static int stm32_ili9341_initialize(void) /* Select spi device */ - dbg("Initialize ili9341 lcd driver\n"); + err("Initialize ili9341 lcd driver\n"); lcd->select(lcd); #ifdef CONFIG_DEBUG_LCD @@ -325,13 +325,13 @@ static int stm32_ili9341_initialize(void) lcd->sendcmd(lcd, ILI9341_READ_ID1); lcd->recvparam(lcd, ¶m); - dbg("ili9341 LCD driver: LCD modules manufacturer ID: %d\n", param); + err("ili9341 LCD driver: LCD modules manufacturer ID: %d\n", param); lcd->sendcmd(lcd, ILI9341_READ_ID2); lcd->recvparam(lcd, ¶m); - dbg("ili9341 LCD driver: LCD modules driver version ID: %d\n", param); + err("ili9341 LCD driver: LCD modules driver version ID: %d\n", param); lcd->sendcmd(lcd, ILI9341_READ_ID3); lcd->recvparam(lcd, ¶m); - dbg("ili9341 LCD driver: LCD modules driver ID: %d\n", param); + err("ili9341 LCD driver: LCD modules driver ID: %d\n", param); #endif /* Reset the lcd display to the default state */ diff --git a/configs/stm32f429i-disco/src/stm32_spi.c b/configs/stm32f429i-disco/src/stm32_spi.c index 0b6fd21307..90cd6cab82 100644 --- a/configs/stm32f429i-disco/src/stm32_spi.c +++ b/configs/stm32f429i-disco/src/stm32_spi.c @@ -66,7 +66,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -74,7 +74,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -143,7 +143,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -155,7 +155,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -167,7 +167,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -196,7 +196,7 @@ uint8_t stm32_spi4status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI5 void stm32_spi5select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #if defined(CONFIG_STM32F429I_DISCO_ILI9341) if (devid == SPIDEV_DISPLAY) diff --git a/configs/stm32f429i-disco/src/stm32_usb.c b/configs/stm32f429i-disco/src/stm32_usb.c index d9fb2412b6..428dffa81c 100644 --- a/configs/stm32f429i-disco/src/stm32_usb.c +++ b/configs/stm32f429i-disco/src/stm32_usb.c @@ -180,7 +180,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_hub_initialize(); if (ret < 0) { - udbg("ERROR: usbhost_hub_initialize failed: %d\n", ret); + uerr("ERROR: usbhost_hub_initialize failed: %d\n", ret); } #endif @@ -190,7 +190,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the mass storage class: %d\n", ret); + uerr("ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -200,7 +200,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + uerr("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif diff --git a/configs/stm32f429i-disco/src/stm32_userleds.c b/configs/stm32f429i-disco/src/stm32_userleds.c index 25856d939f..4cae147baa 100644 --- a/configs/stm32f429i-disco/src/stm32_userleds.c +++ b/configs/stm32f429i-disco/src/stm32_userleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32f4discovery/src/stm32_autoleds.c b/configs/stm32f4discovery/src/stm32_autoleds.c index e500fd9a89..ca588bdf40 100644 --- a/configs/stm32f4discovery/src/stm32_autoleds.c +++ b/configs/stm32f4discovery/src/stm32_autoleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32f4discovery/src/stm32_bh1750fvi.c b/configs/stm32f4discovery/src/stm32_bh1750fvi.c index 5455c05ea3..a1ea035402 100644 --- a/configs/stm32f4discovery/src/stm32_bh1750fvi.c +++ b/configs/stm32f4discovery/src/stm32_bh1750fvi.c @@ -80,7 +80,7 @@ int stm32_bh1750initialize(FAR const char *devpath) FAR struct i2c_master_s *i2c; int ret; - sndbg("Initializing BH1750FVI!\n"); + snerr("Initializing BH1750FVI!\n"); /* Initialize I2C */ @@ -96,7 +96,7 @@ int stm32_bh1750initialize(FAR const char *devpath) ret = bh1750fvi_register(devpath, i2c, BH1750FVI_I2C_ADDR); if (ret < 0) { - sndbg("Error registering BM180\n"); + snerr("Error registering BM180\n"); } return ret; diff --git a/configs/stm32f4discovery/src/stm32_bmp180.c b/configs/stm32f4discovery/src/stm32_bmp180.c index 5f6aa85ac4..75f0a31275 100644 --- a/configs/stm32f4discovery/src/stm32_bmp180.c +++ b/configs/stm32f4discovery/src/stm32_bmp180.c @@ -80,7 +80,7 @@ int stm32_bmp180initialize(FAR const char *devpath) FAR struct i2c_master_s *i2c; int ret; - sndbg("Initializing BMP180!\n"); + snerr("Initializing BMP180!\n"); /* Initialize I2C */ @@ -96,7 +96,7 @@ int stm32_bmp180initialize(FAR const char *devpath) ret = bmp180_register(devpath, i2c); if (ret < 0) { - sndbg("Error registering BM180\n"); + snerr("Error registering BM180\n"); } return ret; diff --git a/configs/stm32f4discovery/src/stm32_bringup.c b/configs/stm32f4discovery/src/stm32_bringup.c index fd4e793751..d958042ebd 100644 --- a/configs/stm32f4discovery/src/stm32_bringup.c +++ b/configs/stm32f4discovery/src/stm32_bringup.c @@ -120,7 +120,7 @@ int stm32_bringup(void) ret = stm32_pca9635_initialize(); if (ret < 0) { - sdbg("ERROR: stm32_pca9635_initialize failed: %d\n", ret); + serr("ERROR: stm32_pca9635_initialize failed: %d\n", ret); } #endif @@ -130,7 +130,7 @@ int stm32_bringup(void) ret = stm32_sdio_initialize(); if (ret != OK) { - fdbg("ERROR: Failed to initialize MMC/SD driver: %d\n", ret); + ferr("ERROR: Failed to initialize MMC/SD driver: %d\n", ret); return ret; } #endif @@ -143,7 +143,7 @@ int stm32_bringup(void) ret = stm32_usbhost_initialize(); if (ret != OK) { - udbg("ERROR: Failed to initialize USB host: %d\n", ret); + uerr("ERROR: Failed to initialize USB host: %d\n", ret); return ret; } #endif @@ -154,7 +154,7 @@ int stm32_bringup(void) ret = usbmonitor_start(0, NULL); if (ret != OK) { - udbg("ERROR: Failed to start USB monitor: %d\n", ret); + uerr("ERROR: Failed to start USB monitor: %d\n", ret); return ret; } #endif @@ -165,7 +165,7 @@ int stm32_bringup(void) lower = stm32_rtc_lowerhalf(); if (!lower) { - sdbg("ERROR: Failed to instantiate the RTC lower-half driver\n"); + serr("ERROR: Failed to instantiate the RTC lower-half driver\n"); return -ENOMEM; } else @@ -177,7 +177,7 @@ int stm32_bringup(void) ret = rtc_initialize(0, lower); if (ret < 0) { - sdbg("ERROR: Failed to bind/register the RTC driver: %d\n", ret); + serr("ERROR: Failed to bind/register the RTC driver: %d\n", ret); return ret; } } @@ -189,7 +189,7 @@ int stm32_bringup(void) ret = elf_initialize(); if (ret < 0) { - sdbg("ERROR: Initialization of the ELF loader failed: %d\n", ret); + serr("ERROR: Initialization of the ELF loader failed: %d\n", ret); } #endif @@ -207,7 +207,7 @@ int stm32_bringup(void) ret = mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL); if (ret < 0) { - sdbg("ERROR: Failed to mount procfs at %s: %d\n", + serr("ERROR: Failed to mount procfs at %s: %d\n", STM32_PROCFS_MOUNTPOINT, ret); } #endif diff --git a/configs/stm32f4discovery/src/stm32_ethernet.c b/configs/stm32f4discovery/src/stm32_ethernet.c index 9c3928e182..a29d538af2 100644 --- a/configs/stm32f4discovery/src/stm32_ethernet.c +++ b/configs/stm32f4discovery/src/stm32_ethernet.c @@ -79,10 +79,10 @@ */ #ifdef CONFIG_NETDEV_PHY_DEBUG -# define phydbg dbg +# define phyerr err # define phyllerr llerr #else -# define phydbg(x...) +# define phyerr(x...) # define phyllerr(x...) #endif @@ -105,7 +105,7 @@ static xcpt_t g_ethmac_handler; #ifdef HAVE_NETMONITOR static void stm32_emac0_phy_enable(bool enable) { - phydbg("enable=%d\n", enable); + phyerr("enable=%d\n", enable); if (enable && g_ethmac_handler != NULL) { /* Attach and enable GPIO interrupt (and event) on the falling edge */ @@ -138,7 +138,7 @@ void weak_function stm32_netinitialize(void) #ifdef HAVE_NETMONITOR /* Configure the PHY interrupt GPIO */ - phydbg("Configuring %08x\n", GPIO_EMAC_NINT); + phyerr("Configuring %08x\n", GPIO_EMAC_NINT); stm32_configgpio(GPIO_EMAC_NINT); #endif @@ -218,7 +218,7 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) irqstate_t flags; ninfo("%s: handler=%p\n", intf, handler); - phydbg("ETHMAC: devname=%s\n", STM32_ETHMAC_DEVNAME); + phyerr("ETHMAC: devname=%s\n", STM32_ETHMAC_DEVNAME); DEBUGASSERT(intf); @@ -227,13 +227,13 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable) if (strcmp(intf, STM32_ETHMAC_DEVNAME) == 0) { - phydbg("Select ETHMAC\n"); + phyerr("Select ETHMAC\n"); g_ethmac_handler = handler; enabler = stm32_emac0_phy_enable; } else { - ndbg("Unsupported interface: %s\n", intf); + nerr("Unsupported interface: %s\n", intf); enabler = NULL; } diff --git a/configs/stm32f4discovery/src/stm32_max31855.c b/configs/stm32f4discovery/src/stm32_max31855.c index 4422b5e7b3..378b91fe09 100644 --- a/configs/stm32f4discovery/src/stm32_max31855.c +++ b/configs/stm32f4discovery/src/stm32_max31855.c @@ -92,7 +92,7 @@ int stm32_max31855initialize(FAR const char *devpath) ret = max31855_register(devpath, spi); if (ret < 0) { - sndbg("Error registering MAX31855\n"); + snerr("Error registering MAX31855\n"); } return ret; diff --git a/configs/stm32f4discovery/src/stm32_max6675.c b/configs/stm32f4discovery/src/stm32_max6675.c index 6f356aaaf8..852abd5490 100644 --- a/configs/stm32f4discovery/src/stm32_max6675.c +++ b/configs/stm32f4discovery/src/stm32_max6675.c @@ -92,7 +92,7 @@ int stm32_max6675initialize(FAR const char *devpath) ret = max6675_register(devpath, spi); if (ret < 0) { - sndbg("Error registering MAX6675\n"); + snerr("Error registering MAX6675\n"); } return ret; diff --git a/configs/stm32f4discovery/src/stm32_pca9635.c b/configs/stm32f4discovery/src/stm32_pca9635.c index 7fcae301d1..71df097945 100644 --- a/configs/stm32f4discovery/src/stm32_pca9635.c +++ b/configs/stm32f4discovery/src/stm32_pca9635.c @@ -86,14 +86,14 @@ int stm32_pca9635_initialize(void) i2c = stm32_i2cbus_initialize(PCA9635_I2CBUS); if (!i2c) { - dbg("ERROR: Failed to initialize I2C%d\n", PCA9635_I2CBUS); + err("ERROR: Failed to initialize I2C%d\n", PCA9635_I2CBUS); return -1; } ret = pca9635pw_register("/dev/leddrv0", i2c, PCA9635_I2CADDR); if (ret < 0) { - sndbg("Failed to register PCA9635 driver: %d\n", ret); + snerr("Failed to register PCA9635 driver: %d\n", ret); return ret; } diff --git a/configs/stm32f4discovery/src/stm32_pwm.c b/configs/stm32f4discovery/src/stm32_pwm.c index b4a7eeba08..16f4bfdbba 100644 --- a/configs/stm32f4discovery/src/stm32_pwm.c +++ b/configs/stm32f4discovery/src/stm32_pwm.c @@ -117,7 +117,7 @@ int board_pwm_setup(void) pwm = stm32_pwminitialize(STM32F4DISCOVERY_PWMTIMER); if (!pwm) { - adbg("Failed to get the STM32 PWM lower half\n"); + aerr("Failed to get the STM32 PWM lower half\n"); return -ENODEV; } @@ -126,7 +126,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/stm32f4discovery/src/stm32_qencoder.c b/configs/stm32f4discovery/src/stm32_qencoder.c index 3ff1a64656..a5b2b23c65 100644 --- a/configs/stm32f4discovery/src/stm32_qencoder.c +++ b/configs/stm32f4discovery/src/stm32_qencoder.c @@ -149,7 +149,7 @@ int qe_devinit(void) ret = stm32_qeinitialize("/dev/qe0", TIMID); if (ret < 0) { - sndbg("stm32_qeinitialize failed: %d\n", ret); + snerr("stm32_qeinitialize failed: %d\n", ret); return ret; } diff --git a/configs/stm32f4discovery/src/stm32_rgbled.c b/configs/stm32f4discovery/src/stm32_rgbled.c index 8391f44558..714844e8f4 100644 --- a/configs/stm32f4discovery/src/stm32_rgbled.c +++ b/configs/stm32f4discovery/src/stm32_rgbled.c @@ -119,7 +119,7 @@ int stm32_rgbled_setup(void) ledr = stm32_pwminitialize(1); if (!ledr) { - dbg("Failed to get the STM32 PWM lower half to LEDR\n"); + err("Failed to get the STM32 PWM lower half to LEDR\n"); return -ENODEV; } @@ -138,7 +138,7 @@ int stm32_rgbled_setup(void) ledg = stm32_pwminitialize(2); if (!ledg) { - dbg("Failed to get the STM32 PWM lower half to LEDG\n"); + err("Failed to get the STM32 PWM lower half to LEDG\n"); return -ENODEV; } @@ -152,7 +152,7 @@ int stm32_rgbled_setup(void) ledb = stm32_pwminitialize(3); if (!ledb) { - dbg("Failed to get the STM32 PWM lower half to LEDB\n"); + err("Failed to get the STM32 PWM lower half to LEDB\n"); return -ENODEV; } @@ -166,7 +166,7 @@ int stm32_rgbled_setup(void) ret = rgbled_register("/dev/rgbled0", ledr, ledg, ledb); if (ret < 0) { - dbg("rgbled_register failed: %d\n", ret); + err("rgbled_register failed: %d\n", ret); return ret; } diff --git a/configs/stm32f4discovery/src/stm32_sdio.c b/configs/stm32f4discovery/src/stm32_sdio.c index 9ba6931767..79b7412c88 100644 --- a/configs/stm32f4discovery/src/stm32_sdio.c +++ b/configs/stm32f4discovery/src/stm32_sdio.c @@ -139,7 +139,7 @@ int stm32_sdio_initialize(void) g_sdio_dev = sdio_initialize(SDIO_SLOTNO); if (!g_sdio_dev) { - fdbg("Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); + ferr("Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); return -ENODEV; } @@ -150,7 +150,7 @@ int stm32_sdio_initialize(void) ret = mmcsd_slotinitialize(SDIO_MINOR, g_sdio_dev); if (ret != OK) { - fdbg("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + ferr("Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } diff --git a/configs/stm32f4discovery/src/stm32_spi.c b/configs/stm32f4discovery/src/stm32_spi.c index 809da6a947..45441059bd 100644 --- a/configs/stm32f4discovery/src/stm32_spi.c +++ b/configs/stm32f4discovery/src/stm32_spi.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -144,7 +144,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #if defined(CONFIG_LCD_UG2864AMBAG01) || defined(CONFIG_LCD_UG2864HSWEG01) || \ defined(CONFIG_LCD_SSD1351) @@ -168,7 +168,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #if defined(CONFIG_MAX31855) if (devid == SPIDEV_TEMPERATURE) @@ -193,7 +193,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/stm32f4discovery/src/stm32_ssd1289.c b/configs/stm32f4discovery/src/stm32_ssd1289.c index 90a27bd91e..7f0b1dd5ad 100644 --- a/configs/stm32f4discovery/src/stm32_ssd1289.c +++ b/configs/stm32f4discovery/src/stm32_ssd1289.c @@ -110,10 +110,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -373,7 +373,7 @@ int board_lcd_initialize(void) g_ssd1289drvr = ssd1289_lcdinitialize(&g_ssd1289); if (!g_ssd1289drvr) { - lcddbg("ERROR: ssd1289_lcdinitialize failed\n"); + lcderr("ERROR: ssd1289_lcdinitialize failed\n"); return -ENODEV; } } diff --git a/configs/stm32f4discovery/src/stm32_ssd1351.c b/configs/stm32f4discovery/src/stm32_ssd1351.c index a40f72bebc..261ee51c73 100644 --- a/configs/stm32f4discovery/src/stm32_ssd1351.c +++ b/configs/stm32f4discovery/src/stm32_ssd1351.c @@ -74,10 +74,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lcderr(format, ...) err(format, ##__VA_ARGS__) # define lcdinfo(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -114,7 +114,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) spi = stm32_spibus_initialize(1); if (spi == NULL) { - lcddbg("Failed to initialize SPI port 1\n"); + lcderr("Failed to initialize SPI port 1\n"); } else { @@ -123,7 +123,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) dev = ssd1351_initialize(spi, devno); if (dev == NULL) { - lcddbg("Failed to bind SPI port 1 to OLED %d: %d\n", devno); + lcderr("Failed to bind SPI port 1 to OLED %d: %d\n", devno); } else { diff --git a/configs/stm32f4discovery/src/stm32_ug2864ambag01.c b/configs/stm32f4discovery/src/stm32_ug2864ambag01.c index b3a82051f4..73f8f9920d 100644 --- a/configs/stm32f4discovery/src/stm32_ug2864ambag01.c +++ b/configs/stm32f4discovery/src/stm32_ug2864ambag01.c @@ -96,10 +96,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lcderr(format, ...) err(format, ##__VA_ARGS__) # define lcdinfo(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -136,7 +136,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) spi = stm32_spibus_initialize(1); if (!spi) { - lcddbg("Failed to initialize SPI port 1\n"); + lcderr("Failed to initialize SPI port 1\n"); } else { @@ -145,7 +145,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) dev = ug2864ambag01_initialize(spi, devno); if (!dev) { - lcddbg("Failed to bind SPI port 1 to OLED %d: %d\n", devno); + lcderr("Failed to bind SPI port 1 to OLED %d: %d\n", devno); } else { diff --git a/configs/stm32f4discovery/src/stm32_ug2864hsweg01.c b/configs/stm32f4discovery/src/stm32_ug2864hsweg01.c index 1366879530..42b04ce7e6 100644 --- a/configs/stm32f4discovery/src/stm32_ug2864hsweg01.c +++ b/configs/stm32f4discovery/src/stm32_ug2864hsweg01.c @@ -96,10 +96,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lcderr(format, ...) err(format, ##__VA_ARGS__) # define lcdinfo(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -136,7 +136,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) spi = stm32_spibus_initialize(1); if (!spi) { - lcddbg("Failed to initialize SPI port 1\n"); + lcderr("Failed to initialize SPI port 1\n"); } else { @@ -145,7 +145,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) dev = ssd1306_initialize(spi, devno); if (!dev) { - lcddbg("Failed to bind SPI port 1 to OLED %d: %d\n", devno); + lcderr("Failed to bind SPI port 1 to OLED %d: %d\n", devno); } else { diff --git a/configs/stm32f4discovery/src/stm32_usb.c b/configs/stm32f4discovery/src/stm32_usb.c index 16028715b2..457f9d9bf1 100644 --- a/configs/stm32f4discovery/src/stm32_usb.c +++ b/configs/stm32f4discovery/src/stm32_usb.c @@ -183,7 +183,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_hub_initialize(); if (ret < 0) { - udbg("ERROR: usbhost_hub_initialize failed: %d\n", ret); + uerr("ERROR: usbhost_hub_initialize failed: %d\n", ret); } #endif @@ -193,7 +193,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the mass storage class: %d\n", ret); + uerr("ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -203,7 +203,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - udbg("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + uerr("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif @@ -213,7 +213,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_kbdinit(); if (ret != OK) { - udbg("Failed to register the HID keyboard class\n"); + uerr("Failed to register the HID keyboard class\n"); } #endif @@ -223,7 +223,7 @@ int stm32_usbhost_initialize(void) ret = usbhost_mouse_init(); if (ret != OK) { - udbg("Failed to register the HID mouse class\n"); + uerr("Failed to register the HID mouse class\n"); } #endif diff --git a/configs/stm32f4discovery/src/stm32_userleds.c b/configs/stm32f4discovery/src/stm32_userleds.c index 2b5007e2d5..7bc9d1d6b4 100644 --- a/configs/stm32f4discovery/src/stm32_userleds.c +++ b/configs/stm32f4discovery/src/stm32_userleds.c @@ -64,10 +64,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32f746g-disco/src/stm32_autoleds.c b/configs/stm32f746g-disco/src/stm32_autoleds.c index 6873f3ad42..8f9b4c956b 100644 --- a/configs/stm32f746g-disco/src/stm32_autoleds.c +++ b/configs/stm32f746g-disco/src/stm32_autoleds.c @@ -58,10 +58,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32f746g-disco/src/stm32_spi.c b/configs/stm32f746g-disco/src/stm32_spi.c index e7ba37dfcb..f52f454ae3 100644 --- a/configs/stm32f746g-disco/src/stm32_spi.c +++ b/configs/stm32f746g-disco/src/stm32_spi.c @@ -62,7 +62,7 @@ ************************************************************************************/ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -70,7 +70,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -126,7 +126,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32F7_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -138,7 +138,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32F7_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -150,7 +150,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32F7_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -162,7 +162,7 @@ uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32F7_SPI4 void stm32_spi4select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi4status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -174,7 +174,7 @@ uint8_t stm32_spi4status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32F7_SPI5 void stm32_spi5select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi5status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/stm32f746g-disco/src/stm32_userleds.c b/configs/stm32f746g-disco/src/stm32_userleds.c index 90eae2c78a..3115c95d3a 100644 --- a/configs/stm32f746g-disco/src/stm32_userleds.c +++ b/configs/stm32f746g-disco/src/stm32_userleds.c @@ -56,10 +56,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32l476vg-disco/src/stm32_appinit.c b/configs/stm32l476vg-disco/src/stm32_appinit.c index f3ead2d0a9..fee33a2b3e 100644 --- a/configs/stm32l476vg-disco/src/stm32_appinit.c +++ b/configs/stm32l476vg-disco/src/stm32_appinit.c @@ -95,7 +95,7 @@ #ifdef CONFIG_BOARD_INITIALIZE # define SYSLOG llerr #else -# define SYSLOG dbg +# define SYSLOG err #endif /**************************************************************************** @@ -188,7 +188,7 @@ FAR struct mtd_dev_s *mtd_temp; rtclower = stm32l4_rtc_lowerhalf(); if (!rtclower) { - sdbg("ERROR: Failed to instantiate the RTC lower-half driver\n"); + serr("ERROR: Failed to instantiate the RTC lower-half driver\n"); return -ENOMEM; } else @@ -200,7 +200,7 @@ FAR struct mtd_dev_s *mtd_temp; ret = rtc_initialize(0, rtclower); if (ret < 0) { - sdbg("ERROR: Failed to bind/register the RTC driver: %d\n", ret); + serr("ERROR: Failed to bind/register the RTC driver: %d\n", ret); return ret; } } diff --git a/configs/stm32l476vg-disco/src/stm32_autoleds.c b/configs/stm32l476vg-disco/src/stm32_autoleds.c index 8e1c7fe79a..bb9201149b 100644 --- a/configs/stm32l476vg-disco/src/stm32_autoleds.c +++ b/configs/stm32l476vg-disco/src/stm32_autoleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32l476vg-disco/src/stm32_spi.c b/configs/stm32l476vg-disco/src/stm32_spi.c index b27086cac3..506bd9f1e4 100644 --- a/configs/stm32l476vg-disco/src/stm32_spi.c +++ b/configs/stm32l476vg-disco/src/stm32_spi.c @@ -67,14 +67,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -113,7 +113,7 @@ void weak_function stm32_spiinitialize(void) g_spi1 = up_spiinitialize(1); if (!g_spi1) { - spidbg("[boot] FAILED to initialize SPI port 1\n"); + spierr("[boot] FAILED to initialize SPI port 1\n"); } #ifdef CONFIG_WL_CC3000 @@ -168,7 +168,7 @@ void weak_function stm32_spiinitialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #ifdef CONFIG_WL_CC3000 if (devid == SPIDEV_WIRELESS) @@ -194,7 +194,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #ifdef CONFIG_WL_CC3000 if (devid == SPIDEV_WIRELESS) @@ -213,7 +213,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/stm32l476vg-disco/src/stm32_userleds.c b/configs/stm32l476vg-disco/src/stm32_userleds.c index 6bccba72e6..d284a836c8 100644 --- a/configs/stm32l476vg-disco/src/stm32_userleds.c +++ b/configs/stm32l476vg-disco/src/stm32_userleds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32ldiscovery/src/stm32_autoleds.c b/configs/stm32ldiscovery/src/stm32_autoleds.c index 384bb91fef..59f6920c26 100644 --- a/configs/stm32ldiscovery/src/stm32_autoleds.c +++ b/configs/stm32ldiscovery/src/stm32_autoleds.c @@ -78,10 +78,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32ldiscovery/src/stm32_lcd.c b/configs/stm32ldiscovery/src/stm32_lcd.c index cdab603a5f..24cee12b23 100644 --- a/configs/stm32ldiscovery/src/stm32_lcd.c +++ b/configs/stm32ldiscovery/src/stm32_lcd.c @@ -262,10 +262,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif diff --git a/configs/stm32ldiscovery/src/stm32_pwm.c b/configs/stm32ldiscovery/src/stm32_pwm.c index 60eeb9bfcb..8bf395e297 100644 --- a/configs/stm32ldiscovery/src/stm32_pwm.c +++ b/configs/stm32ldiscovery/src/stm32_pwm.c @@ -120,7 +120,7 @@ int board_pwm_setup(void) pwm = stm32_pwminitialize(STM32F3DISCOVERY_PWMTIMER); if (!pwm) { - dbg("Failed to get the STM32 PWM lower half\n"); + err("Failed to get the STM32 PWM lower half\n"); return -ENODEV; } @@ -129,7 +129,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/stm32ldiscovery/src/stm32_qencoder.c b/configs/stm32ldiscovery/src/stm32_qencoder.c index c1336ac6fc..ca38ecb56d 100644 --- a/configs/stm32ldiscovery/src/stm32_qencoder.c +++ b/configs/stm32ldiscovery/src/stm32_qencoder.c @@ -150,7 +150,7 @@ int qe_devinit(void) ret = stm32_qeinitialize("/dev/qe0", TIMID); if (ret < 0) { - sndbg("stm32_qeinitialize failed: %d\n", ret); + snerr("stm32_qeinitialize failed: %d\n", ret); return ret; } diff --git a/configs/stm32ldiscovery/src/stm32_spi.c b/configs/stm32ldiscovery/src/stm32_spi.c index d07d769133..3d86fcea1f 100644 --- a/configs/stm32ldiscovery/src/stm32_spi.c +++ b/configs/stm32ldiscovery/src/stm32_spi.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -130,7 +130,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); stm32_gpiowrite(GPIO_MEMS_CS, !selected); } @@ -144,7 +144,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -156,7 +156,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/stm32ldiscovery/src/stm32_userleds.c b/configs/stm32ldiscovery/src/stm32_userleds.c index 7cef39eba0..57cf3c0dd0 100644 --- a/configs/stm32ldiscovery/src/stm32_userleds.c +++ b/configs/stm32ldiscovery/src/stm32_userleds.c @@ -60,10 +60,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/stm32vldiscovery/src/stm32_leds.c b/configs/stm32vldiscovery/src/stm32_leds.c index a8ce8ec1b3..17ff81449a 100644 --- a/configs/stm32vldiscovery/src/stm32_leds.c +++ b/configs/stm32vldiscovery/src/stm32_leds.c @@ -63,10 +63,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sure-pic32mx/src/pic32mx_autoleds.c b/configs/sure-pic32mx/src/pic32mx_autoleds.c index 0a8f1b940b..4f814b371a 100644 --- a/configs/sure-pic32mx/src/pic32mx_autoleds.c +++ b/configs/sure-pic32mx/src/pic32mx_autoleds.c @@ -89,7 +89,7 @@ /* Debug ********************************************************************/ #if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_LEDS) -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else @@ -98,7 +98,7 @@ #else # undef CONFIG_DEBUG_LEDS # undef CONFIG_DEBUG_INFO -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/sure-pic32mx/src/pic32mx_lcd1602.c b/configs/sure-pic32mx/src/pic32mx_lcd1602.c index ad6eefc52a..39488c66f7 100644 --- a/configs/sure-pic32mx/src/pic32mx_lcd1602.c +++ b/configs/sure-pic32mx/src/pic32mx_lcd1602.c @@ -144,10 +144,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif diff --git a/configs/sure-pic32mx/src/pic32mx_spi.c b/configs/sure-pic32mx/src/pic32mx_spi.c index 5104cbe4ec..367d46bd10 100644 --- a/configs/sure-pic32mx/src/pic32mx_spi.c +++ b/configs/sure-pic32mx/src/pic32mx_spi.c @@ -130,14 +130,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/teensy-2.0/src/at90usb_leds.c b/configs/teensy-2.0/src/at90usb_leds.c index d3e194c401..30c62d110b 100644 --- a/configs/teensy-2.0/src/at90usb_leds.c +++ b/configs/teensy-2.0/src/at90usb_leds.c @@ -62,14 +62,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/teensy-2.0/src/at90usb_spi.c b/configs/teensy-2.0/src/at90usb_spi.c index 2d14517ab8..6a130d8bbb 100644 --- a/configs/teensy-2.0/src/at90usb_spi.c +++ b/configs/teensy-2.0/src/at90usb_spi.c @@ -87,7 +87,7 @@ */ #ifdef CONFIG_SPI_DEBUG -# define sspdbg llerr +# define ssperr llerr # ifdef CONFIG_SPI_VERBOSE # define sspinfo llerr # else @@ -95,7 +95,7 @@ # endif #else # undef CONFIG_SPI_VERBOSE -# define sspdbg(x...) +# define ssperr(x...) # define sspinfo(x...) #endif @@ -161,7 +161,7 @@ void weak_function at90usb_spidev_initialize(void) void avr_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); /* Assert/de-assert the CS pin to the card */ @@ -194,7 +194,7 @@ uint8_t avr_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) ret |= SPI_STATUS_WRPROTECTED; } - sspdbg("Returning %02x\n", ret); + ssperr("Returning %02x\n", ret); return ret; } diff --git a/configs/teensy-3.x/src/k20_pwm.c b/configs/teensy-3.x/src/k20_pwm.c index 73ec5c5414..281cea3af9 100644 --- a/configs/teensy-3.x/src/k20_pwm.c +++ b/configs/teensy-3.x/src/k20_pwm.c @@ -99,7 +99,7 @@ int board_pwm_setup(void) pwm = kinetis_pwminitialize(0); if (!pwm) { - adbg("Failed to get the KL20 PWM lower half\n"); + aerr("Failed to get the KL20 PWM lower half\n"); return -ENODEV; } @@ -108,7 +108,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } @@ -119,7 +119,7 @@ int board_pwm_setup(void) pwm = kinetis_pwminitialize(1); if (!pwm) { - adbg("Failed to get the KL20 PWM lower half\n"); + aerr("Failed to get the KL20 PWM lower half\n"); return -ENODEV; } @@ -128,7 +128,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm1", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } @@ -139,7 +139,7 @@ int board_pwm_setup(void) pwm = kinetis_pwminitialize(2); if (!pwm) { - adbg("Failed to get the KL20 PWM lower half\n"); + aerr("Failed to get the KL20 PWM lower half\n"); return -ENODEV; } @@ -148,7 +148,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm2", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/teensy-3.x/src/k20_spi.c b/configs/teensy-3.x/src/k20_spi.c index 64e9072116..73cf617965 100644 --- a/configs/teensy-3.x/src/k20_spi.c +++ b/configs/teensy-3.x/src/k20_spi.c @@ -60,7 +60,7 @@ /* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_SPI_VERBOSE # define spiinfo llerr # else @@ -68,7 +68,7 @@ # endif #else # undef CONFIG_DEBUG_SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -121,7 +121,7 @@ void weak_function kinetis_spidev_initialize(void) #ifdef CONFIG_KINETIS_SPI1 void kinetis_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); # warning "Missing logic" } @@ -135,7 +135,7 @@ uint8_t kinetis_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_KINETIS_SPI2 void kinetis_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); # warning "Missing logic" } @@ -149,7 +149,7 @@ uint8_t kinetis_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_KINETIS_SPI3 void kinetis_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); # warning "Missing logic" } diff --git a/configs/teensy-lc/src/kl_led.c b/configs/teensy-lc/src/kl_led.c index 611174f222..ac72ed4eb3 100644 --- a/configs/teensy-lc/src/kl_led.c +++ b/configs/teensy-lc/src/kl_led.c @@ -61,14 +61,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/teensy-lc/src/kl_pwm.c b/configs/teensy-lc/src/kl_pwm.c index 94c84397be..40d5e87e6d 100644 --- a/configs/teensy-lc/src/kl_pwm.c +++ b/configs/teensy-lc/src/kl_pwm.c @@ -98,7 +98,7 @@ int board_pwm_setup(void) pwm = kl_pwminitialize(0); if (!pwm) { - adbg("Failed to get the KL25 PWM lower half\n"); + aerr("Failed to get the KL25 PWM lower half\n"); return -ENODEV; } @@ -107,7 +107,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } diff --git a/configs/teensy-lc/src/kl_spi.c b/configs/teensy-lc/src/kl_spi.c index 073764252a..b8eeb57aa6 100644 --- a/configs/teensy-lc/src/kl_spi.c +++ b/configs/teensy-lc/src/kl_spi.c @@ -58,14 +58,14 @@ /* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/configs/tm4c123g-launchpad/src/tm4c_autoleds.c b/configs/tm4c123g-launchpad/src/tm4c_autoleds.c index b78c5fbcf2..367569b67f 100644 --- a/configs/tm4c123g-launchpad/src/tm4c_autoleds.c +++ b/configs/tm4c123g-launchpad/src/tm4c_autoleds.c @@ -102,10 +102,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif @@ -140,7 +140,7 @@ #ifdef CONFIG_ARCH_LEDS void tm4c_led_initialize(void) { - leddbg("Initializing\n"); + lederr("Initializing\n"); /* Configure Port E, Bit 1 as an output, initial value=OFF */ diff --git a/configs/tm4c123g-launchpad/src/tm4c_ssi.c b/configs/tm4c123g-launchpad/src/tm4c_ssi.c index ee306c0624..a884c89534 100644 --- a/configs/tm4c123g-launchpad/src/tm4c_ssi.c +++ b/configs/tm4c123g-launchpad/src/tm4c_ssi.c @@ -62,9 +62,9 @@ /* CONFIG_DEBUG_SPI enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ #ifdef CONFIG_DEBUG_SPI -# define ssidbg llerr +# define ssierr llerr #else -# define ssidbg(x...) +# define ssierr(x...) #endif /* Dump GPIO registers */ @@ -118,14 +118,14 @@ void weak_function tm4c_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssi_dumpgpio("tiva_ssiselect() Entry"); ssi_dumpgpio("tiva_ssiselect() Exit"); } uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - ssidbg("Returning SPI_STATUS_PRESENT\n"); + ssierr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } diff --git a/configs/tm4c1294-launchpad/src/tm4c_bringup.c b/configs/tm4c1294-launchpad/src/tm4c_bringup.c index a6608ff431..53bd6a965b 100644 --- a/configs/tm4c1294-launchpad/src/tm4c_bringup.c +++ b/configs/tm4c1294-launchpad/src/tm4c_bringup.c @@ -76,14 +76,14 @@ static void tm4c_i2c_register(int bus) i2c = tiva_i2cbus_initialize(bus); if (i2c == NULL) { - dbg("ERROR: Failed to get I2C%d interface\n", bus); + err("ERROR: Failed to get I2C%d interface\n", bus); } else { ret = i2c_register(i2c, bus); if (ret < 0) { - dbg("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); tiva_i2cbus_uninitialize(i2c); } } @@ -164,7 +164,7 @@ int tm4c_bringup(void) ret = tiva_timer_configure(); if (ret < 0) { - dbg("ERROR: Failed to initialize timer driver: %d\n", ret); + err("ERROR: Failed to initialize timer driver: %d\n", ret); } #endif diff --git a/configs/tm4c1294-launchpad/src/tm4c_timer.c b/configs/tm4c1294-launchpad/src/tm4c_timer.c index 39b20919cb..d3957309be 100644 --- a/configs/tm4c1294-launchpad/src/tm4c_timer.c +++ b/configs/tm4c1294-launchpad/src/tm4c_timer.c @@ -108,7 +108,7 @@ int tiva_timer_configure(void) GPTM, ALTCLK); if (ret < 0) { - timdbg("ERROR: Failed to register timer driver: %d\n", ret); + timerr("ERROR: Failed to register timer driver: %d\n", ret); } return ret; diff --git a/configs/tm4c1294-launchpad/src/tm4c_userleds.c b/configs/tm4c1294-launchpad/src/tm4c_userleds.c index 443ee91bfd..89b70ee516 100644 --- a/configs/tm4c1294-launchpad/src/tm4c_userleds.c +++ b/configs/tm4c1294-launchpad/src/tm4c_userleds.c @@ -72,10 +72,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/twr-k60n512/src/k60_leds.c b/configs/twr-k60n512/src/k60_leds.c index d7b13fa413..55e3b19b84 100644 --- a/configs/twr-k60n512/src/k60_leds.c +++ b/configs/twr-k60n512/src/k60_leds.c @@ -124,10 +124,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/twr-k60n512/src/k60_spi.c b/configs/twr-k60n512/src/k60_spi.c index 42aad3c58b..4afe34fe97 100644 --- a/configs/twr-k60n512/src/k60_spi.c +++ b/configs/twr-k60n512/src/k60_spi.c @@ -60,7 +60,7 @@ /* Enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_SPI_VERBOSE # define spiinfo llerr # else @@ -68,7 +68,7 @@ # endif #else # undef CONFIG_DEBUG_SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -121,7 +121,7 @@ void weak_function kinetis_spidev_initialize(void) #ifdef CONFIG_KINETIS_SPI1 void kinetis_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); # warning "Missing logic" } @@ -135,7 +135,7 @@ uint8_t kinetis_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_KINETIS_SPI2 void kinetis_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); # warning "Missing logic" } @@ -149,7 +149,7 @@ uint8_t kinetis_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_KINETIS_SPI3 void kinetis_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); # warning "Missing logic" } diff --git a/configs/u-blox-c027/src/lpc17_adc.c b/configs/u-blox-c027/src/lpc17_adc.c index 9d620f84c6..e9244045d3 100644 --- a/configs/u-blox-c027/src/lpc17_adc.c +++ b/configs/u-blox-c027/src/lpc17_adc.c @@ -89,7 +89,7 @@ int board_adc_setup(void) adc = lpc17_adcinitialize(); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -98,7 +98,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/u-blox-c027/src/lpc17_dac.c b/configs/u-blox-c027/src/lpc17_dac.c index 91c1585f05..f1dd0887ac 100644 --- a/configs/u-blox-c027/src/lpc17_dac.c +++ b/configs/u-blox-c027/src/lpc17_dac.c @@ -85,14 +85,14 @@ int dac_devinit(void) dac = lpc17_dacinitialize(); if (dac == NULL) { - adbg("ERROR: Failed to get dac interface\n"); + aerr("ERROR: Failed to get dac interface\n"); return -ENODEV; } ret = dac_register("/dev/dac0", dac); if (ret < 0) { - adbg("dac_register failed: %d\n", ret); + aerr("dac_register failed: %d\n", ret); return ret; } diff --git a/configs/u-blox-c027/src/lpc17_leds.c b/configs/u-blox-c027/src/lpc17_leds.c index ba72d2cc81..cf6d8655bf 100644 --- a/configs/u-blox-c027/src/lpc17_leds.c +++ b/configs/u-blox-c027/src/lpc17_leds.c @@ -61,14 +61,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/u-blox-c027/src/lpc17_pwm.c b/configs/u-blox-c027/src/lpc17_pwm.c index d5d4bb506c..93c22a8ceb 100644 --- a/configs/u-blox-c027/src/lpc17_pwm.c +++ b/configs/u-blox-c027/src/lpc17_pwm.c @@ -98,7 +98,7 @@ int board_pwm_setup(void) pwm = lpc17_pwminitialize(0); if (!pwm) { - adbg("Failed to get the LPC17XX PWM lower half\n"); + aerr("Failed to get the LPC17XX PWM lower half\n"); return -ENODEV; } @@ -107,14 +107,14 @@ int board_pwm_setup(void) ret = pwm_register("/dev/pwm0", pwm); if (ret < 0) { - adbg("pwm_register failed: %d\n", ret); + aerr("pwm_register failed: %d\n", ret); return ret; } mcpwm = lpc17_mcpwminitialize(0); if (!mcpwm) { - adbg("Failed to get the LPC17XX MOTOR PWM lower half\n"); + aerr("Failed to get the LPC17XX MOTOR PWM lower half\n"); return -ENODEV; } @@ -123,14 +123,14 @@ int board_pwm_setup(void) ret = pwm_register("/dev/mcpwm0", mcpwm); if (ret < 0) { - adbg("mcpwm_register failed: %d\n", ret); + aerr("mcpwm_register failed: %d\n", ret); return ret; } timer = lpc17_timerinitialize(0); if (!timer) { - adbg("Failed to get the LPC17XX TIMER lower half\n"); + aerr("Failed to get the LPC17XX TIMER lower half\n"); return -ENODEV; } @@ -139,7 +139,7 @@ int board_pwm_setup(void) ret = pwm_register("/dev/timer0", timer); if (ret < 0) { - adbg("timer_register failed: %d\n", ret); + aerr("timer_register failed: %d\n", ret); return ret; } diff --git a/configs/u-blox-c027/src/lpc17_ssp.c b/configs/u-blox-c027/src/lpc17_ssp.c index cbec4fc42e..722ec61f4a 100644 --- a/configs/u-blox-c027/src/lpc17_ssp.c +++ b/configs/u-blox-c027/src/lpc17_ssp.c @@ -64,7 +64,7 @@ #undef SSP_VERBOSE /* Define to enable verbose debug */ #ifdef SSP_DEBUG -# define sspdbg llerr +# define ssperr llerr # ifdef SSP_VERBOSE # define sspinfo llerr # else @@ -72,7 +72,7 @@ # endif #else # undef SSP_VERBOSE -# define sspdbg(x...) +# define ssperr(x...) # define sspinfo(x...) #endif @@ -140,7 +140,7 @@ void weak_function c027_sspdev_initialize(void) #ifdef CONFIG_LPC17_SSP0 void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_ssp0select() Entry"); #warning "Assert CS here (false)" @@ -150,7 +150,7 @@ void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspdbg("Returning SPI_STATUS_PRESENT\n"); + ssperr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } #endif @@ -158,7 +158,7 @@ uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_LPC17_SSP1 void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_ssp1select() Entry"); if (devid == SPIDEV_MMCSD) @@ -186,12 +186,12 @@ uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) if (lpc17_gpioread(C027_SD_CD) == 0) { - sspdbg("Returning SPI_STATUS_PRESENT\n"); + ssperr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } } - sspdbg("Returning zero\n"); + ssperr("Returning zero\n"); return 0; } #endif diff --git a/configs/u-blox-c027/src/lpc17_ubxmdm.c b/configs/u-blox-c027/src/lpc17_ubxmdm.c index 294593ffde..8f8e113297 100644 --- a/configs/u-blox-c027/src/lpc17_ubxmdm.c +++ b/configs/u-blox-c027/src/lpc17_ubxmdm.c @@ -62,12 +62,12 @@ /* Non-standard debug that may be enabled just for testing the modem driver */ #ifdef CONFIG_MODEM_U_BLOX_DEBUG -# define m_dbg dbg +# define m_err err # define m_info info # define m_vllerr llerr # define m_vllinfo llinfo #else -# define m_dbg(x...) +# define m_err(x...) # define m_info(x...) # define m_llerr(x...) # define m_llinfo(x...) diff --git a/configs/ubw32/src/pic32_leds.c b/configs/ubw32/src/pic32_leds.c index a99f633e53..a26fa1ceb2 100644 --- a/configs/ubw32/src/pic32_leds.c +++ b/configs/ubw32/src/pic32_leds.c @@ -98,7 +98,7 @@ /* Debug ********************************************************************/ #if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_LEDS) -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else @@ -107,7 +107,7 @@ #else # undef CONFIG_DEBUG_LEDS # undef CONFIG_DEBUG_INFO -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/us7032evb1/shterm/shterm.c b/configs/us7032evb1/shterm/shterm.c index 0913f61dcf..b9a1ff5b14 100644 --- a/configs/us7032evb1/shterm/shterm.c +++ b/configs/us7032evb1/shterm/shterm.c @@ -62,7 +62,7 @@ #define DEFAULT_BAUD 9600 -#define dbg(format, ...) if (debug > 0) printconsole(format, ##__VA_ARGS__) +#define err(format, ...) if (debug > 0) printconsole(format, ##__VA_ARGS__) #define info(format, ...) if (debug > 1) printconsole(format, ##__VA_ARGS__) /**************************************************************************** diff --git a/configs/viewtool-stm32f107/src/stm32_appinit.c b/configs/viewtool-stm32f107/src/stm32_appinit.c index 8bc77a200c..e43fcef6bf 100644 --- a/configs/viewtool-stm32f107/src/stm32_appinit.c +++ b/configs/viewtool-stm32f107/src/stm32_appinit.c @@ -95,7 +95,7 @@ static int rtc_driver_initialize(void) lower = stm32_rtc_lowerhalf(); if (lower == NULL) { - sdbg("ERROR: Failed to instantiate the RTC lower-half driver\n"); + serr("ERROR: Failed to instantiate the RTC lower-half driver\n"); ret = -ENOMEM; } else @@ -107,7 +107,7 @@ static int rtc_driver_initialize(void) ret = rtc_initialize(0, lower); if (ret < 0) { - sdbg("ERROR: Failed to bind/register the RTC driver: %d\n", ret); + serr("ERROR: Failed to bind/register the RTC driver: %d\n", ret); } } diff --git a/configs/viewtool-stm32f107/src/stm32_can.c b/configs/viewtool-stm32f107/src/stm32_can.c index c667032a9f..a4e4fd5f9f 100644 --- a/configs/viewtool-stm32f107/src/stm32_can.c +++ b/configs/viewtool-stm32f107/src/stm32_can.c @@ -65,12 +65,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -108,7 +108,7 @@ int board_can_initialize(void) can = stm32_caninitialize(CAN_PORT); if (can == NULL) { - candbg("ERROR: Failed to get CAN interface\n"); + canerr("ERROR: Failed to get CAN interface\n"); return -ENODEV; } @@ -117,7 +117,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: can_register failed: %d\n", ret); + canerr("ERROR: can_register failed: %d\n", ret); return ret; } diff --git a/configs/viewtool-stm32f107/src/stm32_leds.c b/configs/viewtool-stm32f107/src/stm32_leds.c index 5a7308d0e3..42db57f553 100644 --- a/configs/viewtool-stm32f107/src/stm32_leds.c +++ b/configs/viewtool-stm32f107/src/stm32_leds.c @@ -58,10 +58,10 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # define ledinfo llinfo #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/viewtool-stm32f107/src/stm32_mmcsd.c b/configs/viewtool-stm32f107/src/stm32_mmcsd.c index bc10a38cee..9b9aa9030f 100644 --- a/configs/viewtool-stm32f107/src/stm32_mmcsd.c +++ b/configs/viewtool-stm32f107/src/stm32_mmcsd.c @@ -100,7 +100,7 @@ int stm32_sdinitialize(int minor) sdio = sdio_initialize(STM32_MMCSDSLOTNO); if (!sdio) { - fdbg("Failed to initialize SDIO slot %d\n", STM32_MMCSDSLOTNO); + ferr("Failed to initialize SDIO slot %d\n", STM32_MMCSDSLOTNO); return -ENODEV; } @@ -111,7 +111,7 @@ int stm32_sdinitialize(int minor) ret = mmcsd_slotinitialize(minor, sdio); if (ret != OK) { - fdbg("Failed to bind SDIO slot %d to the MMC/SD driver, minor=%d\n", + ferr("Failed to bind SDIO slot %d to the MMC/SD driver, minor=%d\n", STM32_MMCSDSLOTNO, minor); } diff --git a/configs/viewtool-stm32f107/src/stm32_mpl115a.c b/configs/viewtool-stm32f107/src/stm32_mpl115a.c index 45cce7e9c5..abd27ca3d2 100644 --- a/configs/viewtool-stm32f107/src/stm32_mpl115a.c +++ b/configs/viewtool-stm32f107/src/stm32_mpl115a.c @@ -92,7 +92,7 @@ int stm32_mpl115ainitialize(FAR const char *devpath) ret = mpl115a_register(devpath, spi); if (ret < 0) { - sndbg("Error registering MPL115A\n"); + snerr("Error registering MPL115A\n"); } return ret; diff --git a/configs/viewtool-stm32f107/src/stm32_spi.c b/configs/viewtool-stm32f107/src/stm32_spi.c index 645564fda4..5acc91c134 100644 --- a/configs/viewtool-stm32f107/src/stm32_spi.c +++ b/configs/viewtool-stm32f107/src/stm32_spi.c @@ -63,7 +63,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -71,7 +71,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -141,7 +141,7 @@ void weak_function stm32_spidev_initialize(void) #ifdef CONFIG_STM32_SPI1 void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -153,7 +153,7 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI2 void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); #ifdef CONFIG_INPUT_ADS7843E /* Select/de-select the touchscreen */ @@ -174,7 +174,7 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI3 void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); } uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) diff --git a/configs/viewtool-stm32f107/src/stm32_ssd1289.c b/configs/viewtool-stm32f107/src/stm32_ssd1289.c index b3e135191d..421ed2abd9 100644 --- a/configs/viewtool-stm32f107/src/stm32_ssd1289.c +++ b/configs/viewtool-stm32f107/src/stm32_ssd1289.c @@ -104,10 +104,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -425,26 +425,26 @@ static void init_lcd_backlight(void) /* Dump timer3 registers */ - lcddbg("APB1ENR: %08x\n", getreg32(STM32_RCC_APB1ENR)); - lcddbg("CR1: %04x\n", getreg32(STM32_TIM3_CR1)); - lcddbg("CR2: %04x\n", getreg32(STM32_TIM3_CR2)); - lcddbg("SMCR: %04x\n", getreg32(STM32_TIM3_SMCR)); - lcddbg("DIER: %04x\n", getreg32(STM32_TIM3_DIER)); - lcddbg("SR: %04x\n", getreg32(STM32_TIM3_SR)); - lcddbg("EGR: %04x\n", getreg32(STM32_TIM3_EGR)); - lcddbg("CCMR1: %04x\n", getreg32(STM32_TIM3_CCMR1)); - lcddbg("CCMR2: %04x\n", getreg32(STM32_TIM3_CCMR2)); - lcddbg("CCER: %04x\n", getreg32(STM32_TIM3_CCER)); - lcddbg("CNT: %04x\n", getreg32(STM32_TIM3_CNT)); - lcddbg("PSC: %04x\n", getreg32(STM32_TIM3_PSC)); - lcddbg("ARR: %04x\n", getreg32(STM32_TIM3_ARR)); - lcddbg("CCR1: %04x\n", getreg32(STM32_TIM3_CCR1)); - lcddbg("CCR2: %04x\n", getreg32(STM32_TIM3_CCR2)); - lcddbg("CCR3: %04x\n", getreg32(STM32_TIM3_CCR3)); - lcddbg("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); - lcddbg("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); - lcddbg("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); - lcddbg("DMAR: %04x\n", getreg32(STM32_TIM3_DMAR)); + lcderr("APB1ENR: %08x\n", getreg32(STM32_RCC_APB1ENR)); + lcderr("CR1: %04x\n", getreg32(STM32_TIM3_CR1)); + lcderr("CR2: %04x\n", getreg32(STM32_TIM3_CR2)); + lcderr("SMCR: %04x\n", getreg32(STM32_TIM3_SMCR)); + lcderr("DIER: %04x\n", getreg32(STM32_TIM3_DIER)); + lcderr("SR: %04x\n", getreg32(STM32_TIM3_SR)); + lcderr("EGR: %04x\n", getreg32(STM32_TIM3_EGR)); + lcderr("CCMR1: %04x\n", getreg32(STM32_TIM3_CCMR1)); + lcderr("CCMR2: %04x\n", getreg32(STM32_TIM3_CCMR2)); + lcderr("CCER: %04x\n", getreg32(STM32_TIM3_CCER)); + lcderr("CNT: %04x\n", getreg32(STM32_TIM3_CNT)); + lcderr("PSC: %04x\n", getreg32(STM32_TIM3_PSC)); + lcderr("ARR: %04x\n", getreg32(STM32_TIM3_ARR)); + lcderr("CCR1: %04x\n", getreg32(STM32_TIM3_CCR1)); + lcderr("CCR2: %04x\n", getreg32(STM32_TIM3_CCR2)); + lcderr("CCR3: %04x\n", getreg32(STM32_TIM3_CCR3)); + lcderr("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); + lcderr("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); + lcderr("CCR4: %04x\n", getreg32(STM32_TIM3_CCR4)); + lcderr("DMAR: %04x\n", getreg32(STM32_TIM3_DMAR)); } /************************************************************************************ @@ -564,7 +564,7 @@ int board_lcd_initialize(void) g_ssd1289drvr = ssd1289_lcdinitialize(&g_ssd1289); if (!g_ssd1289drvr) { - lcddbg("ERROR: ssd1289_lcdinitialize failed\n"); + lcderr("ERROR: ssd1289_lcdinitialize failed\n"); return -ENODEV; } } diff --git a/configs/viewtool-stm32f107/src/stm32_touchscreen.c b/configs/viewtool-stm32f107/src/stm32_touchscreen.c index 85b7295427..08399b2903 100644 --- a/configs/viewtool-stm32f107/src/stm32_touchscreen.c +++ b/configs/viewtool-stm32f107/src/stm32_touchscreen.c @@ -260,7 +260,7 @@ int board_tsc_setup(int minor) static bool initialized = false; int ret; - idbg("minor %d\n", minor); + ierr("minor %d\n", minor); DEBUGASSERT(minor == 0); /* Have we already initialized? Since we never uninitialize we must prevent @@ -280,7 +280,7 @@ int board_tsc_setup(int minor) dev = stm32_spibus_initialize(TSC_DEVNUM); if (!dev) { - idbg("Failed to initialize SPI%d\n", TSC_DEVNUM); + ierr("Failed to initialize SPI%d\n", TSC_DEVNUM); return -ENODEV; } @@ -289,7 +289,7 @@ int board_tsc_setup(int minor) ret = ads7843e_register(dev, &g_tscinfo.config, CONFIG_ADS7843E_DEVMINOR); if (ret < 0) { - idbg("Failed to register touchscreen device\n"); + ierr("Failed to register touchscreen device\n"); /* up_spiuninitialize(dev); */ return -ENODEV; } diff --git a/configs/zkit-arm-1769/src/lpc17_adc.c b/configs/zkit-arm-1769/src/lpc17_adc.c index 091d859bd6..0d2bcee96f 100644 --- a/configs/zkit-arm-1769/src/lpc17_adc.c +++ b/configs/zkit-arm-1769/src/lpc17_adc.c @@ -99,7 +99,7 @@ int board_adc_setup(void) adc = lpc17_adcinitialize(); if (adc == NULL) { - adbg("ERROR: Failed to get ADC interface\n"); + aerr("ERROR: Failed to get ADC interface\n"); return -ENODEV; } @@ -108,7 +108,7 @@ int board_adc_setup(void) ret = adc_register("/dev/adc0", adc); if (ret < 0) { - adbg("adc_register failed: %d\n", ret); + aerr("adc_register failed: %d\n", ret); return ret; } diff --git a/configs/zkit-arm-1769/src/lpc17_can.c b/configs/zkit-arm-1769/src/lpc17_can.c index dc866bd640..846dcdf009 100644 --- a/configs/zkit-arm-1769/src/lpc17_can.c +++ b/configs/zkit-arm-1769/src/lpc17_can.c @@ -70,12 +70,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -114,7 +114,7 @@ int board_can_initialize(void) can = lpc17_caninitialize(CAN_PORT1); if (can == NULL) { - candbg("ERROR: Failed to get CAN1 interface\n"); + canerr("ERROR: Failed to get CAN1 interface\n"); return -ENODEV; } @@ -123,7 +123,7 @@ int board_can_initialize(void) ret = can_register("/dev/can0", can); if (ret < 0) { - candbg("ERROR: CAN1 register failed: %d\n", ret); + canerr("ERROR: CAN1 register failed: %d\n", ret); return ret; } #endif @@ -134,7 +134,7 @@ int board_can_initialize(void) can = lpc17_caninitialize(CAN_PORT2); if (can == NULL) { - candbg("ERROR: Failed to get CAN2 interface\n"); + canerr("ERROR: Failed to get CAN2 interface\n"); return -ENODEV; } @@ -143,7 +143,7 @@ int board_can_initialize(void) ret = can_register("/dev/can1", can); if (ret < 0) { - candbg("ERROR: CAN2 register failed: %d\n", ret); + canerr("ERROR: CAN2 register failed: %d\n", ret); return ret; } #endif diff --git a/configs/zkit-arm-1769/src/lpc17_dac.c b/configs/zkit-arm-1769/src/lpc17_dac.c index 3f3362cd47..71816af9a4 100644 --- a/configs/zkit-arm-1769/src/lpc17_dac.c +++ b/configs/zkit-arm-1769/src/lpc17_dac.c @@ -80,14 +80,14 @@ int dac_devinit(void) dac = lpc17_dacinitialize(); if (dac == NULL) { - adbg("ERROR: Failed to get dac interface\n"); + aerr("ERROR: Failed to get dac interface\n"); return -ENODEV; } ret = dac_register("/dev/dac0", dac); if (ret < 0) { - adbg("dac_register failed: %d\n", ret); + aerr("dac_register failed: %d\n", ret); return ret; } diff --git a/configs/zkit-arm-1769/src/lpc17_lcd.c b/configs/zkit-arm-1769/src/lpc17_lcd.c index 43e8778a6a..e020846736 100644 --- a/configs/zkit-arm-1769/src/lpc17_lcd.c +++ b/configs/zkit-arm-1769/src/lpc17_lcd.c @@ -76,7 +76,7 @@ #undef LCD_VERBOSE /* Define to enable verbose debug */ #ifdef LCD_DEBUG -# define leddbg llerr +# define lederr llerr # ifdef LCD_VERBOSE # define ledinfo llerr # else @@ -84,7 +84,7 @@ # endif #else # undef LCD_VERBOSE -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/zkit-arm-1769/src/lpc17_leds.c b/configs/zkit-arm-1769/src/lpc17_leds.c index a62b58f4d4..52683c7777 100644 --- a/configs/zkit-arm-1769/src/lpc17_leds.c +++ b/configs/zkit-arm-1769/src/lpc17_leds.c @@ -67,14 +67,14 @@ */ #ifdef CONFIG_DEBUG_LEDS -# define leddbg llerr +# define lederr llerr # ifdef CONFIG_DEBUG_INFO # define ledinfo llerr # else # define ledinfo(x...) # endif #else -# define leddbg(x...) +# define lederr(x...) # define ledinfo(x...) #endif diff --git a/configs/zkit-arm-1769/src/lpc17_spi.c b/configs/zkit-arm-1769/src/lpc17_spi.c index 45c04fb456..f7bef7c2cc 100644 --- a/configs/zkit-arm-1769/src/lpc17_spi.c +++ b/configs/zkit-arm-1769/src/lpc17_spi.c @@ -66,14 +66,14 @@ /* CONFIG_DEBUG_SPI enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -143,7 +143,7 @@ void weak_function zkit_spidev_initialize(void) void lpc17_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spierr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); spi_dumpgpio("lpc17_spiselect() Entry"); if (devid == SPIDEV_MMCSD) @@ -164,12 +164,12 @@ uint8_t lpc17_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) if (lpc17_gpioread(ZKITARM_SD_CD) == 0) { - spidbg("Returning SPI_STATUS_PRESENT\n"); + spierr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } } - spidbg("Returning zero\n"); + spierr("Returning zero\n"); return 0; } diff --git a/configs/zkit-arm-1769/src/lpc17_ssp.c b/configs/zkit-arm-1769/src/lpc17_ssp.c index 633e9107e5..16288dcce3 100644 --- a/configs/zkit-arm-1769/src/lpc17_ssp.c +++ b/configs/zkit-arm-1769/src/lpc17_ssp.c @@ -66,14 +66,14 @@ /* CONFIG_DEBUG_SPI enables debug output from this file (needs CONFIG_DEBUG_FEATURES too) */ #ifdef CONFIG_DEBUG_SPI -# define sspdbg llerr +# define ssperr llerr # ifdef CONFIG_DEBUG_INFO # define sspinfo llerr # else # define sspinfo(x...) # endif #else -# define sspdbg(x...) +# define ssperr(x...) # define sspinfo(x...) #endif @@ -146,7 +146,7 @@ void weak_function zkit_sspdev_initialize(void) #ifdef CONFIG_LPC17_SSP1 void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_ssp1select() Entry"); #warning "Assert CS here (false)" @@ -156,7 +156,7 @@ void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - sspdbg("Returning SPI_STATUS_PRESENT\n"); + ssperr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } @@ -180,7 +180,7 @@ int weak_function lpc17_ssp1cmddata(FAR struct spi_dev_s *dev, #ifdef CONFIG_LPC17_SSP0 void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { - sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + ssperr("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_ssp0select() Entry"); #ifdef CONFIG_NX_LCDDRIVER @@ -199,11 +199,11 @@ uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { if (devid == SPIDEV_DISPLAY) { - sspdbg("Returning SPI_STATUS_PRESENT\n"); + ssperr("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; } - sspdbg("Returning zero\n"); + ssperr("Returning zero\n"); return 0; } diff --git a/configs/zp214xpa/src/lpc2148_spi1.c b/configs/zp214xpa/src/lpc2148_spi1.c index b07db4d85f..2a7fdd67bb 100644 --- a/configs/zp214xpa/src/lpc2148_spi1.c +++ b/configs/zp214xpa/src/lpc2148_spi1.c @@ -90,14 +90,14 @@ /* Enables debug output from this file */ #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -247,14 +247,14 @@ static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sel /* Enable slave select (low enables) */ putreg32(bit, CS_CLR_REGISTER); - spidbg("CS asserted: %08x->%08x\n", regval, getreg32(CS_PIN_REGISTER)); + spierr("CS asserted: %08x->%08x\n", regval, getreg32(CS_PIN_REGISTER)); } else { /* Disable slave select (low enables) */ putreg32(bit, CS_SET_REGISTER); - spidbg("CS de-asserted: %08x->%08x\n", regval, getreg32(CS_PIN_REGISTER)); + spierr("CS de-asserted: %08x->%08x\n", regval, getreg32(CS_PIN_REGISTER)); /* Wait for the TX FIFO not full indication */ @@ -310,7 +310,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) divisor = (divisor + 1) & ~1; putreg8(divisor, LPC214X_SPI1_CPSR); - spidbg("Frequency %d->%d\n", frequency, LPC214X_PCLKFREQ / divisor); + spierr("Frequency %d->%d\n", frequency, LPC214X_PCLKFREQ / divisor); return LPC214X_PCLKFREQ / divisor; } @@ -331,7 +331,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) static uint8_t spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - spidbg("Return 0\n"); + spierr("Return 0\n"); return 0; } @@ -387,14 +387,14 @@ static int spi_cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd /* L: the inputs at D0 to D7 are transferred to the command registers */ putreg32(bit, CS_CLR_REGISTER); - spidbg("Command: %08x->%08x\n", regval, getreg32(CS_PIN_REGISTER)); + spierr("Command: %08x->%08x\n", regval, getreg32(CS_PIN_REGISTER)); } else { /* H: the inputs at D0 to D7 are treated as display data. */ putreg32(bit, CS_SET_REGISTER); - spidbg("Data: %08x->%08x\n", regval, getreg32(CS_PIN_REGISTER)); + spierr("Data: %08x->%08x\n", regval, getreg32(CS_PIN_REGISTER)); } return OK; @@ -436,7 +436,7 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) /* Get the value from the RX FIFO and return it */ regval = getreg16(LPC214X_SPI1_DR); - spidbg("%04x->%04x\n", wd, regval); + spierr("%04x->%04x\n", wd, regval); return regval; } @@ -466,7 +466,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size /* Loop while thre are bytes remaining to be sent */ - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords > 0) { /* While the TX FIFO is not full and there are bytes left to send */ @@ -483,7 +483,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size /* Then discard all card responses until the RX & TX FIFOs are emptied. */ - spidbg("discarding\n"); + spierr("discarding\n"); do { /* Is there anything in the RX fifo? */ @@ -537,7 +537,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw /* While there is remaining to be sent (and no synchronization error has occurred) */ - spidbg("nwords: %d\n", nwords); + spierr("nwords: %d\n", nwords); while (nwords || rxpending) { /* Fill the transmit FIFO with 0xff... @@ -635,7 +635,7 @@ FAR struct spi_dev_s *lpc214x_spibus_initialize(int port) regval32 |= getreg32(CS_DIR_REGISTER); putreg32(regval32, CS_DIR_REGISTER); - spidbg("CS Pin Config: PINSEL1: %08x PIN: %08x DIR: %08x\n", + spierr("CS Pin Config: PINSEL1: %08x PIN: %08x DIR: %08x\n", getreg32(LPC214X_PINSEL1), getreg32(CS_PIN_REGISTER), getreg32(CS_DIR_REGISTER)); diff --git a/configs/zp214xpa/src/lpc2148_ug2864ambag01.c b/configs/zp214xpa/src/lpc2148_ug2864ambag01.c index ed20003a58..24a6be8a0e 100644 --- a/configs/zp214xpa/src/lpc2148_ug2864ambag01.c +++ b/configs/zp214xpa/src/lpc2148_ug2864ambag01.c @@ -100,10 +100,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lcderr(format, ...) err(format, ##__VA_ARGS__) # define lcdinfo(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -160,7 +160,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) spi = lpc214x_spibus_initialize(1); if (!spi) { - lcddbg("Failed to initialize SPI port 1\n"); + lcderr("Failed to initialize SPI port 1\n"); } else { @@ -169,7 +169,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) dev = ug2864ambag01_initialize(spi, devno); if (!dev) { - lcddbg("Failed to bind SPI port 1 to OLED %d: %d\n", devno); + lcderr("Failed to bind SPI port 1 to OLED %d: %d\n", devno); } else { diff --git a/drivers/analog/ad5410.c b/drivers/analog/ad5410.c index 58db6a7cea..217a2c8a44 100644 --- a/drivers/analog/ad5410.c +++ b/drivers/analog/ad5410.c @@ -256,7 +256,7 @@ static int dac_send(FAR struct dac_dev_s *dev, FAR struct dac_msg_s *msg) static int dac_ioctl(FAR struct dac_dev_s *dev, int cmd, unsigned long arg) { - dbg("Fix me:Not Implemented\n"); + err("Fix me:Not Implemented\n"); return 0; } diff --git a/drivers/analog/adc.c b/drivers/analog/adc.c index d11c962384..0dac979d60 100644 --- a/drivers/analog/adc.c +++ b/drivers/analog/adc.c @@ -433,7 +433,7 @@ int adc_register(FAR const char *path, FAR struct adc_dev_s *dev) ret = dev->ad_ops->ao_bind(dev, &g_adc_callback); if (ret < 0) { - adbg("ERROR: Failed to bind callbacks: %d\n", ret); + aerr("ERROR: Failed to bind callbacks: %d\n", ret); return ret; } diff --git a/drivers/analog/ads1242.c b/drivers/analog/ads1242.c index dc942bbace..b3c72852f1 100644 --- a/drivers/analog/ads1242.c +++ b/drivers/analog/ads1242.c @@ -403,15 +403,15 @@ static void ads1242_print_regs(FAR struct ads1242_dev_s *dev, char const *msg) uint8_t mux_reg_value = 0; uint8_t acr_reg_value = 0; - dbg("%s\n", msg); + err("%s\n", msg); ads1242_read_reg(dev, ADS1242_REG_SETUP, &setup_reg_value); ads1242_read_reg(dev, ADS1242_REG_MUX, &mux_reg_value); ads1242_read_reg(dev, ADS1242_REG_ACR, &acr_reg_value); - dbg("SETUP %02X\n", setup_reg_value); - dbg("MUX %02X\n", mux_reg_value); - dbg("ACR %02X\n", acr_reg_value); + err("SETUP %02X\n", setup_reg_value); + err("MUX %02X\n", mux_reg_value); + err("ACR %02X\n", acr_reg_value); } #endif /* CONFIG_DEBUG_FEATURES && CONFIG_DEBUG_INFO */ @@ -552,7 +552,7 @@ static int ads1242_ioctl (FAR struct file *filep, int cmd, unsigned long arg) /* Command was not recognized */ default: - dbg ("Unrecognized cmd: %d\n", cmd); + err ("Unrecognized cmd: %d\n", cmd); ret = -ENOTTY; break; } @@ -596,7 +596,7 @@ int ads1242_register(FAR const char *devpath, FAR struct spi_dev_s *spi, priv = (FAR struct ads1242_dev_s *)kmm_malloc(sizeof(struct ads1242_dev_s)); if (priv == NULL) { - dbg ("Failed to allocate instance\n"); + err ("Failed to allocate instance\n"); return -ENOMEM; } @@ -610,7 +610,7 @@ int ads1242_register(FAR const char *devpath, FAR struct spi_dev_s *spi, ret = register_driver(devpath, &g_ads1242_fops, 0666, priv); if (ret < 0) { - dbg ("Failed to register driver: %d\n", ret); + err ("Failed to register driver: %d\n", ret); kmm_free(priv); } diff --git a/drivers/analog/ads1255.c b/drivers/analog/ads1255.c index adb8933b38..a70ce9795b 100644 --- a/drivers/analog/ads1255.c +++ b/drivers/analog/ads1255.c @@ -396,7 +396,7 @@ static void adc_rxint(FAR struct adc_dev_s *dev, bool enable) static int adc_ioctl(FAR struct adc_dev_s *dev, int cmd, unsigned long arg) { - dbg("Fix me:Not Implemented\n"); + err("Fix me:Not Implemented\n"); return 0; } diff --git a/drivers/analog/pga11x.c b/drivers/analog/pga11x.c index 0169459cdd..62b8d1b338 100644 --- a/drivers/analog/pga11x.c +++ b/drivers/analog/pga11x.c @@ -110,14 +110,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg dbg +# define spierr err # ifdef CONFIG_DEBUG_INFO -# define spiinfo dbg +# define spiinfo err # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/drivers/audio/audio_null.c b/drivers/audio/audio_null.c index 393eaa1399..6545d7df39 100644 --- a/drivers/audio/audio_null.c +++ b/drivers/audio/audio_null.c @@ -375,7 +375,7 @@ static int null_configure(FAR struct audio_lowerhalf_s *dev, #endif /* CONFIG_AUDIO_EXCLUDE_TONE */ default: - auddbg(" Unrecognized feature unit\n"); + auderr(" Unrecognized feature unit\n"); break; } break; @@ -443,7 +443,7 @@ static void *null_workerthread(pthread_addr_t pvarg) if (msglen < sizeof(struct audio_msg_s)) { - auddbg("ERROR: Message too small: %d\n", msglen); + auderr("ERROR: Message too small: %d\n", msglen); continue; } @@ -467,7 +467,7 @@ static void *null_workerthread(pthread_addr_t pvarg) break; default: - auddbg("ERROR: Ignoring message ID %d\n", msg.msgId); + auderr("ERROR: Ignoring message ID %d\n", msg.msgId); break; } } @@ -527,7 +527,7 @@ static int null_start(FAR struct audio_lowerhalf_s *dev) { /* Error creating message queue! */ - auddbg("ERROR: Couldn't allocate message queue\n"); + auderr("ERROR: Couldn't allocate message queue\n"); return -ENOMEM; } @@ -551,7 +551,7 @@ static int null_start(FAR struct audio_lowerhalf_s *dev) (pthread_addr_t)priv); if (ret != OK) { - auddbg("ERROR: pthread_create failed: %d\n", ret); + auderr("ERROR: pthread_create failed: %d\n", ret); } else { @@ -843,6 +843,6 @@ FAR struct audio_lowerhalf_s *audio_null_initialize(void) return &priv->dev; } - auddbg("ERROR: Failed to allocate null audio device\n"); + auderr("ERROR: Failed to allocate null audio device\n"); return NULL; } diff --git a/drivers/audio/i2schar.c b/drivers/audio/i2schar.c index 95ebbb73ae..acecda9f83 100644 --- a/drivers/audio/i2schar.c +++ b/drivers/audio/i2schar.c @@ -86,16 +86,16 @@ #endif #ifdef CONFIG_DEBUG_I2S -# define i2sdbg dbg +# define i2serr err # define i2sllerr llerr # ifdef CONFIG_DEBUG_INFO -# define i2sinfo dbg +# define i2sinfo err # define i2sllinfo llerr # else # define i2sinfo(x...) # endif #else -# define i2sdbg(x...) +# define i2serr(x...) # define i2sllerr(x...) # define i2sinfo(x...) # define i2sllinfo(x...) @@ -272,7 +272,7 @@ static ssize_t i2schar_read(FAR struct file *filep, FAR char *buffer, { ret = -errno; DEBUGASSERT(ret < 0); - i2sdbg("ERROR: sem_wait returned: %d\n", ret); + i2serr("ERROR: sem_wait returned: %d\n", ret); goto errout_with_reference; } @@ -282,7 +282,7 @@ static ssize_t i2schar_read(FAR struct file *filep, FAR char *buffer, CONFIG_AUDIO_I2SCHAR_RXTIMEOUT); if (ret < 0) { - i2sdbg("ERROR: I2S_RECEIVE returned: %d\n", ret); + i2serr("ERROR: I2S_RECEIVE returned: %d\n", ret); goto errout_with_reference; } @@ -347,7 +347,7 @@ static ssize_t i2schar_write(FAR struct file *filep, FAR const char *buffer, { ret = -errno; DEBUGASSERT(ret < 0); - i2sdbg("ERROR: sem_wait returned: %d\n", ret); + i2serr("ERROR: sem_wait returned: %d\n", ret); goto errout_with_reference; } @@ -357,7 +357,7 @@ static ssize_t i2schar_write(FAR struct file *filep, FAR const char *buffer, CONFIG_AUDIO_I2SCHAR_TXTIMEOUT); if (ret < 0) { - i2sdbg("ERROR: I2S_SEND returned: %d\n", ret); + i2serr("ERROR: I2S_SEND returned: %d\n", ret); goto errout_with_reference; } diff --git a/drivers/audio/vs1053.c b/drivers/audio/vs1053.c index 3af6418b79..e52b0c388a 100644 --- a/drivers/audio/vs1053.c +++ b/drivers/audio/vs1053.c @@ -967,7 +967,7 @@ static void vs1053_feeddata(FAR struct vs1053_struct_s *dev) /* Local stack copy of our active buffer */ apb = dev->apb; - //auddbg("Entry apb=%p, Bytes left=%d\n", apb, apb->nbytes - apb->curbyte); + //auderr("Entry apb=%p, Bytes left=%d\n", apb, apb->nbytes - apb->curbyte); /* Setup pointer to the next sample in the buffer */ @@ -1039,12 +1039,12 @@ static void vs1053_feeddata(FAR struct vs1053_struct_s *dev) { (void)SPI_SETFREQUENCY(dev->spi, dev->spi_freq); dev->hw_lower->disable(dev->hw_lower); /* Disable the DREQ interrupt */ - auddbg("HDAT1: 0x%0X HDAT0: 0x%0X\n", + auderr("HDAT1: 0x%0X HDAT0: 0x%0X\n", vs1053_readreg(dev, VS1053_SCI_HDAT1), vs1053_readreg(dev, VS1053_SCI_HDAT0)); vs1053_writereg(dev, VS1053_SCI_WRAMADDR, VS1053_END_FILL_BYTE); dev->endfillchar = vs1053_readreg(dev, VS1053_SCI_WRAM) >> 8; - auddbg("EndFillChar: 0x%0X\n", dev->endfillchar); + auderr("EndFillChar: 0x%0X\n", dev->endfillchar); reg = vs1053_readreg(dev, VS1053_SCI_MODE); vs1053_writereg(dev, VS1053_SCI_MODE, reg | VS1053_SM_RESET); @@ -1171,7 +1171,7 @@ static void vs1053_feeddata(FAR struct vs1053_struct_s *dev) dev->lower.upper(dev->lower.priv, AUDIO_CALLBACK_IOERR, NULL, ret); #endif - auddbg("I/O error!\n"); + auderr("I/O error!\n"); goto err_out; } @@ -1181,7 +1181,7 @@ static void vs1053_feeddata(FAR struct vs1053_struct_s *dev) apb = (struct ap_buffer_s *) dq_remfirst(&dev->apbq); dev->apb = apb; - //auddbg("Next Buffer = %p, bytes = %d\n", apb, apb ? apb->nbytes : 0); + //auderr("Next Buffer = %p, bytes = %d\n", apb, apb ? apb->nbytes : 0); if (apb == NULL) { sem_post(&dev->apbq_sem); @@ -1274,7 +1274,7 @@ static void *vs1053_workerthread(pthread_addr_t pvarg) #endif uint8_t timeout; - auddbg("Entry\n"); + auderr("Entry\n"); #ifndef CONFIG_AUDIO_EXCLUDE_STOP dev->cancelmode = false; @@ -1404,7 +1404,7 @@ static void *vs1053_workerthread(pthread_addr_t pvarg) dev->lower.upper(dev->lower.priv, AUDIO_CALLBACK_COMPLETE, NULL, OK); #endif - auddbg("Exit\n"); + auderr("Exit\n"); return NULL; } @@ -1430,10 +1430,10 @@ static int vs1053_start(FAR struct audio_lowerhalf_s *lower) int ret; void *value; - auddbg("Entry\n"); + auderr("Entry\n"); vs1053_spi_lock(dev->spi, dev->spi_freq); /* Lock the device */ - auddbg("Entry HDAT1=0x%0X HDAT0=0x%0X\n", + auderr("Entry HDAT1=0x%0X HDAT0=0x%0X\n", vs1053_readreg(dev, VS1053_SCI_HDAT1), vs1053_readreg(dev, VS1053_SCI_HDAT0)); vs1053_spi_unlock(dev->spi); @@ -1446,7 +1446,7 @@ static int vs1053_start(FAR struct audio_lowerhalf_s *lower) vs1053_spi_lock(dev->spi, dev->spi_freq); /* Lock the device */ vs1053_setfrequency(dev, CONFIG_VS1053_MP3_DECODE_FREQ); - auddbg("Reset HDAT1=0x%0X HDAT0=0x%0X\n", + auderr("Reset HDAT1=0x%0X HDAT0=0x%0X\n", vs1053_readreg(dev, VS1053_SCI_HDAT1), vs1053_readreg(dev, VS1053_SCI_HDAT0)); vs1053_spi_unlock(dev->spi); @@ -1463,7 +1463,7 @@ static int vs1053_start(FAR struct audio_lowerhalf_s *lower) { /* Error creating message queue! */ - auddbg("Couldn't allocate message queue\n"); + auderr("Couldn't allocate message queue\n"); return -ENOMEM; } @@ -1477,7 +1477,7 @@ static int vs1053_start(FAR struct audio_lowerhalf_s *lower) } else { - auddbg("Error getting APB Queue sem\n"); + auderr("Error getting APB Queue sem\n"); return ret; } @@ -1485,7 +1485,7 @@ static int vs1053_start(FAR struct audio_lowerhalf_s *lower) if (dev->threadid != 0) { - auddbg("Joining old thread\n"); + auderr("Joining old thread\n"); pthread_join(dev->threadid, &value); } @@ -1496,17 +1496,17 @@ static int vs1053_start(FAR struct audio_lowerhalf_s *lower) (void)pthread_attr_setschedparam(&tattr, &sparam); (void)pthread_attr_setstacksize(&tattr, CONFIG_VS1053_WORKER_STACKSIZE); - auddbg("Starting workerthread\n"); + auderr("Starting workerthread\n"); ret = pthread_create(&dev->threadid, &tattr, vs1053_workerthread, (pthread_addr_t) dev); if (ret != OK) { - auddbg("Can't create worker thread, errno=%d\n", errno); + auderr("Can't create worker thread, errno=%d\n", errno); } else { pthread_setname_np(dev->threadid, "vs1053"); - auddbg("Created worker thread\n"); + auderr("Created worker thread\n"); } return ret; @@ -1896,13 +1896,13 @@ struct audio_lowerhalf_s *vs1053_initialize(FAR struct spi_dev_s *spi, id = (status & VS1053_SS_VER) >> VS1053_VER_SHIFT; if (id != VS1053_VER_VS1053) { - auddbg("Unexpected VER bits: 0x%0X\n", id); + auderr("Unexpected VER bits: 0x%0X\n", id); kmm_free(dev); return NULL; } else { - auddbg("VS1053 Detected!\n"); + auderr("VS1053 Detected!\n"); } /* Attach our ISR to this device */ diff --git a/drivers/audio/wm8904.c b/drivers/audio/wm8904.c index dcbce3c506..33779d5eb7 100644 --- a/drivers/audio/wm8904.c +++ b/drivers/audio/wm8904.c @@ -283,16 +283,16 @@ uint16_t wm8904_readreg(FAR struct wm8904_dev_s *priv, uint8_t regaddr) #ifdef CONFIG_I2C_RESET /* Perhaps the I2C bus is locked up? Try to shake the bus free */ - auddbg("WARNING: I2C_TRANSFER failed: %d ... Resetting\n", ret); + auderr("WARNING: I2C_TRANSFER failed: %d ... Resetting\n", ret); ret = I2C_RESET(priv->i2c); if (ret < 0) { - auddbg("ERROR: I2C_RESET failed: %d\n", ret); + auderr("ERROR: I2C_RESET failed: %d\n", ret); break; } #else - auddbg("ERROR: I2C_TRANSFER failed: %d\n", ret); + auderr("ERROR: I2C_TRANSFER failed: %d\n", ret); #endif } else @@ -359,16 +359,16 @@ static void wm8904_writereg(FAR struct wm8904_dev_s *priv, uint8_t regaddr, #ifdef CONFIG_I2C_RESET /* Perhaps the I2C bus is locked up? Try to shake the bus free */ - auddbg("WARNING: i2c_write failed: %d ... Resetting\n", ret); + auderr("WARNING: i2c_write failed: %d ... Resetting\n", ret); ret = I2C_RESET(priv->i2c); if (ret < 0) { - auddbg("ERROR: I2C_RESET failed: %d\n", ret); + auderr("ERROR: I2C_RESET failed: %d\n", ret); break; } #else - auddbg("ERROR: I2C_TRANSFER failed: %d\n", ret); + auderr("ERROR: I2C_TRANSFER failed: %d\n", ret); #endif } else @@ -1207,7 +1207,7 @@ static int wm8904_configure(FAR struct audio_lowerhalf_s *dev, #endif /* CONFIG_AUDIO_EXCLUDE_TONE */ default: - auddbg(" Unrecognized feature unit\n"); + auderr(" Unrecognized feature unit\n"); ret = -ENOTTY; break; } @@ -1225,14 +1225,14 @@ static int wm8904_configure(FAR struct audio_lowerhalf_s *dev, ret = -ERANGE; if (caps->ac_channels != 1 && caps->ac_channels != 2) { - auddbg("ERROR: Unsupported number of channels: %d\n", + auderr("ERROR: Unsupported number of channels: %d\n", caps->ac_channels); break; } if (caps->ac_controls.b[2] != 8 && caps->ac_controls.b[2] != 16) { - auddbg("ERROR: Unsupported bits per sample: %d\n", + auderr("ERROR: Unsupported bits per sample: %d\n", caps->ac_controls.b[2]); break; } @@ -1496,7 +1496,7 @@ static int wm8904_sendbuffer(FAR struct wm8904_dev_s *priv) ret = I2S_SEND(priv->i2s, apb, wm8904_senddone, priv, timeout); if (ret < 0) { - auddbg("ERROR: I2S_SEND failed: %d\n", ret); + auderr("ERROR: I2S_SEND failed: %d\n", ret); break; } } @@ -1545,7 +1545,7 @@ static int wm8904_start(FAR struct audio_lowerhalf_s *dev) { /* Error creating message queue! */ - auddbg("ERROR: Couldn't allocate message queue\n"); + auderr("ERROR: Couldn't allocate message queue\n"); return -ENOMEM; } @@ -1569,7 +1569,7 @@ static int wm8904_start(FAR struct audio_lowerhalf_s *dev) (pthread_addr_t)priv); if (ret != OK) { - auddbg("ERROR: pthread_create failed: %d\n", ret); + auderr("ERROR: pthread_create failed: %d\n", ret); } else { @@ -1726,7 +1726,7 @@ static int wm8904_enqueuebuffer(FAR struct audio_lowerhalf_s *dev, int errcode = errno; DEBUGASSERT(errcode > 0); - auddbg("ERROR: mq_send failed: %d\n", errcode); + auderr("ERROR: mq_send failed: %d\n", errcode); UNUSED(errcode); } } @@ -2042,7 +2042,7 @@ static void *wm8904_workerthread(pthread_addr_t pvarg) if (msglen < sizeof(struct audio_msg_s)) { - auddbg("ERROR: Message too small: %d\n", msglen); + auderr("ERROR: Message too small: %d\n", msglen); continue; } @@ -2085,7 +2085,7 @@ static void *wm8904_workerthread(pthread_addr_t pvarg) break; default: - auddbg("ERROR: Ignoring message ID %d\n", msg.msgId); + auderr("ERROR: Ignoring message ID %d\n", msg.msgId); break; } } @@ -2506,7 +2506,7 @@ FAR struct audio_lowerhalf_s * regval = wm8904_readreg(priv, WM8904_ID); if (regval != WM8904_SW_RST_DEV_ID1) { - auddbg("ERROR: WM8904 not found: ID=%04x\n", regval); + auderr("ERROR: WM8904 not found: ID=%04x\n", regval); goto errout_with_dev; } diff --git a/drivers/bch/bchdev_register.c b/drivers/bch/bchdev_register.c index 139c292576..c92d744e84 100644 --- a/drivers/bch/bchdev_register.c +++ b/drivers/bch/bchdev_register.c @@ -86,7 +86,7 @@ int bchdev_register(FAR const char *blkdev, FAR const char *chardev, ret = bchlib_setup(blkdev, readonly, &handle); if (ret < 0) { - fdbg("bchlib_setup failed: %d\n", -ret); + ferr("bchlib_setup failed: %d\n", -ret); return ret; } @@ -95,7 +95,7 @@ int bchdev_register(FAR const char *blkdev, FAR const char *chardev, ret = register_driver(chardev, &bch_fops, 0666, handle); if (ret < 0) { - fdbg("register_driver failed: %d\n", -ret); + ferr("register_driver failed: %d\n", -ret); bchlib_teardown(handle); handle = NULL; } diff --git a/drivers/bch/bchdev_unregister.c b/drivers/bch/bchdev_unregister.c index ae6ecb1dd0..3867a62974 100644 --- a/drivers/bch/bchdev_unregister.c +++ b/drivers/bch/bchdev_unregister.c @@ -103,7 +103,7 @@ int bchdev_unregister(FAR const char *chardev) fd = open(chardev, O_RDONLY); if (fd < 0) { - dbg("Failed to open %s: %d\n", chardev, errno); + err("Failed to open %s: %d\n", chardev, errno); return -errno; } @@ -116,7 +116,7 @@ int bchdev_unregister(FAR const char *chardev) if (ret < 0) { - dbg("ioctl failed: %d\n", errno); + err("ioctl failed: %d\n", errno); return -errno; } diff --git a/drivers/bch/bchlib_cache.c b/drivers/bch/bchlib_cache.c index 8ad543b4b0..aa54fb3213 100644 --- a/drivers/bch/bchlib_cache.c +++ b/drivers/bch/bchlib_cache.c @@ -156,7 +156,7 @@ int bchlib_flushsector(FAR struct bchlib_s *bch) ret = inode->u.i_bops->write(inode, bch->buffer, bch->sector, 1); if (ret < 0) { - fdbg("Write failed: %d\n"); + ferr("Write failed: %d\n"); } #if defined(CONFIG_BCH_ENCRYPTION) @@ -201,7 +201,7 @@ int bchlib_readsector(FAR struct bchlib_s *bch, size_t sector) ret = inode->u.i_bops->read(inode, bch->buffer, sector, 1); if (ret < 0) { - fdbg("Read failed: %d\n"); + ferr("Read failed: %d\n"); } bch->sector = sector; #if defined(CONFIG_BCH_ENCRYPTION) diff --git a/drivers/bch/bchlib_read.c b/drivers/bch/bchlib_read.c index d534d84919..0978af9963 100644 --- a/drivers/bch/bchlib_read.c +++ b/drivers/bch/bchlib_read.c @@ -160,7 +160,7 @@ ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset, size_t le sector, nsectors); if (ret < 0) { - fdbg("Read failed: %d\n"); + ferr("Read failed: %d\n"); return ret; } diff --git a/drivers/bch/bchlib_setup.c b/drivers/bch/bchlib_setup.c index 6ec7a878a6..e2924c1743 100644 --- a/drivers/bch/bchlib_setup.c +++ b/drivers/bch/bchlib_setup.c @@ -96,7 +96,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle) bch = (FAR struct bchlib_s *)kmm_zalloc(sizeof(struct bchlib_s)); if (!bch) { - fdbg("Failed to allocate BCH structure\n"); + ferr("Failed to allocate BCH structure\n"); return -ENOMEM; } @@ -105,7 +105,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle) ret = open_blockdriver(blkdev, readonly ? MS_RDONLY : 0, &bch->inode); if (ret < 0) { - fdbg("Failed to open driver %s: %d\n", blkdev, -ret); + ferr("Failed to open driver %s: %d\n", blkdev, -ret); goto errout_with_bch; } @@ -114,20 +114,20 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle) ret = bch->inode->u.i_bops->geometry(bch->inode, &geo); if (ret < 0) { - fdbg("geometry failed: %d\n", -ret); + ferr("geometry failed: %d\n", -ret); goto errout_with_bch; } if (!geo.geo_available) { - fdbg("geometry failed: %d\n", -ret); + ferr("geometry failed: %d\n", -ret); ret = -ENODEV; goto errout_with_bch; } if (!readonly && (!bch->inode->u.i_bops->write || !geo.geo_writeenabled)) { - fdbg("write access not supported\n"); + ferr("write access not supported\n"); ret = -EACCES; goto errout_with_bch; } @@ -145,7 +145,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle) bch->buffer = (FAR uint8_t *)kmm_malloc(bch->sectsize); if (!bch->buffer) { - fdbg("Failed to allocate sector buffer\n"); + ferr("Failed to allocate sector buffer\n"); ret = -ENOMEM; goto errout_with_bch; } diff --git a/drivers/bch/bchlib_write.c b/drivers/bch/bchlib_write.c index b1636c6d45..06d3f39dc7 100644 --- a/drivers/bch/bchlib_write.c +++ b/drivers/bch/bchlib_write.c @@ -162,7 +162,7 @@ ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t offset, si sector, nsectors); if (ret < 0) { - fdbg("Write failed: %d\n", ret); + ferr("Write failed: %d\n", ret); return ret; } @@ -204,7 +204,7 @@ ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t offset, si ret = bchlib_flushsector(bch); if (ret < 0) { - fdbg("Flush failed: %d\n", ret); + ferr("Flush failed: %d\n", ret); return ret; } diff --git a/drivers/can.c b/drivers/can.c index fcdd4e2425..17fb75a401 100644 --- a/drivers/can.c +++ b/drivers/can.c @@ -100,12 +100,12 @@ /* Non-standard debug that may be enabled just for testing CAN */ #ifdef CONFIG_DEBUG_CAN -# define candbg dbg +# define canerr err # define caninfo info # define canllerr llerr # define canllinfo llinfo #else -# define candbg(x...) +# define canerr(x...) # define caninfo(x...) # define canllerr(x...) # define canllinfo(x...) @@ -702,7 +702,7 @@ static int can_xmit(FAR struct can_dev_s *dev) ret = dev_send(dev, &dev->cd_xmit.tx_buffer[tmpndx]); if (ret != OK) { - candbg("dev_send failed: %d\n", ret); + canerr("dev_send failed: %d\n", ret); break; } } diff --git a/drivers/i2c/i2c_driver.c b/drivers/i2c/i2c_driver.c index 817e6058e9..83b8aa37e3 100644 --- a/drivers/i2c/i2c_driver.c +++ b/drivers/i2c/i2c_driver.c @@ -66,10 +66,10 @@ /* CONFIG_DEBUG_I2C + CONFIG_DEBUG_FEATURES enables general I2C debug output. */ #ifdef CONFIG_DEBUG_I2C -# define i2cdbg dbg +# define i2cerr err # define i2cinfo info #else -# define i2cdbg(x...) +# define i2cerr(x...) # define i2cinfo(x...) #endif diff --git a/drivers/input/ads7843e.c b/drivers/input/ads7843e.c index 4626217afb..df0e24e584 100644 --- a/drivers/input/ads7843e.c +++ b/drivers/input/ads7843e.c @@ -427,7 +427,7 @@ static int ads7843e_waitsample(FAR struct ads7843e_dev_s *priv, * the failure now. */ - idbg("sem_wait: %d\n", errno); + ierr("sem_wait: %d\n", errno); DEBUGASSERT(errno == EINTR); ret = -EINTR; goto errout; @@ -870,7 +870,7 @@ static ssize_t ads7843e_read(FAR struct file *filep, FAR char *buffer, size_t le * handle smaller reads... but why? */ - idbg("Unsupported read size: %d\n", len); + ierr("Unsupported read size: %d\n", len); return -ENOSYS; } @@ -881,7 +881,7 @@ static ssize_t ads7843e_read(FAR struct file *filep, FAR char *buffer, size_t le { /* This should only happen if the wait was cancelled by an signal */ - idbg("sem_wait: %d\n", errno); + ierr("sem_wait: %d\n", errno); DEBUGASSERT(errno == EINTR); return -EINTR; } @@ -910,7 +910,7 @@ static ssize_t ads7843e_read(FAR struct file *filep, FAR char *buffer, size_t le { /* We might have been awakened by a signal */ - idbg("ads7843e_waitsample: %d\n", ret); + ierr("ads7843e_waitsample: %d\n", ret); goto errout; } } @@ -1170,7 +1170,7 @@ int ads7843e_register(FAR struct spi_dev_s *spi, priv = (FAR struct ads7843e_dev_s *)kmm_malloc(sizeof(struct ads7843e_dev_s)); if (!priv) { - idbg("kmm_malloc(%d) failed\n", sizeof(struct ads7843e_dev_s)); + ierr("kmm_malloc(%d) failed\n", sizeof(struct ads7843e_dev_s)); return -ENOMEM; } #endif @@ -1197,11 +1197,11 @@ int ads7843e_register(FAR struct spi_dev_s *spi, ret = config->attach(config, ads7843e_interrupt); if (ret < 0) { - idbg("Failed to attach interrupt\n"); + ierr("Failed to attach interrupt\n"); goto errout_with_priv; } - idbg("Mode: %d Bits: 8 Frequency: %d\n", + ierr("Mode: %d Bits: 8 Frequency: %d\n", CONFIG_ADS7843E_SPIMODE, CONFIG_ADS7843E_FREQUENCY); /* Lock the SPI bus so that we have exclusive access */ @@ -1224,7 +1224,7 @@ int ads7843e_register(FAR struct spi_dev_s *spi, ret = register_driver(devname, &ads7843e_fops, 0666, priv); if (ret < 0) { - idbg("register_driver() failed: %d\n", ret); + ierr("register_driver() failed: %d\n", ret); goto errout_with_priv; } @@ -1246,7 +1246,7 @@ int ads7843e_register(FAR struct spi_dev_s *spi, ret = work_queue(HPWORK, &priv->work, ads7843e_worker, priv, 0); if (ret != 0) { - idbg("Failed to queue work: %d\n", ret); + ierr("Failed to queue work: %d\n", ret); goto errout_with_priv; } diff --git a/drivers/input/max11802.c b/drivers/input/max11802.c index 97c9a6cc3f..2d579cefed 100644 --- a/drivers/input/max11802.c +++ b/drivers/input/max11802.c @@ -392,7 +392,7 @@ static int max11802_waitsample(FAR struct max11802_dev_s *priv, * the failure now. */ - idbg("sem_wait: %d\n", errno); + ierr("sem_wait: %d\n", errno); DEBUGASSERT(errno == EINTR); ret = -EINTR; goto errout; @@ -877,7 +877,7 @@ static ssize_t max11802_read(FAR struct file *filep, FAR char *buffer, * handle smaller reads... but why? */ - idbg("Unsupported read size: %d\n", len); + ierr("Unsupported read size: %d\n", len); return -ENOSYS; } @@ -888,7 +888,7 @@ static ssize_t max11802_read(FAR struct file *filep, FAR char *buffer, { /* This should only happen if the wait was cancelled by an signal */ - idbg("sem_wait: %d\n", errno); + ierr("sem_wait: %d\n", errno); DEBUGASSERT(errno == EINTR); return -EINTR; } @@ -917,7 +917,7 @@ static ssize_t max11802_read(FAR struct file *filep, FAR char *buffer, { /* We might have been awakened by a signal */ - idbg("max11802_waitsample: %d\n", ret); + ierr("max11802_waitsample: %d\n", ret); goto errout; } } @@ -1173,7 +1173,7 @@ int max11802_register(FAR struct spi_dev_s *spi, priv = (FAR struct max11802_dev_s *)kmm_malloc(sizeof(struct max11802_dev_s)); if (!priv) { - idbg("kmm_malloc(%d) failed\n", sizeof(struct max11802_dev_s)); + ierr("kmm_malloc(%d) failed\n", sizeof(struct max11802_dev_s)); return -ENOMEM; } #endif @@ -1200,11 +1200,11 @@ int max11802_register(FAR struct spi_dev_s *spi, ret = config->attach(config, max11802_interrupt); if (ret < 0) { - idbg("Failed to attach interrupt\n"); + ierr("Failed to attach interrupt\n"); goto errout_with_priv; } - idbg("Mode: %d Bits: 8 Frequency: %d\n", + ierr("Mode: %d Bits: 8 Frequency: %d\n", CONFIG_MAX11802_SPIMODE, CONFIG_MAX11802_FREQUENCY); /* Lock the SPI bus so that we have exclusive access */ @@ -1246,7 +1246,7 @@ int max11802_register(FAR struct spi_dev_s *spi, if (ret != MAX11802_MODE) { - idbg("max11802 mode readback failed: %02x\n", ret); + ierr("max11802 mode readback failed: %02x\n", ret); goto errout_with_priv; } @@ -1258,7 +1258,7 @@ int max11802_register(FAR struct spi_dev_s *spi, ret = register_driver(devname, &max11802_fops, 0666, priv); if (ret < 0) { - idbg("register_driver() failed: %d\n", ret); + ierr("register_driver() failed: %d\n", ret); goto errout_with_priv; } @@ -1281,7 +1281,7 @@ int max11802_register(FAR struct spi_dev_s *spi, ret = work_queue(HPWORK, &priv->work, max11802_worker, priv, 0); if (ret != 0) { - idbg("Failed to queue work: %d\n", ret); + ierr("Failed to queue work: %d\n", ret); goto errout_with_priv; } diff --git a/drivers/input/mxt.c b/drivers/input/mxt.c index 6f09edade1..7801b72b5b 100644 --- a/drivers/input/mxt.c +++ b/drivers/input/mxt.c @@ -343,16 +343,16 @@ static int mxt_getreg(FAR struct mxt_dev_s *priv, uint16_t regaddr, #ifdef CONFIG_I2C_RESET /* Perhaps the I2C bus is locked up? Try to shake the bus free */ - idbg("WARNING: I2C_TRANSFER failed: %d ... Resetting\n", ret); + ierr("WARNING: I2C_TRANSFER failed: %d ... Resetting\n", ret); ret = I2C_RESET(priv->i2c); if (ret < 0) { - idbg("ERROR: I2C_RESET failed: %d\n", ret); + ierr("ERROR: I2C_RESET failed: %d\n", ret); break; } #else - idbg("ERROR: I2C_TRANSFER failed: %d\n", ret); + ierr("ERROR: I2C_TRANSFER failed: %d\n", ret); #endif } else @@ -417,15 +417,15 @@ static int mxt_putreg(FAR struct mxt_dev_s *priv, uint16_t regaddr, #ifdef CONFIG_I2C_RESET /* Perhaps the I2C bus is locked up? Try to shake the bus free */ - idbg("WARNING: I2C_TRANSFER failed: %d ... Resetting\n", ret); + ierr("WARNING: I2C_TRANSFER failed: %d ... Resetting\n", ret); ret = I2C_RESET(priv->i2c); if (ret < 0) { - idbg("ERROR: I2C_RESET failed: %d\n", ret); + ierr("ERROR: I2C_RESET failed: %d\n", ret); } #else - idbg("ERROR: I2C_TRANSFER failed: %d\n", ret); + ierr("ERROR: I2C_TRANSFER failed: %d\n", ret); #endif } else @@ -466,7 +466,7 @@ static FAR struct mxt_object_s *mxt_object(FAR struct mxt_dev_s *priv, } } - idbg("ERROR: Invalid object type: %d\n", type); + ierr("ERROR: Invalid object type: %d\n", type); return NULL; } @@ -483,7 +483,7 @@ static int mxt_getmessage(FAR struct mxt_dev_s *priv, object = mxt_object(priv, MXT_GEN_MESSAGE_T5); if (object == NULL) { - idbg("ERROR: mxt_object failed\n"); + ierr("ERROR: mxt_object failed\n"); return -EINVAL; } @@ -558,7 +558,7 @@ static int mxt_flushmsgs(FAR struct mxt_dev_s *priv) ret = mxt_getmessage(priv, &msg); if (ret < 0) { - idbg("ERROR: mxt_getmessage failed: %d\n", ret); + ierr("ERROR: mxt_getmessage failed: %d\n", ret); return ret; } } @@ -568,7 +568,7 @@ static int mxt_flushmsgs(FAR struct mxt_dev_s *priv) if (retries <= 0) { - idbg("ERROR: Failed to clear messages: ID=%02x\n", msg.id); + ierr("ERROR: Failed to clear messages: ID=%02x\n", msg.id); return -EBUSY; } @@ -998,7 +998,7 @@ static void mxt_worker(FAR void *arg) ret = mxt_getmessage(priv, &msg); if (ret < 0) { - idbg("ERROR: mxt_getmessage failed: %d\n", ret); + ierr("ERROR: mxt_getmessage failed: %d\n", ret); goto errout_with_semaphore; } @@ -1141,7 +1141,7 @@ static int mxt_open(FAR struct file *filep) { /* More than 255 opens; uint8_t overflows to zero */ - idbg("ERROR: Too many opens: %d\n", priv->crefs); + ierr("ERROR: Too many opens: %d\n", priv->crefs); ret = -EMFILE; goto errout_with_sem; } @@ -1157,7 +1157,7 @@ static int mxt_open(FAR struct file *filep) ret = mxt_putobject(priv, MXT_TOUCH_MULTI_T9, MXT_TOUCH_CTRL, 0x83); if (ret < 0) { - idbg("ERROR: Failed to enable touch: %d\n", ret); + ierr("ERROR: Failed to enable touch: %d\n", ret); goto errout_with_sem; } @@ -1169,7 +1169,7 @@ static int mxt_open(FAR struct file *filep) ret = mxt_flushmsgs(priv); if (ret < 0) { - idbg("ERROR: mxt_flushmsgs failed: %d\n", ret); + ierr("ERROR: mxt_flushmsgs failed: %d\n", ret); mxt_putobject(priv, MXT_TOUCH_MULTI_T9, MXT_TOUCH_CTRL, 0); goto errout_with_sem; } @@ -1233,7 +1233,7 @@ static int mxt_close(FAR struct file *filep) ret = mxt_putobject(priv, MXT_TOUCH_MULTI_T9, MXT_TOUCH_CTRL, 0); if (ret < 0) { - idbg("ERROR: Failed to disable touch: %d\n", ret); + ierr("ERROR: Failed to disable touch: %d\n", ret); } } } @@ -1575,7 +1575,7 @@ static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds, if ((fds->events & POLLIN) == 0) { - idbg("Missing POLLIN: revents: %08x\n", fds->revents); + ierr("Missing POLLIN: revents: %08x\n", fds->revents); ret = -EDEADLK; goto errout; } @@ -1600,7 +1600,7 @@ static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds, if (i >= CONFIG_MXT_NPOLLWAITERS) { - idbg("No availabled slot found: %d\n", i); + ierr("No availabled slot found: %d\n", i); fds->priv = NULL; ret = -EBUSY; goto errout; @@ -1646,7 +1646,7 @@ static int mxt_getinfo(struct mxt_dev_s *priv) sizeof(struct mxt_info_s)); if (ret < 0) { - idbg("ERROR: mxt_getreg failed: %d\n", ret); + ierr("ERROR: mxt_getreg failed: %d\n", ret); return ret; } @@ -1674,7 +1674,7 @@ static int mxt_getobjtab(FAR struct mxt_dev_s *priv) tabsize); if (ret < 0) { - idbg("ERROR: Failed to object table size: %d\n", ret); + ierr("ERROR: Failed to object table size: %d\n", ret); return ret; } @@ -1747,7 +1747,7 @@ static int mxt_hwinitialize(FAR struct mxt_dev_s *priv) ret = mxt_getinfo(priv); if (ret < 0) { - idbg("ERROR: Failed to read info registers: %d\n", ret); + ierr("ERROR: Failed to read info registers: %d\n", ret); return ret; } @@ -1756,7 +1756,7 @@ static int mxt_hwinitialize(FAR struct mxt_dev_s *priv) priv->objtab = kmm_zalloc(info->nobjects * sizeof(struct mxt_object_s)); if (priv->objtab == NULL) { - idbg("ERROR: Failed to allocate object table\n"); + ierr("ERROR: Failed to allocate object table\n"); return -ENOMEM; } @@ -1773,7 +1773,7 @@ static int mxt_hwinitialize(FAR struct mxt_dev_s *priv) ret = mxt_putobject(priv, MXT_GEN_COMMAND_T6, MXT_COMMAND_RESET, 1); if (ret < 0) { - idbg("ERROR: Soft reset failed: %d\n", ret); + ierr("ERROR: Soft reset failed: %d\n", ret); goto errout_with_objtab; } @@ -1784,7 +1784,7 @@ static int mxt_hwinitialize(FAR struct mxt_dev_s *priv) ret = mxt_getreg(priv, MXT_MATRIX_X_SIZE, (FAR uint8_t *)®val, 1); if (ret < 0) { - idbg("ERROR: Failed to get X size: %d\n", ret); + ierr("ERROR: Failed to get X size: %d\n", ret); goto errout_with_objtab; } @@ -1793,7 +1793,7 @@ static int mxt_hwinitialize(FAR struct mxt_dev_s *priv) ret = mxt_getreg(priv, MXT_MATRIX_Y_SIZE, (FAR uint8_t *)®val, 1); if (ret < 0) { - idbg("ERROR: Failed to get Y size: %d\n", ret); + ierr("ERROR: Failed to get Y size: %d\n", ret); goto errout_with_objtab; } @@ -1818,7 +1818,7 @@ static int mxt_hwinitialize(FAR struct mxt_dev_s *priv) kmm_zalloc(nslots * sizeof(struct mxt_sample_s)); if (priv->sample == NULL) { - idbg("ERROR: Failed to allocate object table\n"); + ierr("ERROR: Failed to allocate object table\n"); goto errout_with_objtab; } @@ -1874,7 +1874,7 @@ int mxt_register(FAR struct i2c_master_s *i2c, priv = (FAR struct mxt_dev_s *)kmm_zalloc(sizeof(struct mxt_dev_s)); if (priv == NULL) { - idbg("ERROR: Failed allocate device structure\n"); + ierr("ERROR: Failed allocate device structure\n"); return -ENOMEM; } @@ -1897,7 +1897,7 @@ int mxt_register(FAR struct i2c_master_s *i2c, ret = MXT_ATTACH(lower, mxt_interrupt, priv); if (ret < 0) { - idbg("Failed to attach interrupt\n"); + ierr("Failed to attach interrupt\n"); goto errout_with_priv; } @@ -1906,7 +1906,7 @@ int mxt_register(FAR struct i2c_master_s *i2c, ret = mxt_hwinitialize(priv); if (ret < 0) { - idbg("ERROR: mxt_hwinitialize failed: %d\n", ret); + ierr("ERROR: mxt_hwinitialize failed: %d\n", ret); goto errout_with_irq; } @@ -1918,7 +1918,7 @@ int mxt_register(FAR struct i2c_master_s *i2c, ret = register_driver(devname, &mxt_fops, 0666, priv); if (ret < 0) { - idbg("register_driver() failed: %d\n", ret); + ierr("register_driver() failed: %d\n", ret); goto errout_with_hwinit; } diff --git a/drivers/input/stmpe811_adc.c b/drivers/input/stmpe811_adc.c index d0fde02e1f..cdd2aaac2c 100644 --- a/drivers/input/stmpe811_adc.c +++ b/drivers/input/stmpe811_adc.c @@ -101,7 +101,7 @@ int stmpe811_adcinitialize(STMPE811_HANDLE handle) if (ret < 0) { int errval = errno; - idbg("sem_wait failed: %d\n", errval); + ierr("sem_wait failed: %d\n", errval); return -errval; } @@ -161,7 +161,7 @@ int stmpe811_adcconfig(STMPE811_HANDLE handle, int pin) if (ret < 0) { int errval = errno; - idbg("sem_wait failed: %d\n", errval); + ierr("sem_wait failed: %d\n", errval); return -errval; } @@ -169,7 +169,7 @@ int stmpe811_adcconfig(STMPE811_HANDLE handle, int pin) if ((priv->inuse & pinmask) != 0) { - idbg("PIN%d is already in-use\n", pin); + ierr("PIN%d is already in-use\n", pin); sem_post(&priv->exclsem); return -EBUSY; } @@ -221,7 +221,7 @@ uint16_t stmpe811_adcread(STMPE811_HANDLE handle, int pin) if (ret < 0) { int errval = errno; - idbg("sem_wait failed: %d\n", errval); + ierr("sem_wait failed: %d\n", errval); return -errval; } diff --git a/drivers/input/stmpe811_base.c b/drivers/input/stmpe811_base.c index 863daf61f5..d4b6d50f23 100644 --- a/drivers/input/stmpe811_base.c +++ b/drivers/input/stmpe811_base.c @@ -422,12 +422,12 @@ uint8_t stmpe811_getreg8(FAR struct stmpe811_dev_s *priv, uint8_t regaddr) ret = I2C_TRANSFER(priv->i2c, msg, 2); if (ret < 0) { - idbg("I2C_TRANSFER failed: %d\n", ret); + ierr("I2C_TRANSFER failed: %d\n", ret); return 0; } #ifdef CONFIG_STMPE811_REGDEBUG - dbg("%02x->%02x\n", regaddr, regval); + err("%02x->%02x\n", regaddr, regval); #endif return regval; } @@ -455,7 +455,7 @@ void stmpe811_putreg8(FAR struct stmpe811_dev_s *priv, int ret; #ifdef CONFIG_STMPE811_REGDEBUG - dbg("%02x<-%02x\n", regaddr, regval); + err("%02x<-%02x\n", regaddr, regval); #endif /* Setup to the data to be transferred. Two bytes: The STMPE811 register @@ -479,7 +479,7 @@ void stmpe811_putreg8(FAR struct stmpe811_dev_s *priv, ret = I2C_TRANSFER(priv->i2c, &msg, 1); if (ret < 0) { - idbg("I2C_TRANSFER failed: %d\n", ret); + ierr("I2C_TRANSFER failed: %d\n", ret); } } #endif @@ -530,12 +530,12 @@ uint16_t stmpe811_getreg16(FAR struct stmpe811_dev_s *priv, uint8_t regaddr) ret = I2C_TRANSFER(priv->i2c, msg, 2); if (ret < 0) { - idbg("I2C_TRANSFER failed: %d\n", ret); + ierr("I2C_TRANSFER failed: %d\n", ret); return 0; } #ifdef CONFIG_STMPE811_REGDEBUG - dbg("%02x->%02x%02x\n", regaddr, rxbuffer[0], rxbuffer[1]); + err("%02x->%02x%02x\n", regaddr, rxbuffer[0], rxbuffer[1]); #endif return (uint16_t)rxbuffer[0] << 8 | (uint16_t)rxbuffer[1]; } diff --git a/drivers/input/stmpe811_gpio.c b/drivers/input/stmpe811_gpio.c index 7d4fc5edb8..e794f732ba 100644 --- a/drivers/input/stmpe811_gpio.c +++ b/drivers/input/stmpe811_gpio.c @@ -144,7 +144,7 @@ int stmpe811_gpioconfig(STMPE811_HANDLE handle, uint8_t pinconfig) if (ret < 0) { int errval = errno; - idbg("sem_wait failed: %d\n", errval); + ierr("sem_wait failed: %d\n", errval); return -errval; } @@ -152,7 +152,7 @@ int stmpe811_gpioconfig(STMPE811_HANDLE handle, uint8_t pinconfig) if ((priv->inuse & pinmask) != 0) { - idbg("PIN%d is already in-use\n", pin); + ierr("PIN%d is already in-use\n", pin); sem_post(&priv->exclsem); return -EBUSY; } @@ -259,7 +259,7 @@ void stmpe811_gpiowrite(STMPE811_HANDLE handle, uint8_t pinconfig, bool value) ret = sem_wait(&priv->exclsem); if (ret < 0) { - idbg("sem_wait failed: %d\n", errno); + ierr("sem_wait failed: %d\n", errno); return; } @@ -313,7 +313,7 @@ int stmpe811_gpioread(STMPE811_HANDLE handle, uint8_t pinconfig, bool *value) if (ret < 0) { int errval = errno; - idbg("sem_wait failed: %d\n", errval); + ierr("sem_wait failed: %d\n", errval); return -errval; } @@ -362,7 +362,7 @@ int stmpe811_gpioattach(STMPE811_HANDLE handle, uint8_t pinconfig, if (ret < 0) { int errval = errno; - idbg("sem_wait failed: %d\n", errval); + ierr("sem_wait failed: %d\n", errval); return -errval; } diff --git a/drivers/input/stmpe811_tsc.c b/drivers/input/stmpe811_tsc.c index d1cfa04bdc..b41f325685 100644 --- a/drivers/input/stmpe811_tsc.c +++ b/drivers/input/stmpe811_tsc.c @@ -315,7 +315,7 @@ static inline int stmpe811_waitsample(FAR struct stmpe811_dev_s *priv, * the failure now. */ - idbg("ERROR: sem_wait failed: %d\n", errval); + ierr("ERROR: sem_wait failed: %d\n", errval); DEBUGASSERT(errval == EINTR); #endif ret = -EINTR; @@ -677,7 +677,7 @@ static int stmpe811_poll(FAR struct file *filep, FAR struct pollfd *fds, if ((fds->events & POLLIN) == 0) { - idbg("ERROR: Missing POLLIN: revents: %08x\n", fds->revents); + ierr("ERROR: Missing POLLIN: revents: %08x\n", fds->revents); ret = -EDEADLK; goto errout; } @@ -702,7 +702,7 @@ static int stmpe811_poll(FAR struct file *filep, FAR struct pollfd *fds, if (i >= CONFIG_STMPE811_NPOLLWAITERS) { - idbg("ERROR: No available slot found: %d\n", i); + ierr("ERROR: No available slot found: %d\n", i); fds->priv = NULL; ret = -EBUSY; goto errout; @@ -907,7 +907,7 @@ int stmpe811_register(STMPE811_HANDLE handle, int minor) if (ret < 0) { int errval = errno; - idbg("ERROR: sem_wait failed: %d\n", errval); + ierr("ERROR: sem_wait failed: %d\n", errval); return -errval; } @@ -915,7 +915,7 @@ int stmpe811_register(STMPE811_HANDLE handle, int minor) if ((priv->inuse & TSC_PIN_SET) != 0) { - idbg("ERROR: TSC pins is already in-use: %02x\n", priv->inuse); + ierr("ERROR: TSC pins is already in-use: %02x\n", priv->inuse); sem_post(&priv->exclsem); return -EBUSY; } @@ -932,7 +932,7 @@ int stmpe811_register(STMPE811_HANDLE handle, int minor) priv->wdog = wd_create(); if (!priv->wdog) { - idbg("ERROR: Failed to create a watchdog\n", errno); + ierr("ERROR: Failed to create a watchdog\n", errno); sem_post(&priv->exclsem); return -ENOSPC; } @@ -943,7 +943,7 @@ int stmpe811_register(STMPE811_HANDLE handle, int minor) ret = register_driver(devname, &g_stmpe811fops, 0666, priv); if (ret < 0) { - idbg("ERROR: Failed to register driver %s: %d\n", devname, ret); + ierr("ERROR: Failed to register driver %s: %d\n", devname, ret); sem_post(&priv->exclsem); return ret; } diff --git a/drivers/input/tsc2007.c b/drivers/input/tsc2007.c index 5d478551c7..1361617621 100644 --- a/drivers/input/tsc2007.c +++ b/drivers/input/tsc2007.c @@ -456,7 +456,7 @@ static int tsc2007_activate(FAR struct tsc2007_dev_s *priv, uint8_t cmd) ret = I2C_TRANSFER(priv->i2c, &msg, 1); if (ret < 0) { - idbg("I2C_TRANSFER failed: %d\n", ret); + ierr("I2C_TRANSFER failed: %d\n", ret); } return ret; } @@ -495,7 +495,7 @@ static int tsc2007_transfer(FAR struct tsc2007_dev_s *priv, uint8_t cmd) ret = I2C_TRANSFER(priv->i2c, &msg, 1); if (ret < 0) { - idbg("I2C_TRANSFER failed: %d\n", ret); + ierr("I2C_TRANSFER failed: %d\n", ret); return ret; } @@ -540,7 +540,7 @@ static int tsc2007_transfer(FAR struct tsc2007_dev_s *priv, uint8_t cmd) ret = I2C_TRANSFER(priv->i2c, &msg, 1); if (ret < 0) { - idbg("I2C_TRANSFER failed: %d\n", ret); + ierr("I2C_TRANSFER failed: %d\n", ret); return ret; } @@ -672,7 +672,7 @@ static void tsc2007_worker(FAR void *arg) if (z1 == 0) { - idbg("Z1 zero\n"); + ierr("Z1 zero\n"); pressure = 0; } else @@ -687,7 +687,7 @@ static void tsc2007_worker(FAR void *arg) if (pressure > 0x0fff) { - idbg("Dropped out-of-range pressure: %d\n", pressure); + ierr("Dropped out-of-range pressure: %d\n", pressure); pressure = 0; } } @@ -1131,7 +1131,7 @@ static int tsc2007_poll(FAR struct file *filep, FAR struct pollfd *fds, if ((fds->events & POLLIN) == 0) { - idbg("Missing POLLIN: revents: %08x\n", fds->revents); + ierr("Missing POLLIN: revents: %08x\n", fds->revents); ret = -EDEADLK; goto errout; } @@ -1156,7 +1156,7 @@ static int tsc2007_poll(FAR struct file *filep, FAR struct pollfd *fds, if (i >= CONFIG_TSC2007_NPOLLWAITERS) { - idbg("No availabled slot found: %d\n", i); + ierr("No availabled slot found: %d\n", i); fds->priv = NULL; ret = -EBUSY; goto errout; @@ -1242,7 +1242,7 @@ int tsc2007_register(FAR struct i2c_master_s *dev, priv = (FAR struct tsc2007_dev_s *)kmm_malloc(sizeof(struct tsc2007_dev_s)); if (!priv) { - idbg("kmm_malloc(%d) failed\n", sizeof(struct tsc2007_dev_s)); + ierr("kmm_malloc(%d) failed\n", sizeof(struct tsc2007_dev_s)); return -ENOMEM; } #endif @@ -1265,7 +1265,7 @@ int tsc2007_register(FAR struct i2c_master_s *dev, ret = config->attach(config, tsc2007_interrupt); if (ret < 0) { - idbg("Failed to attach interrupt\n"); + ierr("Failed to attach interrupt\n"); goto errout_with_priv; } @@ -1276,7 +1276,7 @@ int tsc2007_register(FAR struct i2c_master_s *dev, ret = tsc2007_transfer(priv, TSC2007_ENABLE_PENIRQ); if (ret < 0) { - idbg("tsc2007_transfer failed: %d\n", ret); + ierr("tsc2007_transfer failed: %d\n", ret); goto errout_with_priv; } @@ -1288,7 +1288,7 @@ int tsc2007_register(FAR struct i2c_master_s *dev, ret = register_driver(devname, &tsc2007_fops, 0666, priv); if (ret < 0) { - idbg("register_driver() failed: %d\n", ret); + ierr("register_driver() failed: %d\n", ret); goto errout_with_priv; } @@ -1311,7 +1311,7 @@ int tsc2007_register(FAR struct i2c_master_s *dev, ret = work_queue(HPWORK, &priv->work, tsc2007_worker, priv, 0); if (ret != 0) { - idbg("Failed to queue work: %d\n", ret); + ierr("Failed to queue work: %d\n", ret); goto errout_with_priv; } diff --git a/drivers/lcd/ili9341.c b/drivers/lcd/ili9341.c index e802057f46..af6ffaef16 100644 --- a/drivers/lcd/ili9341.c +++ b/drivers/lcd/ili9341.c @@ -370,10 +370,10 @@ /* Debug option */ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -772,7 +772,7 @@ static int ili9341_hwinitialize(FAR struct ili9341_dev_s *dev) /* Select spi device */ - lcddbg("Initialize lcd driver\n"); + lcderr("Initialize lcd driver\n"); lcd->select(lcd); #ifdef CONFIG_DEBUG_LCD @@ -780,13 +780,13 @@ static int ili9341_hwinitialize(FAR struct ili9341_dev_s *dev) lcd->sendcmd(lcd, ILI9341_READ_ID1); lcd->recvparam(lcd, ¶m); - lcddbg("ili9341 LCD driver: LCD modules manufacturer ID: %d\n", param); + lcderr("ili9341 LCD driver: LCD modules manufacturer ID: %d\n", param); lcd->sendcmd(lcd, ILI9341_READ_ID2); lcd->recvparam(lcd, ¶m); - lcddbg("ili9341 LCD driver: LCD modules driver version ID: %d\n", param); + lcderr("ili9341 LCD driver: LCD modules driver version ID: %d\n", param); lcd->sendcmd(lcd, ILI9341_READ_ID3); lcd->recvparam(lcd, ¶m); - lcddbg("ili9341 LCD driver: LCD modules driver ID: %d\n", param); + lcderr("ili9341 LCD driver: LCD modules driver ID: %d\n", param); #endif /* Reset the lcd display to the default state */ @@ -1020,7 +1020,7 @@ static int ili9341_getpower(FAR struct lcd_dev_s *dev) if (priv) { - lcddbg("%d\n", priv->power); + lcderr("%d\n", priv->power); return priv->power; } @@ -1053,7 +1053,7 @@ static int ili9341_setpower(FAR struct lcd_dev_s *dev, int power) if (dev) { - lcddbg("%d\n", power); + lcderr("%d\n", power); lcd->select(lcd); diff --git a/drivers/lcd/memlcd.c b/drivers/lcd/memlcd.c index 32bdd216a1..37d76345fb 100644 --- a/drivers/lcd/memlcd.c +++ b/drivers/lcd/memlcd.c @@ -112,10 +112,10 @@ /* Debug */ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lcderr(format, ...) err(format, ##__VA_ARGS__) # define lcdinfo(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -339,7 +339,7 @@ static void memlcd_deselect(FAR struct spi_dev_s *spi) static inline void memlcd_clear(FAR struct memlcd_dev_s *mlcd) { uint16_t cmd = MEMLCD_CMD_ALL_CLEAR; - lcddbg("Clear display\n"); + lcderr("Clear display\n"); memlcd_select(mlcd->spi); /* XXX Ensure 2us here */ SPI_SNDBLOCK(mlcd->spi, &cmd, 2); @@ -594,7 +594,7 @@ static int memlcd_getpower(FAR struct lcd_dev_s *dev) { FAR struct memlcd_dev_s *mlcd = (FAR struct memlcd_dev_s *)dev; DEBUGASSERT(mlcd); - lcddbg("%d\n", mlcd->power); + lcderr("%d\n", mlcd->power); return mlcd->power; } @@ -611,7 +611,7 @@ static int memlcd_setpower(FAR struct lcd_dev_s *dev, int power) { struct memlcd_dev_s *mlcd = (struct memlcd_dev_s *)dev; DEBUGASSERT(mlcd && (unsigned)power <= CONFIG_LCD_MAXPOWER && mlcd->spi); - lcddbg("%d\n", power); + lcderr("%d\n", power); mlcd->power = power; if (power > 0) @@ -639,7 +639,7 @@ static int memlcd_getcontrast(struct lcd_dev_s *dev) { struct memlcd_dev_s *mlcd = (struct memlcd_dev_s *)dev; DEBUGASSERT(mlcd); - lcddbg("contrast: %d\n", mlcd->contrast); + lcderr("contrast: %d\n", mlcd->contrast); return mlcd->contrast; } @@ -655,7 +655,7 @@ static int memlcd_setcontrast(struct lcd_dev_s *dev, unsigned int contrast) { struct memlcd_dev_s *mlcd = (struct memlcd_dev_s *)dev; DEBUGASSERT(mlcd); - lcddbg("contrast: %d\n", contrast); + lcderr("contrast: %d\n", contrast); if (contrast > MEMLCD_MAXCONTRAST) { contrast = MEMLCD_MAXCONTRAST; @@ -710,6 +710,6 @@ FAR struct lcd_dev_s *memlcd_initialize(FAR struct spi_dev_s *spi, mlcd->priv->attachirq(memlcd_extcominisr); - lcddbg("done\n"); + lcderr("done\n"); return &mlcd->dev; } diff --git a/drivers/lcd/mio283qt2.c b/drivers/lcd/mio283qt2.c index c6f6eabb06..531f83e6d0 100644 --- a/drivers/lcd/mio283qt2.c +++ b/drivers/lcd/mio283qt2.c @@ -240,10 +240,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -820,7 +820,7 @@ static inline int mio283qt2_hwinitialize(FAR struct mio283qt2_dev_s *priv) #ifndef CONFIG_LCD_NOGETRUN id = mio283qt2_readreg(lcd, 0x00); - lcddbg("LCD ID: %04x\n", id); + lcderr("LCD ID: %04x\n", id); /* Check if the ID is for the MIO283QT2 */ @@ -926,7 +926,7 @@ static inline int mio283qt2_hwinitialize(FAR struct mio283qt2_dev_s *priv) #ifndef CONFIG_LCD_NOGETRUN else { - lcddbg("Unsupported LCD type\n"); + lcderr("Unsupported LCD type\n"); ret = -ENODEV; } #endif diff --git a/drivers/lcd/mio283qt9a.c b/drivers/lcd/mio283qt9a.c index 9bd4938333..e4eb342a69 100644 --- a/drivers/lcd/mio283qt9a.c +++ b/drivers/lcd/mio283qt9a.c @@ -139,10 +139,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -819,7 +819,7 @@ static inline int mio283qt9a_hwinitialize(FAR struct mio283qt9a_dev_s *priv) #ifndef CONFIG_LCD_NOGETRUN else { - lcddbg("Unsupported LCD type\n"); + lcderr("Unsupported LCD type\n"); ret = -ENODEV; } #endif diff --git a/drivers/lcd/nokia6100.c b/drivers/lcd/nokia6100.c index 72e8dc7870..227220d6f3 100644 --- a/drivers/lcd/nokia6100.c +++ b/drivers/lcd/nokia6100.c @@ -308,9 +308,9 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_LCD_REGDEBUG -# define lcddbg(format, ...) llinfo(format, ##__VA_ARGS__) +# define lcderr(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) #endif /************************************************************************************** @@ -666,7 +666,7 @@ static void nokia_select(FAR struct spi_dev_s *spi) * devices competing for the SPI bus */ - lcddbg("SELECTED\n"); + lcderr("SELECTED\n"); SPI_LOCK(spi, true); SPI_SELECT(spi, SPIDEV_DISPLAY, true); @@ -700,7 +700,7 @@ static void nokia_deselect(FAR struct spi_dev_s *spi) { /* De-select Nokia 6100 chip and relinquish the SPI bus. */ - lcddbg("DE-SELECTED\n"); + lcderr("DE-SELECTED\n"); SPI_SELECT(spi, SPIDEV_DISPLAY, false); SPI_LOCK(spi, false); } @@ -717,7 +717,7 @@ static void nokia_sndcmd(FAR struct spi_dev_s *spi, const uint8_t cmd) { /* Select the LCD */ - lcddbg("cmd: %02x\n", cmd); + lcderr("cmd: %02x\n", cmd); nokia_select(spi); /* Send the command. Bit 8 == 0 denotes a command */ @@ -743,7 +743,7 @@ static void nokia_cmddata(FAR struct spi_dev_s *spi, uint8_t cmd, int datlen, uint16_t *rowbuf = g_rowbuf; int i; - lcddbg("cmd: %02x datlen: %d\n", cmd, datlen); + lcderr("cmd: %02x datlen: %d\n", cmd, datlen); DEBUGASSERT(datlen <= NOKIA_STRIDE); /* Copy the command into the line buffer. Bit 8 == 0 denotes a command. */ @@ -800,7 +800,7 @@ static void nokia_cmdarray(FAR struct spi_dev_s *spi, int len, const uint8_t *cm for (i = 0; i < len; i++) { - lcddbg("cmddata[%d]: %02x\n", i, cmddata[i]); + lcderr("cmddata[%d]: %02x\n", i, cmddata[i]); } #endif nokia_cmddata(spi, cmddata[0], len-1, &cmddata[1]); diff --git a/drivers/lcd/p14201.c b/drivers/lcd/p14201.c index 5a5164cfe3..ad1513e05d 100644 --- a/drivers/lcd/p14201.c +++ b/drivers/lcd/p14201.c @@ -180,9 +180,9 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_LCD_RITDEBUG -# define ritdbg(format, ...) info(format, ##__VA_ARGS__) +# define riterr(format, ...) info(format, ##__VA_ARGS__) #else -# define ritdbg(x...) +# define riterr(x...) #endif /************************************************************************************** @@ -508,7 +508,7 @@ static void rit_sndbytes(FAR struct rit_dev_s *priv, FAR const uint8_t *buffer, FAR struct spi_dev_s *spi = priv->spi; uint8_t tmp; - ritdbg("buflen: %d cmd: %s [%02x %02x %02x]\n", + riterr("buflen: %d cmd: %s [%02x %02x %02x]\n", buflen, cmd ? "YES" : "NO", buffer[0], buffer[1], buffer[2]); DEBUGASSERT(spi); @@ -552,7 +552,7 @@ static void rit_sndcmds(FAR struct rit_dev_s *priv, FAR const uint8_t *table) while ((cmdlen = *table++) != 0) { - ritdbg("command: %02x cmdlen: %d\n", *table, cmdlen); + riterr("command: %02x cmdlen: %d\n", *table, cmdlen); rit_sndcmd(priv, table, cmdlen); table += cmdlen; } @@ -578,7 +578,7 @@ static inline void rit_clear(FAR struct rit_dev_s *priv) FAR uint8_t *ptr = g_framebuffer; unsigned int row; - ritdbg("Clear display\n"); + riterr("Clear display\n"); /* Initialize the framebuffer */ @@ -605,7 +605,7 @@ static inline void rit_clear(FAR struct rit_dev_s *priv) { unsigned int row; - ritdbg("Clear display\n"); + riterr("Clear display\n"); /* Create a black row */ @@ -655,7 +655,7 @@ static int rit_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, int aend; int i; - ritdbg("row: %d col: %d npixels: %d\n", row, col, npixels); + riterr("row: %d col: %d npixels: %d\n", row, col, npixels); DEBUGASSERT(buffer); /* Toss out the special case of the empty run now */ @@ -678,7 +678,7 @@ static int rit_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, start = col >> 1; aend = (col + npixels) >> 1; end = (col + npixels + 1) >> 1; - ritdbg("start: %d aend: %d end: %d\n", start, aend, end); + riterr("start: %d aend: %d end: %d\n", start, aend, end); /* Copy the run into the framebuffer, handling nibble alignment. * @@ -814,7 +814,7 @@ static int rit_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, FAR struct rit_dev_s *priv = (FAR struct rit_dev_s *)&g_oleddev; uint8_t cmd[3]; - ritdbg("row: %d col: %d npixels: %d\n", row, col, npixels); + riterr("row: %d col: %d npixels: %d\n", row, col, npixels); DEBUGASSERT(buffer); if (npixels > 0) @@ -885,7 +885,7 @@ static int rit_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, int aend; int i; - ritdbg("row: %d col: %d npixels: %d\n", row, col, npixels); + riterr("row: %d col: %d npixels: %d\n", row, col, npixels); DEBUGASSERT(buffer); /* Can't read from OLED GDDRAM in SPI mode, but we can read from the framebuffer */ diff --git a/drivers/lcd/pcf8574_lcd_backpack.c b/drivers/lcd/pcf8574_lcd_backpack.c index 8cda5412ec..e0fa2315fa 100644 --- a/drivers/lcd/pcf8574_lcd_backpack.c +++ b/drivers/lcd/pcf8574_lcd_backpack.c @@ -79,10 +79,10 @@ #define CMD_SET_DDADDR 0x80 #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif diff --git a/drivers/lcd/ra8875.c b/drivers/lcd/ra8875.c index 11aad5b137..96c7a637ff 100644 --- a/drivers/lcd/ra8875.c +++ b/drivers/lcd/ra8875.c @@ -175,10 +175,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -574,8 +574,8 @@ static void ra8875_showrun(FAR struct ra8875_dev_s *priv, fb_coord_t row, if (priv->firstrow != priv->lastrow) { - lcddbg("...\n"); - lcddbg("%s row: %d col: %d npixels: %d\n", + lcderr("...\n"); + lcderr("%s row: %d col: %d npixels: %d\n", priv->put ? "PUT" : "GET", priv->lastrow, priv->col, priv->npixels); } @@ -584,7 +584,7 @@ static void ra8875_showrun(FAR struct ra8875_dev_s *priv, fb_coord_t row, * new sequence */ - lcddbg("%s row: %d col: %d npixels: %d\n", + lcderr("%s row: %d col: %d npixels: %d\n", put ? "PUT" : "GET", row, col, npixels); /* And save information about the run so that we can detect continuations diff --git a/drivers/lcd/skeleton.c b/drivers/lcd/skeleton.c index 7b4d7a6034..53b343b3a6 100644 --- a/drivers/lcd/skeleton.c +++ b/drivers/lcd/skeleton.c @@ -90,9 +90,9 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_LCD_SKELDEBUG -# define skeldbg(format, ...) info(format, ##__VA_ARGS__) +# define skelerr(format, ...) info(format, ##__VA_ARGS__) #else -# define skeldbg(x...) +# define skelerr(x...) #endif /************************************************************************************** diff --git a/drivers/lcd/ssd1289.c b/drivers/lcd/ssd1289.c index 98e994d17f..fcd124f6dc 100644 --- a/drivers/lcd/ssd1289.c +++ b/drivers/lcd/ssd1289.c @@ -229,10 +229,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -543,8 +543,8 @@ static void ssd1289_showrun(FAR struct ssd1289_dev_s *priv, fb_coord_t row, if (priv->firstrow != priv->lastrow) { - lcddbg("...\n"); - lcddbg("%s row: %d col: %d npixels: %d\n", + lcderr("...\n"); + lcderr("%s row: %d col: %d npixels: %d\n", priv->put ? "PUT" : "GET", priv->lastrow, priv->col, priv->npixels); } @@ -553,7 +553,7 @@ static void ssd1289_showrun(FAR struct ssd1289_dev_s *priv, fb_coord_t row, * new sequence */ - lcddbg("%s row: %d col: %d npixels: %d\n", + lcderr("%s row: %d col: %d npixels: %d\n", put ? "PUT" : "GET", row, col, npixels); /* And save information about the run so that we can detect continuations @@ -1020,7 +1020,7 @@ static inline int ssd1289_hwinitialize(FAR struct ssd1289_dev_s *priv) id = ssd1289_readreg(lcd, SSD1289_DEVCODE); if (id != 0) { - lcddbg("LCD ID: %04x\n", id); + lcderr("LCD ID: %04x\n", id); } /* If we could not get the ID, then let's just assume that this is an SSD1289. @@ -1030,7 +1030,7 @@ static inline int ssd1289_hwinitialize(FAR struct ssd1289_dev_s *priv) else { - lcddbg("No LCD ID, assuming SSD1289\n"); + lcderr("No LCD ID, assuming SSD1289\n"); id = SSD1289_DEVCODE_VALUE; } @@ -1273,7 +1273,7 @@ static inline int ssd1289_hwinitialize(FAR struct ssd1289_dev_s *priv) #ifndef CONFIG_LCD_NOGETRUN else { - lcddbg("Unsupported LCD type\n"); + lcderr("Unsupported LCD type\n"); ret = -ENODEV; } #endif diff --git a/drivers/lcd/ssd1306.h b/drivers/lcd/ssd1306.h index fb71377279..11fce32c73 100644 --- a/drivers/lcd/ssd1306.h +++ b/drivers/lcd/ssd1306.h @@ -212,10 +212,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lcderr(format, ...) err(format, ##__VA_ARGS__) # define lcdinfo(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif diff --git a/drivers/lcd/ssd1306_i2c.c b/drivers/lcd/ssd1306_i2c.c index 30ca9a664f..a3c30fd702 100644 --- a/drivers/lcd/ssd1306_i2c.c +++ b/drivers/lcd/ssd1306_i2c.c @@ -94,7 +94,7 @@ void ssd1306_sendbyte(FAR struct ssd1306_dev_s *priv, uint8_t regval) ret = I2C_TRANSFER(priv->i2c, &msg, 1); if (ret < 0) { - sndbg("I2C_TRANSFER failed: %d\n", ret); + snerr("I2C_TRANSFER failed: %d\n", ret); } } @@ -130,7 +130,7 @@ void ssd1306_sendblk(FAR struct ssd1306_dev_s *priv, uint8_t *data, uint8_t len) ret = I2C_TRANSFER(priv->i2c, &msg, 1); if (ret < 0) { - sndbg("I2C_TRANSFER failed: %d\n", ret); + snerr("I2C_TRANSFER failed: %d\n", ret); } } diff --git a/drivers/lcd/ssd1351.c b/drivers/lcd/ssd1351.c index 00908cee66..a9e799e7ca 100644 --- a/drivers/lcd/ssd1351.c +++ b/drivers/lcd/ssd1351.c @@ -499,7 +499,7 @@ static void ssd1351_select(FAR struct ssd1351_dev_s *priv) * competing for the SPI bus */ - gdbg("SELECTED\n"); + gerr("SELECTED\n"); SPI_LOCK(spi, true); SPI_SELECT(spi, SPIDEV_DISPLAY, true); @@ -529,7 +529,7 @@ static void ssd1351_deselect(FAR struct ssd1351_dev_s *priv) /* De-select the chip and relinquish the SPI bus */ - gdbg("DE-SELECTED\n"); + gerr("DE-SELECTED\n"); SPI_SELECT(spi, SPIDEV_DISPLAY, false); SPI_LOCK(spi, false); } diff --git a/drivers/lcd/st7565.c b/drivers/lcd/st7565.c index 8bcaea643c..b50b873647 100644 --- a/drivers/lcd/st7565.c +++ b/drivers/lcd/st7565.c @@ -179,9 +179,9 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_LCD_ST7565DEBUG -# define st7565dbg(format, ...) info(format, ##__VA_ARGS__) +# define st7565err(format, ...) info(format, ##__VA_ARGS__) #else -# define st7565dbg(x...) +# define st7565err(x...) #endif /************************************************************************************** diff --git a/drivers/lcd/st7567.c b/drivers/lcd/st7567.c index ce5b06a92d..05bce776f9 100644 --- a/drivers/lcd/st7567.c +++ b/drivers/lcd/st7567.c @@ -209,9 +209,9 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_LCD_ST7567DEBUG -# define st7567dbg(format, ...) info(format, ##__VA_ARGS__) +# define st7567err(format, ...) info(format, ##__VA_ARGS__) #else -# define st7567dbg(x...) +# define st7567err(x...) #endif /************************************************************************************** diff --git a/drivers/lcd/ug-2864ambag01.c b/drivers/lcd/ug-2864ambag01.c index 21c4215631..54d003f6f5 100644 --- a/drivers/lcd/ug-2864ambag01.c +++ b/drivers/lcd/ug-2864ambag01.c @@ -263,10 +263,10 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lcderr(format, ...) err(format, ##__VA_ARGS__) # define lcdinfo(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif diff --git a/drivers/lcd/ug-9664hswag01.c b/drivers/lcd/ug-9664hswag01.c index 4f427d69a9..b93b5e60f3 100644 --- a/drivers/lcd/ug-9664hswag01.c +++ b/drivers/lcd/ug-9664hswag01.c @@ -224,9 +224,9 @@ /* Debug ******************************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg(format, ...) info(format, ##__VA_ARGS__) +# define lcderr(format, ...) info(format, ##__VA_ARGS__) #else -# define lcddbg(x...) +# define lcderr(x...) #endif /************************************************************************************** diff --git a/drivers/leds/pca9635pw.c b/drivers/leds/pca9635pw.c index 452891555a..7bb8f95d8b 100644 --- a/drivers/leds/pca9635pw.c +++ b/drivers/leds/pca9635pw.c @@ -105,7 +105,7 @@ static int pca9635pw_i2c_write_byte(FAR struct pca9635pw_dev_s *priv, { struct i2c_config_s config; - dbg("pca9635pw_i2c_write_byte\n"); + err("pca9635pw_i2c_write_byte\n"); /* assemble the 2 byte message comprised of reg_addr and reg_val */ @@ -123,14 +123,14 @@ static int pca9635pw_i2c_write_byte(FAR struct pca9635pw_dev_s *priv, /* Write the register address followed by the data (no RESTART) */ - dbg("i2c addr: 0x%02X reg addr: 0x%02X value: 0x%02X\n", priv->i2c_addr, + err("i2c addr: 0x%02X reg addr: 0x%02X value: 0x%02X\n", priv->i2c_addr, buffer[0], buffer[1]); ret = i2c_write(priv->i2c, &config, buffer, BUFFER_SIZE); if (ret != OK) { - dbg("i2c_write returned error code %d\n", ret); + err("i2c_write returned error code %d\n", ret); return ret; } @@ -173,7 +173,7 @@ static int pca9635pw_set_led_mode(FAR struct pca9635pw_dev_s *priv, static int pca9635pw_open(FAR struct file *filep) { - dbg("pca9635pw_open\n"); + err("pca9635pw_open\n"); FAR struct inode *inode = filep->f_inode; FAR struct pca9635pw_dev_s *priv = inode->i_private; @@ -192,7 +192,7 @@ static int pca9635pw_open(FAR struct file *filep) PCA9635PW_MODE_1_INITIAL_VALUE); if (ret != OK) { - dbg("Could not set initial config for PCA9635PW_MODE_1\n"); + err("Could not set initial config for PCA9635PW_MODE_1\n"); return ret; } @@ -209,7 +209,7 @@ static int pca9635pw_open(FAR struct file *filep) PCA9635PW_MODE_2_INITIAL_VALUE); if (ret != OK) { - dbg("Could not set initial config for PCA9635PW_MODE_2\n"); + err("Could not set initial config for PCA9635PW_MODE_2\n"); return ret; } @@ -227,7 +227,7 @@ static int pca9635pw_open(FAR struct file *filep) ret = pca9635pw_set_led_mode(priv, PCA9635PW_LED_OUT_x_MODE_2); if (ret != OK) { - dbg("Could not set led driver outputs to MODE2 (LED's brightness are " + err("Could not set led driver outputs to MODE2 (LED's brightness are " "controlled by pwm registers)\n"); return ret; } @@ -245,7 +245,7 @@ static int pca9635pw_open(FAR struct file *filep) static int pca9635pw_close(FAR struct file *filep) { - dbg("pca9635pw_close\n"); + err("pca9635pw_close\n"); FAR struct inode *inode = filep->f_inode; FAR struct pca9635pw_dev_s *priv = inode->i_private; @@ -257,7 +257,7 @@ static int pca9635pw_close(FAR struct file *filep) ret = pca9635pw_set_led_mode(priv, PCA9635PW_LED_OUT_x_MODE_0); if (ret != OK) { - dbg("Could not set led driver outputs to MODE0 (LED's are off)\n"); + err("Could not set led driver outputs to MODE0 (LED's are off)\n"); return ret; } @@ -285,14 +285,14 @@ static int pca9635pw_close(FAR struct file *filep) static int pca9635pw_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { - dbg("pca9635pw_ioctl\n"); + err("pca9635pw_ioctl\n"); FAR struct inode *inode = filep->f_inode; FAR struct pca9635pw_dev_s *priv = inode->i_private; int ret = OK; - dbg("cmd: %d arg: %ld\n", cmd, arg); + err("cmd: %d arg: %ld\n", cmd, arg); switch (cmd) { @@ -319,7 +319,7 @@ static int pca9635pw_ioctl(FAR struct file *filep, int cmd, unsigned long arg) default: { - dbg("Unrecognized cmd: %d\n", cmd); + err("Unrecognized cmd: %d\n", cmd); ret = -ENOTTY; } break; @@ -364,7 +364,7 @@ int pca9635pw_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, if (priv == NULL) { - dbg("Failed to allocate instance of pca9635pw_dev_s\n"); + err("Failed to allocate instance of pca9635pw_dev_s\n"); return -ENOMEM; } @@ -376,7 +376,7 @@ int pca9635pw_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, int const ret = register_driver(devpath, &g_pca9635pw_fileops, 666, priv); if (ret != OK) { - dbg("Failed to register driver: %d\n", ret); + err("Failed to register driver: %d\n", ret); kmm_free(priv); return ret; } diff --git a/drivers/leds/rgbled.c b/drivers/leds/rgbled.c index 8a457a391c..7cd2117a3e 100644 --- a/drivers/leds/rgbled.c +++ b/drivers/leds/rgbled.c @@ -73,12 +73,12 @@ /* Non-standard debug that may be enabled just for testing PWM */ #ifdef CONFIG_DEBUG_RGBLED -# define pwmdbg dbg +# define pwmerr err # define pwminfo info # define pwmllerr llerr # define pwmllinfo llinfo #else -# define pwmdbg(x...) +# define pwmerr(x...) # define pwminfo(x...) # define pwmllerr(x...) # define pwmllinfo(x...) @@ -395,7 +395,7 @@ int rgbled_register(FAR const char *path, FAR struct pwm_lowerhalf_s *ledr, if (!upper) { - pwmdbg("Allocation failed\n"); + pwmerr("Allocation failed\n"); return -ENOMEM; } diff --git a/drivers/leds/userled_upper.c b/drivers/leds/userled_upper.c index 397f9aab8b..00a6860e1b 100644 --- a/drivers/leds/userled_upper.c +++ b/drivers/leds/userled_upper.c @@ -67,14 +67,14 @@ #endif #ifdef CONFIG_DEBUG_LEDS -# define ddbg llerr +# define derr llerr # ifdef CONFIG_DEBUG_INFO # define dinfo llerr # else # define dinfo(x...) # endif #else -# define ddbg(x...) +# define derr(x...) # define dinfo(x...) #endif diff --git a/drivers/loop/losetup.c b/drivers/loop/losetup.c index 5ff237058b..61817cd19f 100644 --- a/drivers/loop/losetup.c +++ b/drivers/loop/losetup.c @@ -246,7 +246,7 @@ static ssize_t loop_read(FAR struct inode *inode, FAR unsigned char *buffer, if (start_sector + nsectors > dev->nsectors) { - dbg("Read past end of file\n"); + err("Read past end of file\n"); return -EIO; } @@ -256,7 +256,7 @@ static ssize_t loop_read(FAR struct inode *inode, FAR unsigned char *buffer, ret = lseek(dev->fd, offset, SEEK_SET); if (ret == (off_t)-1) { - dbg("Seek failed for offset=%d: %d\n", (int)offset, get_errno()); + err("Seek failed for offset=%d: %d\n", (int)offset, get_errno()); return -EIO; } @@ -267,7 +267,7 @@ static ssize_t loop_read(FAR struct inode *inode, FAR unsigned char *buffer, nbytesread = read(dev->fd, buffer, nsectors * dev->sectsize); if (nbytesread < 0 && get_errno() != EINTR) { - dbg("Read failed: %d\n", get_errno()); + err("Read failed: %d\n", get_errno()); return -get_errno(); } } @@ -304,7 +304,7 @@ static ssize_t loop_write(FAR struct inode *inode, ret = lseek(dev->fd, offset, SEEK_SET); if (ret == (off_t)-1) { - dbg("Seek failed for offset=%d: %d\n", (int)offset, get_errno()); + err("Seek failed for offset=%d: %d\n", (int)offset, get_errno()); } /* Then write the requested number of sectors to that position */ @@ -314,7 +314,7 @@ static ssize_t loop_write(FAR struct inode *inode, nbyteswritten = write(dev->fd, buffer, nsectors * dev->sectsize); if (nbyteswritten < 0 && get_errno() != EINTR) { - dbg("Write failed: %d\n", get_errno()); + err("Write failed: %d\n", get_errno()); return -get_errno(); } } @@ -391,7 +391,7 @@ int losetup(FAR const char *devname, FAR const char *filename, ret = stat(filename, &sb); if (ret < 0) { - dbg("Failed to stat %s: %d\n", filename, get_errno()); + err("Failed to stat %s: %d\n", filename, get_errno()); return -get_errno(); } @@ -399,7 +399,7 @@ int losetup(FAR const char *devname, FAR const char *filename, if (sb.st_size - offset < sectsize) { - dbg("File is too small for blocksize\n"); + err("File is too small for blocksize\n"); return -ERANGE; } @@ -445,7 +445,7 @@ int losetup(FAR const char *devname, FAR const char *filename, dev->fd = open(filename, O_RDWR); if (dev->fd < 0) { - dbg("Failed to open %s: %d\n", filename, get_errno()); + err("Failed to open %s: %d\n", filename, get_errno()); ret = -get_errno(); goto errout_with_dev; } @@ -456,7 +456,7 @@ int losetup(FAR const char *devname, FAR const char *filename, ret = register_blockdriver(devname, &g_bops, 0, dev); if (ret < 0) { - fdbg("register_blockdriver failed: %d\n", -ret); + ferr("register_blockdriver failed: %d\n", -ret); goto errout_with_fd; } @@ -499,7 +499,7 @@ int loteardown(FAR const char *devname) ret = open_blockdriver(devname, MS_RDONLY, &inode); if (ret < 0) { - dbg("Failed to open %s: %d\n", devname, -ret); + err("Failed to open %s: %d\n", devname, -ret); return ret; } diff --git a/drivers/mmcsd/mmcsd_sdio.c b/drivers/mmcsd/mmcsd_sdio.c index 2b52f72142..e93f326afb 100644 --- a/drivers/mmcsd/mmcsd_sdio.c +++ b/drivers/mmcsd/mmcsd_sdio.c @@ -340,7 +340,7 @@ static int mmcsd_sendcmdpoll(FAR struct mmcsd_state_s *priv, uint32_t cmd, ret = SDIO_WAITRESPONSE(priv->dev, cmd); if (ret != OK) { - fdbg("ERROR: Wait for response to cmd: %08x failed: %d\n", cmd, ret); + ferr("ERROR: Wait for response to cmd: %08x failed: %d\n", cmd, ret); } } @@ -467,7 +467,7 @@ static int mmcsd_recvR6(FAR struct mmcsd_state_s *priv, uint32_t cmd) ret = -EIO; } - fdbg("ERROR: Failed to get RCA. R6=%08x: %d\n", r6, ret); + ferr("ERROR: Failed to get RCA. R6=%08x: %d\n", r6, ret); return ret; } @@ -491,7 +491,7 @@ static int mmcsd_getSCR(FAR struct mmcsd_state_s *priv, uint32_t scr[2]) ret = mmcsd_setblocklen(priv, 8); if (ret != OK) { - fdbg("ERROR: mmcsd_setblocklen failed: %d\n", ret); + ferr("ERROR: mmcsd_setblocklen failed: %d\n", ret); return ret; } @@ -510,7 +510,7 @@ static int mmcsd_getSCR(FAR struct mmcsd_state_s *priv, uint32_t scr[2]) ret = mmcsd_recvR1(priv, SD_CMD55); if (ret != OK) { - fdbg("ERROR: RECVR1 for CMD55 failed: %d\n", ret); + ferr("ERROR: RECVR1 for CMD55 failed: %d\n", ret); return ret; } @@ -520,7 +520,7 @@ static int mmcsd_getSCR(FAR struct mmcsd_state_s *priv, uint32_t scr[2]) ret = mmcsd_recvR1(priv, SD_ACMD51); if (ret != OK) { - fdbg("ERROR: RECVR1 for ACMD51 failed: %d\n", ret); + ferr("ERROR: RECVR1 for ACMD51 failed: %d\n", ret); SDIO_CANCEL(priv->dev); return ret; } @@ -531,7 +531,7 @@ static int mmcsd_getSCR(FAR struct mmcsd_state_s *priv, uint32_t scr[2]) MMCSD_SCR_DATADELAY); if (ret != OK) { - fdbg("ERROR: mmcsd_eventwait for READ DATA failed: %d\n", ret); + ferr("ERROR: mmcsd_eventwait for READ DATA failed: %d\n", ret); } return ret; @@ -1028,7 +1028,7 @@ static int mmcsd_verifystate(FAR struct mmcsd_state_s *priv, uint32_t state) ret = mmcsd_getR1(priv, &r1); if (ret != OK) { - fdbg("ERROR: mmcsd_getR1 failed: %d\n", ret); + ferr("ERROR: mmcsd_getR1 failed: %d\n", ret); return ret; } @@ -1097,7 +1097,7 @@ static int mmcsd_eventwait(FAR struct mmcsd_state_s *priv, { /* Yes.. the failure event is probably SDIOWAIT_TIMEOUT */ - fdbg("ERROR: Awakened with %02x\n", wkupevent); + ferr("ERROR: Awakened with %02x\n", wkupevent); return wkupevent & SDIOWAIT_TIMEOUT ? -ETIMEDOUT : -EIO; } @@ -1129,7 +1129,7 @@ static int mmcsd_transferready(FAR struct mmcsd_state_s *priv) if (!SDIO_PRESENT(priv->dev)) { - fdbg("ERROR: Card has been removed\n"); + ferr("ERROR: Card has been removed\n"); return -ENODEV; } @@ -1158,7 +1158,7 @@ static int mmcsd_transferready(FAR struct mmcsd_state_s *priv) MMCSD_BLOCK_WDATADELAY); if (ret != OK) { - fdbg("ERROR: mmcsd_eventwait for transfer ready failed: %d\n", ret); + ferr("ERROR: mmcsd_eventwait for transfer ready failed: %d\n", ret); } #endif @@ -1170,7 +1170,7 @@ static int mmcsd_transferready(FAR struct mmcsd_state_s *priv) ret = mmcsd_getR1(priv, &r1); if (ret != OK) { - fdbg("ERROR: mmcsd_getR1 failed: %d\n", ret); + ferr("ERROR: mmcsd_getR1 failed: %d\n", ret); return ret; } @@ -1197,7 +1197,7 @@ static int mmcsd_transferready(FAR struct mmcsd_state_s *priv) * if this error occurs. */ - fdbg("ERROR: Unexpected R1 state: %08x\n", r1); + ferr("ERROR: Unexpected R1 state: %08x\n", r1); return -EINVAL; } @@ -1231,7 +1231,7 @@ static int mmcsd_stoptransmission(FAR struct mmcsd_state_s *priv) ret = mmcsd_recvR1(priv, MMCSD_CMD12); if (ret != OK) { - fdbg("ERROR: mmcsd_recvR1 for CMD12 failed: %d\n", ret); + ferr("ERROR: mmcsd_recvR1 for CMD12 failed: %d\n", ret); } return ret; @@ -1267,7 +1267,7 @@ static int mmcsd_setblocklen(FAR struct mmcsd_state_s *priv, uint32_t blocklen) } else { - fdbg("ERROR: mmcsd_recvR1 for CMD16 failed: %d\n", ret); + ferr("ERROR: mmcsd_recvR1 for CMD16 failed: %d\n", ret); } } @@ -1295,7 +1295,7 @@ static ssize_t mmcsd_readsingle(FAR struct mmcsd_state_s *priv, if (priv->locked) { - fdbg("ERROR: Card is locked\n"); + ferr("ERROR: Card is locked\n"); return -EPERM; } @@ -1325,7 +1325,7 @@ static ssize_t mmcsd_readsingle(FAR struct mmcsd_state_s *priv, ret = mmcsd_transferready(priv); if (ret != OK) { - fdbg("ERROR: Card not ready: %d\n", ret); + ferr("ERROR: Card not ready: %d\n", ret); return ret; } @@ -1349,7 +1349,7 @@ static ssize_t mmcsd_readsingle(FAR struct mmcsd_state_s *priv, ret = mmcsd_setblocklen(priv, priv->blocksize); if (ret != OK) { - fdbg("ERROR: mmcsd_setblocklen failed: %d\n", ret); + ferr("ERROR: mmcsd_setblocklen failed: %d\n", ret); return ret; } @@ -1385,7 +1385,7 @@ static ssize_t mmcsd_readsingle(FAR struct mmcsd_state_s *priv, ret = mmcsd_recvR1(priv, MMCSD_CMD17); if (ret != OK) { - fdbg("ERROR: mmcsd_recvR1 for CMD17 failed: %d\n", ret); + ferr("ERROR: mmcsd_recvR1 for CMD17 failed: %d\n", ret); SDIO_CANCEL(priv->dev); return ret; } @@ -1396,7 +1396,7 @@ static ssize_t mmcsd_readsingle(FAR struct mmcsd_state_s *priv, MMCSD_BLOCK_RDATADELAY); if (ret != OK) { - fdbg("ERROR: CMD17 transfer failed: %d\n", ret); + ferr("ERROR: CMD17 transfer failed: %d\n", ret); return ret; } @@ -1429,7 +1429,7 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv, if (priv->locked) { - fdbg("ERROR: Card is locked\n"); + ferr("ERROR: Card is locked\n"); return -EPERM; } @@ -1459,7 +1459,7 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv, ret = mmcsd_transferready(priv); if (ret != OK) { - fdbg("ERROR: Card not ready: %d\n", ret); + ferr("ERROR: Card not ready: %d\n", ret); return ret; } @@ -1483,7 +1483,7 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv, ret = mmcsd_setblocklen(priv, priv->blocksize); if (ret != OK) { - fdbg("ERROR: mmcsd_setblocklen failed: %d\n", ret); + ferr("ERROR: mmcsd_setblocklen failed: %d\n", ret); return ret; } @@ -1517,7 +1517,7 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv, ret = mmcsd_recvR1(priv, MMCSD_CMD18); if (ret != OK) { - fdbg("ERROR: mmcsd_recvR1 for CMD18 failed: %d\n", ret); + ferr("ERROR: mmcsd_recvR1 for CMD18 failed: %d\n", ret); SDIO_CANCEL(priv->dev); return ret; } @@ -1528,7 +1528,7 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv, nblocks * MMCSD_BLOCK_RDATADELAY); if (ret != OK) { - fdbg("ERROR: CMD18 transfer failed: %d\n", ret); + ferr("ERROR: CMD18 transfer failed: %d\n", ret); return ret; } @@ -1537,7 +1537,7 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv, ret = mmcsd_stoptransmission(priv); if (ret != OK) { - fdbg("ERROR: mmcsd_stoptransmission failed: %d\n", ret); + ferr("ERROR: mmcsd_stoptransmission failed: %d\n", ret); } /* On success, return the number of blocks read */ @@ -1634,7 +1634,7 @@ static ssize_t mmcsd_writesingle(FAR struct mmcsd_state_s *priv, if (mmcsd_wrprotected(priv)) { - fdbg("ERROR: Card is locked or write protected\n"); + ferr("ERROR: Card is locked or write protected\n"); return -EPERM; } @@ -1664,7 +1664,7 @@ static ssize_t mmcsd_writesingle(FAR struct mmcsd_state_s *priv, ret = mmcsd_transferready(priv); if (ret != OK) { - fdbg("ERROR: Card not ready: %d\n", ret); + ferr("ERROR: Card not ready: %d\n", ret); return ret; } @@ -1688,7 +1688,7 @@ static ssize_t mmcsd_writesingle(FAR struct mmcsd_state_s *priv, ret = mmcsd_setblocklen(priv, priv->blocksize); if (ret != OK) { - fdbg("ERROR: mmcsd_setblocklen failed: %d\n", ret); + ferr("ERROR: mmcsd_setblocklen failed: %d\n", ret); return ret; } @@ -1698,7 +1698,7 @@ static ssize_t mmcsd_writesingle(FAR struct mmcsd_state_s *priv, ret = mmcsd_recvR1(priv, MMCSD_CMD24); if (ret != OK) { - fdbg("ERROR: mmcsd_recvR1 for CMD24 failed: %d\n", ret); + ferr("ERROR: mmcsd_recvR1 for CMD24 failed: %d\n", ret); return ret; } @@ -1735,7 +1735,7 @@ static ssize_t mmcsd_writesingle(FAR struct mmcsd_state_s *priv, SDIOWAIT_TIMEOUT | SDIOWAIT_ERROR, MMCSD_BLOCK_WDATADELAY); if (ret != OK) { - fdbg("ERROR: CMD24 transfer failed: %d\n", ret); + ferr("ERROR: CMD24 transfer failed: %d\n", ret); return ret; } @@ -1777,7 +1777,7 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv, if (mmcsd_wrprotected(priv)) { - fdbg("ERROR: Card is locked or write protected\n"); + ferr("ERROR: Card is locked or write protected\n"); return -EPERM; } @@ -1807,7 +1807,7 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv, ret = mmcsd_transferready(priv); if (ret != OK) { - fdbg("ERROR: Card not ready: %d\n", ret); + ferr("ERROR: Card not ready: %d\n", ret); return ret; } @@ -1832,7 +1832,7 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv, ret = mmcsd_setblocklen(priv, priv->blocksize); if (ret != OK) { - fdbg("ERROR: mmcsd_setblocklen failed: %d\n", ret); + ferr("ERROR: mmcsd_setblocklen failed: %d\n", ret); return ret; } @@ -1850,7 +1850,7 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv, ret = mmcsd_recvR1(priv, SD_CMD55); if (ret != OK) { - fdbg("ERROR: mmcsd_recvR1 for CMD55 (ACMD23) failed: %d\n", ret); + ferr("ERROR: mmcsd_recvR1 for CMD55 (ACMD23) failed: %d\n", ret); return ret; } @@ -1860,7 +1860,7 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv, ret = mmcsd_recvR1(priv, SD_ACMD23); if (ret != OK) { - fdbg("ERROR: mmcsd_recvR1 for ACMD23 failed: %d\n", ret); + ferr("ERROR: mmcsd_recvR1 for ACMD23 failed: %d\n", ret); return ret; } } @@ -1900,7 +1900,7 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv, ret = mmcsd_recvR1(priv, MMCSD_CMD25); if (ret != OK) { - fdbg("ERROR: mmcsd_recvR1 for CMD25 failed: %d\n", ret); + ferr("ERROR: mmcsd_recvR1 for CMD25 failed: %d\n", ret); return ret; } @@ -1909,7 +1909,7 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv, ret = mmcsd_eventwait(priv, SDIOWAIT_TIMEOUT | SDIOWAIT_ERROR, nblocks * MMCSD_BLOCK_WDATADELAY); if (ret != OK) { - fdbg("ERROR: CMD18 transfer failed: %d\n", ret); + ferr("ERROR: CMD18 transfer failed: %d\n", ret); return ret; } @@ -1918,7 +1918,7 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv, ret = mmcsd_stoptransmission(priv); if (ret != OK) { - fdbg("ERROR: mmcsd_stoptransmission failed: %d\n", ret); + ferr("ERROR: mmcsd_stoptransmission failed: %d\n", ret); return ret; } @@ -2276,7 +2276,7 @@ static int mmcsd_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) ret = mmcsd_probe(priv); if (ret != OK) { - fdbg("ERROR: mmcsd_probe failed: %d\n", ret); + ferr("ERROR: mmcsd_probe failed: %d\n", ret); } } break; @@ -2290,7 +2290,7 @@ static int mmcsd_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) ret = mmcsd_removed(priv); if (ret != OK) { - fdbg("ERROR: mmcsd_removed failed: %d\n", ret); + ferr("ERROR: mmcsd_removed failed: %d\n", ret); } /* Enable logic to detect if a card is re-inserted */ @@ -2396,7 +2396,7 @@ static int mmcsd_widebus(FAR struct mmcsd_state_s *priv) ret = mmcsd_recvR1(priv, SD_CMD55); if (ret != OK) { - fdbg("ERROR: RECVR1 for CMD55 of ACMD42: %d\n", ret); + ferr("ERROR: RECVR1 for CMD55 of ACMD42: %d\n", ret); return ret; } @@ -2423,7 +2423,7 @@ static int mmcsd_widebus(FAR struct mmcsd_state_s *priv) ret = mmcsd_recvR1(priv, SD_CMD55); if (ret != OK) { - fdbg("ERROR: RECVR1 for CMD55 of ACMD6: %d\n", ret); + ferr("ERROR: RECVR1 for CMD55 of ACMD6: %d\n", ret); return ret; } @@ -2449,7 +2449,7 @@ static int mmcsd_widebus(FAR struct mmcsd_state_s *priv) /* Wide bus operation not supported */ - fdbg("WARNING: Card does not support wide-bus operation\n"); + ferr("WARNING: Card does not support wide-bus operation\n"); return -ENOSYS; #else /* CONFIG_SDIO_WIDTH_D1_ONLY */ @@ -2492,7 +2492,7 @@ static int mmcsd_mmcinitialize(FAR struct mmcsd_state_s *priv) ret = SDIO_RECVR2(priv->dev, MMCSD_CMD2, cid); if (ret != OK) { - fdbg("ERROR: SDIO_RECVR2 for MMC CID failed: %d\n", ret); + ferr("ERROR: SDIO_RECVR2 for MMC CID failed: %d\n", ret); return ret; } @@ -2508,7 +2508,7 @@ static int mmcsd_mmcinitialize(FAR struct mmcsd_state_s *priv) ret = mmcsd_recvR1(priv, MMC_CMD3); if (ret != OK) { - fdbg("ERROR: mmcsd_recvR1(CMD3) failed: %d\n", ret); + ferr("ERROR: mmcsd_recvR1(CMD3) failed: %d\n", ret); return ret; } @@ -2522,7 +2522,7 @@ static int mmcsd_mmcinitialize(FAR struct mmcsd_state_s *priv) ret = mmcsd_verifystate(priv, MMCSD_R1_STATE_STBY); if (ret != OK) { - fdbg("ERROR: Failed to enter standby state\n"); + ferr("ERROR: Failed to enter standby state\n"); return ret; } @@ -2535,7 +2535,7 @@ static int mmcsd_mmcinitialize(FAR struct mmcsd_state_s *priv) ret = SDIO_RECVR2(priv->dev, MMCSD_CMD9, csd); if (ret != OK) { - fdbg("ERROR: Could not get SD CSD register: %d\n", ret); + ferr("ERROR: Could not get SD CSD register: %d\n", ret); return ret; } @@ -2593,7 +2593,7 @@ static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv) ret = SDIO_RECVR2(priv->dev, MMCSD_CMD2, cid); if (ret != OK) { - fdbg("ERROR: SDIO_RECVR2 for SD CID failed: %d\n", ret); + ferr("ERROR: SDIO_RECVR2 for SD CID failed: %d\n", ret); return ret; } @@ -2611,7 +2611,7 @@ static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv) ret = mmcsd_recvR6(priv, SD_CMD3); if (ret != OK) { - fdbg("ERROR: mmcsd_recvR2 for SD RCA failed: %d\n", ret); + ferr("ERROR: mmcsd_recvR2 for SD RCA failed: %d\n", ret); return ret; } @@ -2627,7 +2627,7 @@ static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv) ret = mmcsd_verifystate(priv, MMCSD_R1_STATE_STBY); if (ret != OK) { - fdbg("ERROR: Failed to enter standby state\n"); + ferr("ERROR: Failed to enter standby state\n"); return ret; } @@ -2641,7 +2641,7 @@ static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv) ret = SDIO_RECVR2(priv->dev, MMCSD_CMD9, csd); if (ret != OK) { - fdbg("ERROR: Could not get SD CSD register(%d)\n", ret); + ferr("ERROR: Could not get SD CSD register(%d)\n", ret); return ret; } @@ -2656,7 +2656,7 @@ static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv) ret = mmcsd_recvR1(priv, MMCSD_CMD7S); if (ret != OK) { - fdbg("ERROR: mmcsd_recvR1 for CMD7 failed: %d\n", ret); + ferr("ERROR: mmcsd_recvR1 for CMD7 failed: %d\n", ret); return ret; } @@ -2680,7 +2680,7 @@ static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv) ret = mmcsd_getSCR(priv, scr); if (ret != OK) { - fdbg("ERROR: Could not get SD SCR register(%d)\n", ret); + ferr("ERROR: Could not get SD SCR register(%d)\n", ret); return ret; } @@ -2691,7 +2691,7 @@ static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv) ret = mmcsd_widebus(priv); if (ret != OK) { - fdbg("WARN: Failed to set wide bus operation: %d\n", ret); + ferr("WARN: Failed to set wide bus operation: %d\n", ret); } /* TODO: If wide-bus selected, then send CMD6 to see if the card supports @@ -2785,7 +2785,7 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv) } else { - fdbg("ERROR: R7: %08x\n", response); + ferr("ERROR: R7: %08x\n", response); return -EIO; } } @@ -2820,7 +2820,7 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv) * the MMC vs. SD decision based on CMD1 and ACMD41. */ - fdbg("ERROR: mmcsd_recvR1(CMD55) failed: %d\n", ret); + ferr("ERROR: mmcsd_recvR1(CMD55) failed: %d\n", ret); } else { @@ -2835,7 +2835,7 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv) * but we will make the decision based on CMD1 below */ - fdbg("ERROR: ACMD41 RECVR3: %d\n", ret); + ferr("ERROR: ACMD41 RECVR3: %d\n", ret); } else { @@ -2912,13 +2912,13 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv) if (ret != OK) { - fdbg("ERROR: CMD1 RECVR3: %d\n", ret); + ferr("ERROR: CMD1 RECVR3: %d\n", ret); } else { /* CMD1 succeeded... this must be an MMC card */ - fdbg("CMD1 succeeded, assuming MMC card\n"); + ferr("CMD1 succeeded, assuming MMC card\n"); priv->type = MMCSD_CARDTYPE_MMC; /* Check if the card is busy. Very confusing, BUSY is set LOW @@ -2955,7 +2955,7 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv) if (elapsed >= TICK_PER_SEC || priv->type == MMCSD_CARDTYPE_UNKNOWN) { - fdbg("ERROR: Failed to identify card\n"); + ferr("ERROR: Failed to identify card\n"); return -EIO; } @@ -3010,7 +3010,7 @@ static int mmcsd_probe(FAR struct mmcsd_state_s *priv) ret = mmcsd_cardidentify(priv); if (ret != OK) { - fdbg("ERROR: Failed to initialize card: %d\n", ret); + ferr("ERROR: Failed to initialize card: %d\n", ret); #ifdef CONFIG_MMCSD_HAVECARDDETECT SDIO_CALLBACKENABLE(priv->dev, SDIOMEDIA_INSERTED); #endif @@ -3034,7 +3034,7 @@ static int mmcsd_probe(FAR struct mmcsd_state_s *priv) #endif case MMCSD_CARDTYPE_UNKNOWN: /* Unknown card type */ default: - fdbg("ERROR: Internal confusion: %d\n", priv->type); + ferr("ERROR: Internal confusion: %d\n", priv->type); ret = -EPERM; break; } @@ -3138,7 +3138,7 @@ static int mmcsd_hwinitialize(FAR struct mmcsd_state_s *priv) if (SDIO_ATTACH(priv->dev)) { - fdbg("ERROR: Unable to attach MMC/SD interrupts\n"); + ferr("ERROR: Unable to attach MMC/SD interrupts\n"); mmcsd_givesem(priv); return -EBUSY; } @@ -3299,7 +3299,7 @@ int mmcsd_slotinitialize(int minor, FAR struct sdio_dev_s *dev) { /* Some other non-recoverable bad thing happened */ - fdbg("ERROR: Failed to initialize MMC/SD slot: %d\n", ret); + ferr("ERROR: Failed to initialize MMC/SD slot: %d\n", ret); goto errout_with_alloc; } } @@ -3311,7 +3311,7 @@ int mmcsd_slotinitialize(int minor, FAR struct sdio_dev_s *dev) ret = rwb_initialize(&priv->rwbuffer); if (ret < 0) { - fdbg("ERROR: Buffer setup failed: %d\n", ret); + ferr("ERROR: Buffer setup failed: %d\n", ret); goto errout_with_hwinit; } #endif @@ -3325,7 +3325,7 @@ int mmcsd_slotinitialize(int minor, FAR struct sdio_dev_s *dev) ret = register_blockdriver(devname, &g_bops, 0, priv); if (ret < 0) { - fdbg("ERROR: register_blockdriver failed: %d\n", ret); + ferr("ERROR: register_blockdriver failed: %d\n", ret); goto errout_with_buffers; } } diff --git a/drivers/mmcsd/mmcsd_spi.c b/drivers/mmcsd/mmcsd_spi.c index 082ff094b0..80ec787063 100644 --- a/drivers/mmcsd/mmcsd_spi.c +++ b/drivers/mmcsd/mmcsd_spi.c @@ -431,7 +431,7 @@ static int mmcsd_waitready(FAR struct mmcsd_slot_s *slot) } while (elapsed < MMCSD_DELAY_500MS); - fdbg("Card still busy, last response: %02x\n", response); + ferr("Card still busy, last response: %02x\n", response); return -EBUSY; } @@ -504,7 +504,7 @@ static uint32_t mmcsd_sendcmd(FAR struct mmcsd_slot_s *slot, if ((response & 0x80) != 0) { - fdbg("Failed: i=%d response=%02x\n", i, response); + ferr("Failed: i=%d response=%02x\n", i, response); return (uint32_t)-1; } @@ -531,7 +531,7 @@ static uint32_t mmcsd_sendcmd(FAR struct mmcsd_slot_s *slot, if (busy != 0xff) { - fdbg("Failed: card still busy (%02x)\n", busy); + ferr("Failed: card still busy (%02x)\n", busy); return (uint32_t)-1; } @@ -613,7 +613,7 @@ static void mmcsd_setblklen(FAR struct mmcsd_slot_s *slot, uint32_t length) response = mmcsd_sendcmd(slot, &g_cmd16, length); if (response != MMCSD_SPIR1_OK) { - fdbg("Failed to set block length: %02x\n", response); + ferr("Failed to set block length: %02x\n", response); } } @@ -813,7 +813,7 @@ static void mmcsd_decodecsd(FAR struct mmcsd_slot_s *slot, uint8_t *csd) { if (readbllen > 9) { - fdbg("Forcing 512 byte sector size\n"); + ferr("Forcing 512 byte sector size\n"); csizemult += (readbllen - 9); readbllen = 9; } @@ -880,7 +880,7 @@ static int mmcsd_getcardinfo(FAR struct mmcsd_slot_s *slot, uint8_t *buffer, result = mmcsd_sendcmd(slot, cmd, 0); if (result != MMCSD_SPIR1_OK) { - fdbg("CMD9/10 failed: R1=%02x\n", result); + ferr("CMD9/10 failed: R1=%02x\n", result); return -EIO; } @@ -898,7 +898,7 @@ static int mmcsd_getcardinfo(FAR struct mmcsd_slot_s *slot, uint8_t *buffer, if (response != 0 && (response & MMCSD_SPIDET_UPPER) == 0) { - fdbg("%d. Data transfer error: %02x\n", i, response); + ferr("%d. Data transfer error: %02x\n", i, response); return -EIO; } else if (response == MMCSD_SPIDT_STARTBLKSNGL) @@ -916,7 +916,7 @@ static int mmcsd_getcardinfo(FAR struct mmcsd_slot_s *slot, uint8_t *buffer, } } - fdbg("%d. Did not find start of block\n"); + ferr("%d. Did not find start of block\n"); return -EIO; } @@ -960,7 +960,7 @@ static int mmcsd_recvblock(FAR struct mmcsd_slot_s *slot, uint8_t *buffer, return OK; } - fdbg("Did not receive data token (%02x)\n", token); + ferr("Did not receive data token (%02x)\n", token); return ERROR; } @@ -1004,7 +1004,7 @@ static int mmcsd_xmitblock(FAR struct mmcsd_slot_s *slot, response = SPI_SEND(spi, 0xff); if ((response & MMCSD_SPIDR_MASK) != MMCSD_SPIDR_ACCEPTED) { - fdbg("Bad data response: %02x\n", response); + ferr("Bad data response: %02x\n", response); return -EIO; } @@ -1034,7 +1034,7 @@ static int mmcsd_open(FAR struct inode *inode) #ifdef CONFIG_DEBUG_FEATURES if (!inode || !inode->i_private) { - fdbg("Internal confusion\n"); + ferr("Internal confusion\n"); return -EIO; } #endif @@ -1047,7 +1047,7 @@ static int mmcsd_open(FAR struct inode *inode) #ifdef CONFIG_DEBUG_FEATURES if (!spi) { - fdbg("Internal confusion\n"); + ferr("Internal confusion\n"); return -EIO; } #endif @@ -1119,13 +1119,13 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer, #ifdef CONFIG_DEBUG_FEATURES if (!buffer) { - fdbg("Invalid parameters\n"); + ferr("Invalid parameters\n"); return -EINVAL; } if (!inode || !inode->i_private) { - fdbg("Internal confusion\n"); + ferr("Internal confusion\n"); return -EIO; } #endif @@ -1138,7 +1138,7 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer, #ifdef CONFIG_DEBUG_FEATURES if (!spi) { - fdbg("Internal confusion\n"); + ferr("Internal confusion\n"); return -EIO; } #endif @@ -1147,7 +1147,7 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer, if (slot->state & MMCSD_SLOTSTATUS_NOTREADY) { - fdbg("Slot not ready\n"); + ferr("Slot not ready\n"); return -ENODEV; } @@ -1190,7 +1190,7 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer, response = mmcsd_sendcmd(slot, &g_cmd17, offset); if (response != MMCSD_SPIR1_OK) { - fdbg("CMD17 failed: R1=%02x\n", response); + ferr("CMD17 failed: R1=%02x\n", response); goto errout_with_eio; } @@ -1198,7 +1198,7 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer, if (mmcsd_recvblock(slot, buffer, SECTORSIZE(slot)) != 0) { - fdbg("Failed: to receive the block\n"); + ferr("Failed: to receive the block\n"); goto errout_with_eio; } } @@ -1211,7 +1211,7 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer, response = mmcsd_sendcmd(slot, &g_cmd18, offset); if (response != MMCSD_SPIR1_OK) { - fdbg("CMD18 failed: R1=%02x\n", response); + ferr("CMD18 failed: R1=%02x\n", response); goto errout_with_eio; } @@ -1221,7 +1221,7 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer, { if (mmcsd_recvblock(slot, buffer, SECTORSIZE(slot)) != 0) { - fdbg("Failed: to receive the block\n"); + ferr("Failed: to receive the block\n"); goto errout_with_eio; } @@ -1273,13 +1273,13 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer, #ifdef CONFIG_DEBUG_FEATURES if (!buffer) { - fdbg("Invalid parameters\n"); + ferr("Invalid parameters\n"); return -EINVAL; } if (!inode || !inode->i_private) { - fdbg("Internal confusion\n"); + ferr("Internal confusion\n"); return -EIO; } #endif @@ -1292,7 +1292,7 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer, #ifdef CONFIG_DEBUG_FEATURES if (!spi) { - fdbg("Internal confusion\n"); + ferr("Internal confusion\n"); return -EIO; } #endif @@ -1301,7 +1301,7 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer, if (slot->state & MMCSD_SLOTSTATUS_NOTREADY) { - fdbg("Slot not ready\n"); + ferr("Slot not ready\n"); return -ENODEV; } @@ -1309,7 +1309,7 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer, if (slot->state & MMCSD_SLOTSTATUS_WRPROTECT) { - fdbg("Not write enabled\n"); + ferr("Not write enabled\n"); return -EACCES; } @@ -1352,7 +1352,7 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer, response = mmcsd_sendcmd(slot, &g_cmd24, offset); if (response != MMCSD_SPIR1_OK) { - fdbg("CMD24 failed: R1=%02x\n", response); + ferr("CMD24 failed: R1=%02x\n", response); goto errout_with_sem; } @@ -1360,7 +1360,7 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer, if (mmcsd_xmitblock(slot, buffer, SECTORSIZE(slot), 0xfe) != 0) { - fdbg("Block transfer failed\n"); + ferr("Block transfer failed\n"); goto errout_with_sem; } } @@ -1373,14 +1373,14 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer, response = mmcsd_sendcmd(slot, &g_cmd55, 0); if (response != MMCSD_SPIR1_OK) { - fdbg("CMD55 failed: R1=%02x\n", response); + ferr("CMD55 failed: R1=%02x\n", response); goto errout_with_sem; } response = mmcsd_sendcmd(slot, &g_acmd23, nsectors); if (response != MMCSD_SPIR1_OK) { - fdbg("ACMD23 failed: R1=%02x\n", response); + ferr("ACMD23 failed: R1=%02x\n", response); goto errout_with_sem; } } @@ -1392,7 +1392,7 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer, response = mmcsd_sendcmd(slot, &g_cmd25, offset); if (response != MMCSD_SPIR1_OK) { - fdbg("CMD25 failed: R1=%02x\n", response); + ferr("CMD25 failed: R1=%02x\n", response); goto errout_with_sem; } @@ -1402,14 +1402,14 @@ static ssize_t mmcsd_write(FAR struct inode *inode, const unsigned char *buffer, { if (mmcsd_xmitblock(slot, buffer, SECTORSIZE(slot), 0xfc) != 0) { - fdbg("Failed: to receive the block\n"); + ferr("Failed: to receive the block\n"); goto errout_with_sem; } buffer += SECTORSIZE(slot); if (mmcsd_waitready(slot) != OK) { - fdbg("Failed: card is busy\n"); + ferr("Failed: card is busy\n"); goto errout_with_sem; } } @@ -1455,13 +1455,13 @@ static int mmcsd_geometry(FAR struct inode *inode, struct geometry *geometry) #ifdef CONFIG_DEBUG_FEATURES if (!geometry) { - fdbg("Invalid parameters\n"); + ferr("Invalid parameters\n"); return -EINVAL; } if (!inode || !inode->i_private) { - fdbg("Internal confusion\n"); + ferr("Internal confusion\n"); return -EIO; } #endif @@ -1474,7 +1474,7 @@ static int mmcsd_geometry(FAR struct inode *inode, struct geometry *geometry) #ifdef CONFIG_DEBUG_FEATURES if (!spi) { - fdbg("Internal confusion\n"); + ferr("Internal confusion\n"); return -EIO; } #endif @@ -1489,7 +1489,7 @@ static int mmcsd_geometry(FAR struct inode *inode, struct geometry *geometry) if (ret < 0) { mmcsd_semgive(slot); - fdbg("mmcsd_getcsd returned %d\n", ret); + ferr("mmcsd_getcsd returned %d\n", ret); return ret; } @@ -1566,7 +1566,7 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot) if ((SPI_STATUS(spi, SPIDEV_MMCSD) & SPI_STATUS_PRESENT) == 0) { - fdbg("No card present\n"); + ferr("No card present\n"); slot->state |= MMCSD_SLOTSTATUS_NODISK; return -ENODEV; } @@ -1621,7 +1621,7 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot) if (result != MMCSD_SPIR1_IDLESTATE) { - fdbg("Send CMD0 failed: R1=%02x\n", result); + ferr("Send CMD0 failed: R1=%02x\n", result); SPI_SELECT(spi, SPIDEV_MMCSD, false); mmcsd_semgive(slot); return -EIO; @@ -1678,12 +1678,12 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot) finfo("OCR: %08x\n", slot->ocr); if ((slot->ocr & MMCSD_OCR_CCS) != 0) { - fdbg("Identified SD ver2 card/with block access\n"); + ferr("Identified SD ver2 card/with block access\n"); slot->type = MMCSD_CARDTYPE_SDV2 | MMCSD_CARDTYPE_BLOCK; } else { - fdbg("Identified SD ver2 card\n"); + ferr("Identified SD ver2 card\n"); slot->type = MMCSD_CARDTYPE_SDV2; } } @@ -1706,7 +1706,7 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot) result = mmcsd_sendcmd(slot, &g_acmd41, 0); if (result == MMCSD_SPIR1_IDLESTATE || result == MMCSD_SPIR1_OK) { - fdbg("Identified SD ver1 card\n"); + ferr("Identified SD ver1 card\n"); slot->type = MMCSD_CARDTYPE_SDV1; } } @@ -1736,7 +1736,7 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot) result = mmcsd_sendcmd(slot, &g_cmd1, 0); if (result == MMCSD_SPIR1_OK) { - fdbg("%d. Identified MMC card\n", i); + ferr("%d. Identified MMC card\n", i); slot->type = MMCSD_CARDTYPE_MMC; break; } @@ -1748,7 +1748,7 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot) if (elapsed >= MMCSD_DELAY_1SEC) { - fdbg("Failed to exit IDLE state\n"); + ferr("Failed to exit IDLE state\n"); SPI_SELECT(spi, SPIDEV_MMCSD, false); mmcsd_semgive(slot); return -EIO; @@ -1757,7 +1757,7 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot) if (slot->type == MMCSD_CARDTYPE_UNKNOWN) { - fdbg("Failed to identify card\n"); + ferr("Failed to identify card\n"); SPI_SELECT(spi, SPIDEV_MMCSD, false); mmcsd_semgive(slot); return -EIO; @@ -1769,7 +1769,7 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot) result = mmcsd_getcsd(slot, csd); if (result != OK) { - fdbg("mmcsd_getcsd(CMD9) failed: %d\n", result); + ferr("mmcsd_getcsd(CMD9) failed: %d\n", result); SPI_SELECT(spi, SPIDEV_MMCSD, false); mmcsd_semgive(slot); return -EIO; @@ -1836,7 +1836,7 @@ static void mmcsd_mediachanged(void *arg) #ifdef CONFIG_DEBUG_FEATURES if (!slot || !slot->spi) { - fdbg("Internal confusion\n"); + ferr("Internal confusion\n"); return; } #endif @@ -1857,7 +1857,7 @@ static void mmcsd_mediachanged(void *arg) { /* Media is not present */ - fdbg("No card present\n"); + ferr("No card present\n"); slot->state |= (MMCSD_SLOTSTATUS_NODISK | MMCSD_SLOTSTATUS_NOTREADY); /* Was media removed? */ @@ -1918,7 +1918,7 @@ int mmcsd_spislotinitialize(int minor, int slotno, FAR struct spi_dev_s *spi) #ifdef CONFIG_DEBUG_FEATURES if ((unsigned)slotno >= CONFIG_MMCSD_NSLOTS || (unsigned)minor > 255 || !spi) { - fdbg("Invalid arguments\n"); + ferr("Invalid arguments\n"); return -EINVAL; } #endif @@ -1932,7 +1932,7 @@ int mmcsd_spislotinitialize(int minor, int slotno, FAR struct spi_dev_s *spi) #ifdef CONFIG_DEBUG_FEATURES if (slot->spi) { - fdbg("Already registered\n"); + ferr("Already registered\n"); return -EBUSY; } #endif @@ -1969,7 +1969,7 @@ int mmcsd_spislotinitialize(int minor, int slotno, FAR struct spi_dev_s *spi) ret = register_blockdriver(devname, &g_bops, MMCSD_MODE, slot); if (ret < 0) { - fdbg("register_blockdriver failed: %d\n", -ret); + ferr("register_blockdriver failed: %d\n", -ret); slot->spi = NULL; return ret; } diff --git a/drivers/modem/u-blox.c b/drivers/modem/u-blox.c index fac7ec1ce2..cfdfdc733f 100644 --- a/drivers/modem/u-blox.c +++ b/drivers/modem/u-blox.c @@ -58,12 +58,12 @@ /* Non-standard debug that may be enabled just for testing the modem driver */ #ifdef CONFIG_MODEM_U_BLOX_DEBUG -# define m_dbg dbg +# define m_err err # define m_info info # define m_vllerr llerr # define m_vllinfo llinfo #else -# define m_dbg(x...) +# define m_err(x...) # define m_info(x...) # define m_llerr(x...) # define m_llinfo(x...) @@ -286,7 +286,7 @@ FAR void* ubxmdm_register(FAR const char *path, kmm_zalloc(sizeof(struct ubxmdm_upper)); if (!upper) { - m_dbg("Upper half allocation failed\n"); + m_err("Upper half allocation failed\n"); goto errout; } @@ -294,14 +294,14 @@ FAR void* ubxmdm_register(FAR const char *path, upper->path = strdup(path); if (!upper->path) { - m_dbg("Path allocation failed\n"); + m_err("Path allocation failed\n"); goto errout_with_upper; } ret = register_driver(path, &ubxmdm_fops, 0666, upper); if (ret < 0) { - m_dbg("register_driver failed: %d\n", ret); + m_err("register_driver failed: %d\n", ret); goto errout_with_path; } diff --git a/drivers/mtd/at24xx.c b/drivers/mtd/at24xx.c index a7b38883e5..91c8951193 100644 --- a/drivers/mtd/at24xx.c +++ b/drivers/mtd/at24xx.c @@ -622,7 +622,7 @@ FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_master_s *dev) priv = (FAR struct at24c_dev_s *)kmm_zalloc(sizeof(struct at24c_dev_s)); if (priv == NULL) { - fdbg("ERROR: Failed to allocate device structure\n"); + ferr("ERROR: Failed to allocate device structure\n"); return NULL; } diff --git a/drivers/mtd/at25.c b/drivers/mtd/at25.c index 9b1efde666..efc2e355a7 100644 --- a/drivers/mtd/at25.c +++ b/drivers/mtd/at25.c @@ -292,7 +292,7 @@ static void at25_waitwritecomplete(struct at25_dev_s *priv) if (status & AT25_SR_EPE) { - fdbg("ERROR: Write error, status: 0x%02x\n", status); + ferr("ERROR: Write error, status: 0x%02x\n", status); } finfo("Complete, status: 0x%02x\n", status); @@ -671,7 +671,7 @@ FAR struct mtd_dev_s *at25_initialize(FAR struct spi_dev_s *dev) { /* Unrecognized! Discard all of that work we just did and return NULL */ - fdbg("ERROR: Unrecognized\n"); + ferr("ERROR: Unrecognized\n"); kmm_free(priv); priv = NULL; } diff --git a/drivers/mtd/at45db.c b/drivers/mtd/at45db.c index 4fac5863b3..fd928bacff 100644 --- a/drivers/mtd/at45db.c +++ b/drivers/mtd/at45db.c @@ -869,7 +869,7 @@ FAR struct mtd_dev_s *at45db_initialize(FAR struct spi_dev_s *spi) { /* Unrecognized! Discard all of that work we just did and return NULL */ - fdbg("Unrecognized\n"); + ferr("Unrecognized\n"); goto errout; } @@ -887,7 +887,7 @@ FAR struct mtd_dev_s *at45db_initialize(FAR struct spi_dev_s *spi) * is required after the device has be re-programmed. */ - fdbg("Reprogramming page size\n"); + ferr("Reprogramming page size\n"); SPI_SELECT(priv->spi, SPIDEV_FLASH, true); SPI_SNDBLOCK(priv->spi, g_binpgsize, BINPGSIZE_SIZE); SPI_SELECT(priv->spi, SPIDEV_FLASH, false); diff --git a/drivers/mtd/filemtd.c b/drivers/mtd/filemtd.c index 89f6fb7b87..c1cd14fc6b 100644 --- a/drivers/mtd/filemtd.c +++ b/drivers/mtd/filemtd.c @@ -187,7 +187,7 @@ static ssize_t filemtd_write(FAR struct file_dev_s *priv, size_t offset, #ifdef CONFIG_DEBUG_FEATURES if (newvalue != srcvalue) { - dbg("ERROR: Bad write: source=%02x dest=%02x result=%02x\n", + err("ERROR: Bad write: source=%02x dest=%02x result=%02x\n", srcvalue, oldvalue, newvalue); } #endif @@ -498,7 +498,7 @@ FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, size_t offset, priv = (FAR struct file_dev_s *)kmm_zalloc(sizeof(struct file_dev_s)); if (!priv) { - fdbg("Failed to allocate the FILE MTD state structure\n"); + ferr("Failed to allocate the FILE MTD state structure\n"); return NULL; } @@ -514,7 +514,7 @@ FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, size_t offset, ret = stat(path, &sb); if (ret < 0) { - dbg("Failed to stat %s: %d\n", path, get_errno()); + err("Failed to stat %s: %d\n", path, get_errno()); return NULL; } @@ -525,7 +525,7 @@ FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, size_t offset, priv->fd = open(path, mode); if (priv->fd == -1) { - fdbg("Failed to open the FILE MTD file %s\n", path); + ferr("Failed to open the FILE MTD file %s\n", path); kmm_free(priv); return NULL; } @@ -557,7 +557,7 @@ FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, size_t offset, nblocks = (filelen - offset) / priv->erasesize; if (nblocks < 3) { - fdbg("Need to provide at least three full erase block\n"); + ferr("Need to provide at least three full erase block\n"); kmm_free(priv); return NULL; } diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c index 98e61cb578..fc11d3cc65 100644 --- a/drivers/mtd/ftl.c +++ b/drivers/mtd/ftl.c @@ -168,7 +168,7 @@ static ssize_t ftl_reload(FAR void *priv, FAR uint8_t *buffer, nread = MTD_BREAD(dev->mtd, startblock, nblocks, buffer); if (nread != nblocks) { - fdbg("Read %d blocks starting at block %d failed: %d\n", + ferr("Read %d blocks starting at block %d failed: %d\n", nblocks, startblock, nread); } @@ -244,7 +244,7 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer, nxfrd = MTD_BREAD(dev->mtd, rwblock, dev->blkper, dev->eblock); if (nxfrd != dev->blkper) { - fdbg("Read erase block %d failed: %d\n", rwblock, nxfrd); + ferr("Read erase block %d failed: %d\n", rwblock, nxfrd); return -EIO; } @@ -254,7 +254,7 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer, ret = MTD_ERASE(dev->mtd, eraseblock, 1); if (ret < 0) { - fdbg("Erase block=%d failed: %d\n", eraseblock, ret); + ferr("Erase block=%d failed: %d\n", eraseblock, ret); return ret; } @@ -281,7 +281,7 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer, nxfrd = MTD_BWRITE(dev->mtd, rwblock, dev->blkper, dev->eblock); if (nxfrd != dev->blkper) { - fdbg("Write erase block %d failed: %d\n", rwblock, nxfrd); + ferr("Write erase block %d failed: %d\n", rwblock, nxfrd); return -EIO; } @@ -309,7 +309,7 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer, ret = MTD_ERASE(dev->mtd, eraseblock, 1); if (ret < 0) { - fdbg("Erase block=%d failed: %d\n", eraseblock, ret); + ferr("Erase block=%d failed: %d\n", eraseblock, ret); return ret; } @@ -321,7 +321,7 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer, nxfrd = MTD_BWRITE(dev->mtd, alignedblock, dev->blkper, buffer); if (nxfrd != dev->blkper) { - fdbg("Write erase block %d failed: %d\n", alignedblock, nxfrd); + ferr("Write erase block %d failed: %d\n", alignedblock, nxfrd); return -EIO; } @@ -341,7 +341,7 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer, nxfrd = MTD_BREAD(dev->mtd, alignedblock, dev->blkper, dev->eblock); if (nxfrd != dev->blkper) { - fdbg("Read erase block %d failed: %d\n", alignedblock, nxfrd); + ferr("Read erase block %d failed: %d\n", alignedblock, nxfrd); return -EIO; } @@ -351,7 +351,7 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer, ret = MTD_ERASE(dev->mtd, eraseblock, 1); if (ret < 0) { - fdbg("Erase block=%d failed: %d\n", eraseblock, ret); + ferr("Erase block=%d failed: %d\n", eraseblock, ret); return ret; } @@ -367,7 +367,7 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer, nxfrd = MTD_BWRITE(dev->mtd, alignedblock, dev->blkper, dev->eblock); if (nxfrd != dev->blkper) { - fdbg("Write erase block %d failed: %d\n", alignedblock, nxfrd); + ferr("Write erase block %d failed: %d\n", alignedblock, nxfrd); return -EIO; } } @@ -469,7 +469,7 @@ static int ftl_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) #ifdef CONFIG_DEBUG_FEATURES if (arg == 0) { - fdbg("ERROR: BIOC_XIPBASE argument is NULL\n"); + ferr("ERROR: BIOC_XIPBASE argument is NULL\n"); return -EINVAL; } #endif @@ -488,7 +488,7 @@ static int ftl_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) ret = MTD_IOCTL(dev->mtd, cmd, arg); if (ret < 0) { - fdbg("ERROR: MTD ioctl(%04x) failed: %d\n", cmd, ret); + ferr("ERROR: MTD ioctl(%04x) failed: %d\n", cmd, ret); } return ret; @@ -543,7 +543,7 @@ int ftl_initialize(int minor, FAR struct mtd_dev_s *mtd) ret = MTD_IOCTL(mtd, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&dev->geo)); if (ret < 0) { - fdbg("MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", ret); + ferr("MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", ret); kmm_free(dev); return ret; } @@ -554,7 +554,7 @@ int ftl_initialize(int minor, FAR struct mtd_dev_s *mtd) dev->eblock = (FAR uint8_t *)kmm_malloc(dev->geo.erasesize); if (!dev->eblock) { - fdbg("Failed to allocate an erase block buffer\n"); + ferr("Failed to allocate an erase block buffer\n"); kmm_free(dev); return -ENOMEM; } @@ -585,7 +585,7 @@ int ftl_initialize(int minor, FAR struct mtd_dev_s *mtd) ret = rwb_initialize(&dev->rwb); if (ret < 0) { - fdbg("rwb_initialize failed: %d\n", ret); + ferr("rwb_initialize failed: %d\n", ret); kmm_free(dev); return ret; } @@ -600,7 +600,7 @@ int ftl_initialize(int minor, FAR struct mtd_dev_s *mtd) ret = register_blockdriver(devname, &g_bops, 0, dev); if (ret < 0) { - fdbg("register_blockdriver failed: %d\n", -ret); + ferr("register_blockdriver failed: %d\n", -ret); kmm_free(dev); } } diff --git a/drivers/mtd/hamming.c b/drivers/mtd/hamming.c index 087bd472be..4ea0c81bfa 100644 --- a/drivers/mtd/hamming.c +++ b/drivers/mtd/hamming.c @@ -333,7 +333,7 @@ static int hamming_verify256(FAR uint8_t *data, FAR const uint8_t *original) /* Correct bit */ - fdbg("Correcting byte %d at bit %d\n", byte, bit); + ferr("Correcting byte %d at bit %d\n", byte, bit); data[byte] ^= (1 << bit); return HAMMING_ERROR_SINGLEBIT; @@ -343,7 +343,7 @@ static int hamming_verify256(FAR uint8_t *data, FAR const uint8_t *original) if (hamming_bitsincode256(correction) == 1) { - fdbg("ERROR: ECC has been correupted\n"); + ferr("ERROR: ECC has been correupted\n"); return HAMMING_ERROR_ECC; } @@ -351,7 +351,7 @@ static int hamming_verify256(FAR uint8_t *data, FAR const uint8_t *original) else { - fdbg("ERROR: Multiple bit errors\n"); + ferr("ERROR: Multiple bit errors\n"); return HAMMING_ERROR_MULTIPLEBITS; } } diff --git a/drivers/mtd/is25xp.c b/drivers/mtd/is25xp.c index e26f859b49..1c4279ba86 100644 --- a/drivers/mtd/is25xp.c +++ b/drivers/mtd/is25xp.c @@ -976,7 +976,7 @@ FAR struct mtd_dev_s *is25xp_initialize(FAR struct spi_dev_s *dev) { /* Unrecognized! Discard all of that work we just did and return NULL */ - fdbg("Unrecognized\n"); + ferr("Unrecognized\n"); kmm_free(priv); priv = NULL; } diff --git a/drivers/mtd/m25px.c b/drivers/mtd/m25px.c index c1b523541b..addfd85f49 100644 --- a/drivers/mtd/m25px.c +++ b/drivers/mtd/m25px.c @@ -1031,7 +1031,7 @@ FAR struct mtd_dev_s *m25p_initialize(FAR struct spi_dev_s *dev) { /* Unrecognized! Discard all of that work we just did and return NULL */ - fdbg("Unrecognized\n"); + ferr("Unrecognized\n"); kmm_free(priv); priv = NULL; } diff --git a/drivers/mtd/mtd_config.c b/drivers/mtd/mtd_config.c index d3cde69564..5c021c54dc 100644 --- a/drivers/mtd/mtd_config.c +++ b/drivers/mtd/mtd_config.c @@ -1353,7 +1353,7 @@ int mtdconfig_register(FAR struct mtd_dev_s *mtd) ret = MTD_IOCTL(mtd, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&geo)); if (ret < 0) { - fdbg("MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", ret); + ferr("MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", ret); kmm_free(dev); goto errout; } diff --git a/drivers/mtd/mtd_nand.c b/drivers/mtd/mtd_nand.c index 206cf97e54..826513939b 100644 --- a/drivers/mtd/mtd_nand.c +++ b/drivers/mtd/mtd_nand.c @@ -153,7 +153,7 @@ static int nand_lock(FAR struct nand_dev_s *nand) errcode = errno; DEBUGASSERT(errcode != OK); - fdbg("sem_wait failed: %d\n", errcode); + ferr("sem_wait failed: %d\n", errcode); return -errcode; } @@ -200,7 +200,7 @@ static int nand_checkblock(FAR struct nand_dev_s *nand, off_t block) ret = NAND_RAWREAD(raw, block, 0, 0, spare); if (ret < 0) { - fdbg("ERROR: Failed to read page 0 of block %d\n", block); + ferr("ERROR: Failed to read page 0 of block %d\n", block); return ret; } @@ -216,7 +216,7 @@ static int nand_checkblock(FAR struct nand_dev_s *nand, off_t block) ret = NAND_RAWREAD(raw, block, 1, 0, spare); if (ret < 0) { - fdbg("ERROR: Failed to read page 1 of block %d\n", block); + ferr("ERROR: Failed to read page 1 of block %d\n", block); return ret; } @@ -303,7 +303,7 @@ static int nand_devscan(FAR struct nand_dev_s *nand) } else { - fdbg("ERROR: Cannot retrieve info from block %u: %d\n", + ferr("ERROR: Cannot retrieve info from block %u: %d\n", (unsigned int)block, ret); } } @@ -417,7 +417,7 @@ static int nand_eraseblock(FAR struct nand_dev_s *nand, off_t block, { int tmp; - fdbg("ERROR: Cannot erase block %ld\n", (long)block); + ferr("ERROR: Cannot erase block %ld\n", (long)block); /* Retrieve the model and scheme */ @@ -432,7 +432,7 @@ static int nand_eraseblock(FAR struct nand_dev_s *nand, off_t block, tmp = NAND_WRITEPAGE(nand->raw, block, 0, 0, spare); if (tmp < 0) { - fdbg("ERROR: Failed bo marke block %ld as BAD\n", (long)block); + ferr("ERROR: Failed bo marke block %ld as BAD\n", (long)block); } } @@ -467,7 +467,7 @@ static int nand_readpage(FAR struct nand_dev_s *nand, off_t block, if (nand_checkblock(nand, block) != GOODBLOCK) { - fdbg("ERROR: Block is BAD\n"); + ferr("ERROR: Block is BAD\n"); return -EAGAIN; } #endif @@ -520,7 +520,7 @@ static int nand_writepage(FAR struct nand_dev_s *nand, off_t block, if (nand_checkblock(nand, block) != GOODBLOCK) { - fdbg("ERROR: Block is BAD\n"); + ferr("ERROR: Block is BAD\n"); return -EAGAIN; } #endif @@ -574,7 +574,7 @@ static int nand_erase(struct mtd_dev_s *dev, off_t startblock, ret = nand_eraseblock(nand, startblock, false); if (ret < 0) { - fdbg("nand_eraseblock failed on block %ld: %d\n", + ferr("nand_eraseblock failed on block %ld: %d\n", (long)startblock, ret); nand_unlock(nand); return ret; @@ -642,7 +642,7 @@ static ssize_t nand_bread(struct mtd_dev_s *dev, off_t startpage, if (block > maxblock) { - fdbg("ERROR: Read beyond the end of FLASH, block=%ld\n", + ferr("ERROR: Read beyond the end of FLASH, block=%ld\n", (long)block); ret = -ESPIPE; @@ -654,7 +654,7 @@ static ssize_t nand_bread(struct mtd_dev_s *dev, off_t startpage, ret = nand_readpage(nand, block, page, buffer); if (ret < 0) { - fdbg("ERROR: nand_readpage failed block=%ld page=%d: %d\n", + ferr("ERROR: nand_readpage failed block=%ld page=%d: %d\n", (long)block, page, ret); goto errout_with_lock; } @@ -738,7 +738,7 @@ static ssize_t nand_bwrite(struct mtd_dev_s *dev, off_t startpage, if (block > maxblock) { - fdbg("ERROR: Write beyond the end of FLASH, block=%ld\n", + ferr("ERROR: Write beyond the end of FLASH, block=%ld\n", (long)block); ret = -ESPIPE; @@ -750,7 +750,7 @@ static ssize_t nand_bwrite(struct mtd_dev_s *dev, off_t startpage, ret = nand_writepage(nand, block, page, buffer); if (ret < 0) { - fdbg("ERROR: nand_writepage failed block=%ld page=%d: %d\n", + ferr("ERROR: nand_writepage failed block=%ld page=%d: %d\n", (long)block, page, ret); goto errout_with_lock; } @@ -872,7 +872,7 @@ FAR struct mtd_dev_s *nand_initialize(FAR struct nand_raw_s *raw) if (!onfi_ebidetect(raw->cmdaddr, raw->addraddr, raw->dataaddr)) { - fdbg("ERROR: No NAND device detected at: %p %p %p\n", + ferr("ERROR: No NAND device detected at: %p %p %p\n", (FAR void *)raw->cmdaddr, (FAR void *)raw->addraddr, (FAR void *)raw->dataaddr); return NULL; @@ -895,7 +895,7 @@ FAR struct mtd_dev_s *nand_initialize(FAR struct nand_raw_s *raw) if (nandmodel_find(g_nandmodels, NAND_NMODELS, chipid, &raw->model)) { - fdbg("ERROR: Could not determine NAND model\n"); + ferr("ERROR: Could not determine NAND model\n"); return NULL; } } @@ -955,7 +955,7 @@ FAR struct mtd_dev_s *nand_initialize(FAR struct nand_raw_s *raw) nand = (FAR struct nand_dev_s *)kmm_zalloc(sizeof(struct nand_dev_s)); if (!nand) { - fdbg("ERROR: Failed to allocate the NAND MTD device structure\n"); + ferr("ERROR: Failed to allocate the NAND MTD device structure\n"); return NULL; } diff --git a/drivers/mtd/mtd_nandecc.c b/drivers/mtd/mtd_nandecc.c index 7820feb481..e22bc23175 100644 --- a/drivers/mtd/mtd_nandecc.c +++ b/drivers/mtd/mtd_nandecc.c @@ -125,7 +125,7 @@ int nandecc_readpage(FAR struct nand_dev_s *nand, off_t block, ret = NAND_RAWREAD(raw, block, page, 0, spare); if (ret < 0) { - fdbg("ERROR: Failed to read page:d\n", ret); + ferr("ERROR: Failed to read page:d\n", ret); return ret; } @@ -134,7 +134,7 @@ int nandecc_readpage(FAR struct nand_dev_s *nand, off_t block, ret = NAND_RAWREAD(nand->raw, block, page, data, 0); if (ret < 0) { - fdbg("ERROR: Failed to read page:d\n", ret); + ferr("ERROR: Failed to read page:d\n", ret); return ret; } @@ -148,7 +148,7 @@ int nandecc_readpage(FAR struct nand_dev_s *nand, off_t block, ret = hamming_verify256x(data, pagesize, raw->ecc); if (ret && (ret != HAMMING_ERROR_SINGLEBIT)) { - fdbg("ERROR: Block=%d page=%d Unrecoverable error: %d\n", + ferr("ERROR: Block=%d page=%d Unrecoverable error: %d\n", block, page, ret); return -EIO; } @@ -235,7 +235,7 @@ int nandecc_writepage(FAR struct nand_dev_s *nand, off_t block, ret = NAND_RAWWRITE(nand->raw, block, page, data, spare); if (ret < 0) { - fdbg("ERROR: Failed to write page:d\n", ret); + ferr("ERROR: Failed to write page:d\n", ret); } return ret; diff --git a/drivers/mtd/mtd_onfi.c b/drivers/mtd/mtd_onfi.c index 3f1b9f43a6..4a2a150f0f 100644 --- a/drivers/mtd/mtd_onfi.c +++ b/drivers/mtd/mtd_onfi.c @@ -278,7 +278,7 @@ int onfi_read(uintptr_t cmdaddr, uintptr_t addraddr, uintptr_t dataaddr, if (!onfi_compatible(cmdaddr, addraddr, dataaddr)) { - fdbg("ERROR: No ONFI compatible device detected\n"); + ferr("ERROR: No ONFI compatible device detected\n"); return -ENODEV; } @@ -316,7 +316,7 @@ int onfi_read(uintptr_t cmdaddr, uintptr_t addraddr, uintptr_t dataaddr, if (i == ONFI_PARAM_TABLE_SIZE) { - fdbg("ERROR: Failed to read ONFI parameter table\n"); + ferr("ERROR: Failed to read ONFI parameter table\n"); return -EIO; } diff --git a/drivers/mtd/mtd_partition.c b/drivers/mtd/mtd_partition.c index 60e29870fe..8b2f2586fd 100644 --- a/drivers/mtd/mtd_partition.c +++ b/drivers/mtd/mtd_partition.c @@ -235,7 +235,7 @@ static int part_erase(FAR struct mtd_dev_s *dev, off_t startblock, if (!part_blockcheck(priv, (startblock + nblocks - 1) * priv->blkpererase)) { - fdbg("ERROR: Erase beyond the end of the partition\n"); + ferr("ERROR: Erase beyond the end of the partition\n"); return -ENXIO; } @@ -270,7 +270,7 @@ static ssize_t part_bread(FAR struct mtd_dev_s *dev, off_t startblock, if (!part_blockcheck(priv, startblock + nblocks - 1)) { - fdbg("ERROR: Read beyond the end of the partition\n"); + ferr("ERROR: Read beyond the end of the partition\n"); return -ENXIO; } @@ -301,7 +301,7 @@ static ssize_t part_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, if (!part_blockcheck(priv, startblock + nblocks - 1)) { - fdbg("ERROR: Write beyond the end of the partition\n"); + ferr("ERROR: Write beyond the end of the partition\n"); return -ENXIO; } @@ -337,7 +337,7 @@ static ssize_t part_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, if (!part_bytecheck(priv, offset + nbytes - 1)) { - fdbg("ERROR: Read beyond the end of the partition\n"); + ferr("ERROR: Read beyond the end of the partition\n"); return -ENXIO; } @@ -375,7 +375,7 @@ static ssize_t part_write(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes if (!part_bytecheck(priv, offset + nbytes - 1)) { - fdbg("ERROR: Write beyond the end of the partition\n"); + ferr("ERROR: Write beyond the end of the partition\n"); return -ENXIO; } @@ -489,7 +489,7 @@ static int part_procfs_open(FAR struct file *filep, FAR const char *relpath, if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - fdbg("ERROR: Only O_RDONLY supported\n"); + ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; } @@ -498,7 +498,7 @@ static int part_procfs_open(FAR struct file *filep, FAR const char *relpath, attr = (FAR struct part_procfs_file_s *)kmm_zalloc(sizeof(struct part_procfs_file_s)); if (!attr) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -591,7 +591,7 @@ static ssize_t part_procfs_read(FAR struct file *filep, FAR char *buffer, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&geo)); if (ret < 0) { - fdbg("ERROR: mtd->ioctl failed: %d\n", ret); + ferr("ERROR: mtd->ioctl failed: %d\n", ret); return 0; } @@ -714,7 +714,7 @@ static int part_procfs_dup(FAR const struct file *oldp, FAR struct file *newp) newattr = (FAR struct part_procfs_file_s *)kmm_zalloc(sizeof(struct part_procfs_file_s)); if (!newattr) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -796,7 +796,7 @@ FAR struct mtd_dev_s *mtd_partition(FAR struct mtd_dev_s *mtd, off_t firstblock, ret = mtd->ioctl(mtd, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&geo)); if (ret < 0) { - fdbg("ERROR: mtd->ioctl failed: %d\n", ret); + ferr("ERROR: mtd->ioctl failed: %d\n", ret); return NULL; } @@ -818,7 +818,7 @@ FAR struct mtd_dev_s *mtd_partition(FAR struct mtd_dev_s *mtd, off_t firstblock, if (erasestart >= eraseend) { - fdbg("ERROR: sub-region too small\n"); + ferr("ERROR: sub-region too small\n"); return NULL; } @@ -827,7 +827,7 @@ FAR struct mtd_dev_s *mtd_partition(FAR struct mtd_dev_s *mtd, off_t firstblock, devblocks = blkpererase * geo.neraseblocks; if (eraseend > devblocks) { - fdbg("ERROR: sub-region too big\n"); + ferr("ERROR: sub-region too big\n"); return NULL; } @@ -836,7 +836,7 @@ FAR struct mtd_dev_s *mtd_partition(FAR struct mtd_dev_s *mtd, off_t firstblock, part = (FAR struct mtd_partition_s *)kmm_zalloc(sizeof(struct mtd_partition_s)); if (!part) { - fdbg("ERROR: Failed to allocate memory for the partition device\n"); + ferr("ERROR: Failed to allocate memory for the partition device\n"); return NULL; } diff --git a/drivers/mtd/mtd_procfs.c b/drivers/mtd/mtd_procfs.c index e604a19b97..4ba355110c 100644 --- a/drivers/mtd/mtd_procfs.c +++ b/drivers/mtd/mtd_procfs.c @@ -149,7 +149,7 @@ static int mtd_open(FAR struct file *filep, FAR const char *relpath, if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - fdbg("ERROR: Only O_RDONLY supported\n"); + ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; } @@ -158,7 +158,7 @@ static int mtd_open(FAR struct file *filep, FAR const char *relpath, attr = (FAR struct mtd_file_s *)kmm_zalloc(sizeof(struct mtd_file_s)); if (!attr) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -278,7 +278,7 @@ static int mtd_dup(FAR const struct file *oldp, FAR struct file *newp) newattr = (FAR struct mtd_file_s *)kmm_zalloc(sizeof(struct mtd_file_s)); if (!newattr) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } diff --git a/drivers/mtd/mtd_rwbuffer.c b/drivers/mtd/mtd_rwbuffer.c index 28d05c619d..c152bc5f75 100644 --- a/drivers/mtd/mtd_rwbuffer.c +++ b/drivers/mtd/mtd_rwbuffer.c @@ -187,7 +187,7 @@ static int mtd_erase(FAR struct mtd_dev_s *dev, off_t block, size_t nblocks) ret = rwb_invalidate(&priv->rwb, sector, nsectors); if (ret < 0) { - fdbg("ERROR: rwb_invalidate failed: %d\n", ret); + ferr("ERROR: rwb_invalidate failed: %d\n", ret); return ret; } @@ -289,7 +289,7 @@ static int mtd_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) ret = priv->dev->ioctl(priv->dev, MTDIOC_BULKERASE, 0); if (ret >= 0) { - fdbg("ERROR: Device ioctl failed: %d\n", ret); + ferr("ERROR: Device ioctl failed: %d\n", ret); break; } @@ -298,7 +298,7 @@ static int mtd_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) ret = rwb_invalidate(&priv->rwb, 0, priv->rwb.nblocks); if (ret < 0) { - fdbg("ERROR: rwb_invalidate failed: %d\n", ret); + ferr("ERROR: rwb_invalidate failed: %d\n", ret); } } break; @@ -345,7 +345,7 @@ FAR struct mtd_dev_s *mtd_rwb_initialize(FAR struct mtd_dev_s *mtd) ret = mtd->ioctl(mtd, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&geo)); if (ret < 0) { - fdbg("ERROR: MTDIOC_GEOMETRY ioctl failed: %d\n", ret); + ferr("ERROR: MTDIOC_GEOMETRY ioctl failed: %d\n", ret); return NULL; } @@ -404,7 +404,7 @@ FAR struct mtd_dev_s *mtd_rwb_initialize(FAR struct mtd_dev_s *mtd) ret = rwb_initialize(&priv->rwb); if (ret < 0) { - fdbg("ERROR: rwb_initialize failed: %d\n", ret); + ferr("ERROR: rwb_initialize failed: %d\n", ret); kmm_free(priv); return NULL; } diff --git a/drivers/mtd/n25qxxx.c b/drivers/mtd/n25qxxx.c index f0db0481a6..191cc1cd22 100644 --- a/drivers/mtd/n25qxxx.c +++ b/drivers/mtd/n25qxxx.c @@ -575,7 +575,7 @@ static inline int n25qxxx_readid(struct n25qxxx_dev_s *priv) if (priv->cmdbuf[1] != N25QXXX3V_JEDEC_DEVICE_TYPE && priv->cmdbuf[1] != N25QXXX2V_JEDEC_DEVICE_TYPE) { - fdbg("ERROR: Unrecognized device type: 0x%02x\n", priv->cmdbuf[1]); + ferr("ERROR: Unrecognized device type: 0x%02x\n", priv->cmdbuf[1]); return -ENODEV; } @@ -628,7 +628,7 @@ static inline int n25qxxx_readid(struct n25qxxx_dev_s *priv) /* Support for this part is not implemented yet */ default: - fdbg("ERROR: Unsupported memory capacity: %02x\n", priv->cmdbuf[2]); + ferr("ERROR: Unsupported memory capacity: %02x\n", priv->cmdbuf[2]); return -ENODEV; } @@ -802,7 +802,7 @@ static int n25qxxx_erase_sector(struct n25qxxx_dev_s *priv, off_t sector) status = n25qxxx_read_status(priv); if ((status & STATUS_BUSY_MASK) != STATUS_READY) { - fdbg("ERROR: Flash busy: %02x", status); + ferr("ERROR: Flash busy: %02x", status); return -EBUSY; } @@ -813,7 +813,7 @@ static int n25qxxx_erase_sector(struct n25qxxx_dev_s *priv, off_t sector) if ((status & (STATUS_BP3_MASK|STATUS_BP_MASK)) != 0 && n25qxxx_isprotected(priv, status, address)) { - fdbg("ERROR: Flash protected: %02x", status); + ferr("ERROR: Flash protected: %02x", status); return -EACCES; } @@ -842,7 +842,7 @@ static int n25qxxx_erase_chip(struct n25qxxx_dev_s *priv) status = n25qxxx_read_status(priv); if ((status & (STATUS_BP3_MASK|STATUS_BP_MASK)) != 0) { - fdbg("ERROR: FLASH is Protected: %02x", status); + ferr("ERROR: FLASH is Protected: %02x", status); return -EACCES; } @@ -928,7 +928,7 @@ static int n25qxxx_write_page(struct n25qxxx_dev_s *priv, FAR const uint8_t *buf if (ret < 0) { - fdbg("ERROR: QSPI_MEMORY failed writing address=%06x\n", + ferr("ERROR: QSPI_MEMORY failed writing address=%06x\n", address); return ret; } @@ -976,7 +976,7 @@ static int n25qxxx_flush_cache(struct n25qxxx_dev_s *priv) ret = n25qxxx_write_page(priv, priv->sector, address, 1 << priv->sectorshift); if (ret < 0) { - fdbg("ERROR: n25qxxx_write_page failed: %d\n", ret); + ferr("ERROR: n25qxxx_write_page failed: %d\n", ret); } /* The case is no long dirty and the FLASH is no longer erased */ @@ -1019,7 +1019,7 @@ static FAR uint8_t *n25qxxx_read_cache(struct n25qxxx_dev_s *priv, off_t sector) ret = n25qxxx_flush_cache(priv); if (ret < 0) { - fdbg("ERROR: n25qxxx_flush_cache failed: %d\n", ret); + ferr("ERROR: n25qxxx_flush_cache failed: %d\n", ret); return NULL; } @@ -1030,7 +1030,7 @@ static FAR uint8_t *n25qxxx_read_cache(struct n25qxxx_dev_s *priv, off_t sector) (1 << priv->sectorshift)); if (ret < 0) { - fdbg("ERROR: n25qxxx_read_byte failed: %d\n", ret); + ferr("ERROR: n25qxxx_read_byte failed: %d\n", ret); return NULL; } @@ -1125,7 +1125,7 @@ static int n25qxxx_write_cache(FAR struct n25qxxx_dev_s *priv, ret = n25qxxx_erase_sector(priv, esectno); if (ret < 0) { - fdbg("ERROR: n25qxxx_erase_sector failed: %d\n", ret); + ferr("ERROR: n25qxxx_erase_sector failed: %d\n", ret); return ret; } @@ -1249,7 +1249,7 @@ static ssize_t n25qxxx_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, ret = n25qxxx_write_cache(priv, buffer, startblock, nblocks); if (ret < 0) { - fdbg("ERROR: n25qxxx_write_cache failed: %d\n", ret); + ferr("ERROR: n25qxxx_write_cache failed: %d\n", ret); } #else @@ -1257,7 +1257,7 @@ static ssize_t n25qxxx_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, nblocks << priv->sectorshift); if (ret < 0) { - fdbg("ERROR: n25qxxx_write_page failed: %d\n", ret); + ferr("ERROR: n25qxxx_write_page failed: %d\n", ret); } #endif @@ -1286,7 +1286,7 @@ static ssize_t n25qxxx_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt if (ret < 0) { - fdbg("ERROR: n25qxxx_read_byte returned: %d\n", ret); + ferr("ERROR: n25qxxx_read_byte returned: %d\n", ret); return (ssize_t)ret; } @@ -1430,7 +1430,7 @@ FAR struct mtd_dev_s *n25qxxx_initialize(FAR struct qspi_dev_s *qspi, bool unpro priv->cmdbuf = (FAR uint8_t *)QSPI_ALLOC(qspi, 4); if (priv->cmdbuf == NULL) { - fdbg("ERROR Failed to allocate command buffer\n"); + ferr("ERROR Failed to allocate command buffer\n"); goto errout_with_priv; } @@ -1439,7 +1439,7 @@ FAR struct mtd_dev_s *n25qxxx_initialize(FAR struct qspi_dev_s *qspi, bool unpro priv->readbuf = (FAR uint8_t *)QSPI_ALLOC(qspi, 1); if (priv->readbuf == NULL) { - fdbg("ERROR Failed to allocate read buffer\n"); + ferr("ERROR Failed to allocate read buffer\n"); goto errout_with_cmdbuf; } @@ -1450,7 +1450,7 @@ FAR struct mtd_dev_s *n25qxxx_initialize(FAR struct qspi_dev_s *qspi, bool unpro { /* Unrecognized! Discard all of that work we just did and return NULL */ - fdbg("ERROR Unrecognized QSPI device\n"); + ferr("ERROR Unrecognized QSPI device\n"); goto errout_with_readbuf; } @@ -1470,7 +1470,7 @@ FAR struct mtd_dev_s *n25qxxx_initialize(FAR struct qspi_dev_s *qspi, bool unpro ret = n25qxxx_unprotect(priv, 0, priv->nsectors - 1); if (ret < 0) { - fdbg("ERROR: Sector unprotect failed\n"); + ferr("ERROR: Sector unprotect failed\n"); } } @@ -1482,7 +1482,7 @@ FAR struct mtd_dev_s *n25qxxx_initialize(FAR struct qspi_dev_s *qspi, bool unpro { /* Allocation failed! Discard all of that work we just did and return NULL */ - fdbg("ERROR: Sector allocation failed\n"); + ferr("ERROR: Sector allocation failed\n"); goto errout_with_readbuf; } #endif diff --git a/drivers/mtd/rammtd.c b/drivers/mtd/rammtd.c index 8bc9ac8b82..1e6c7c0fc7 100644 --- a/drivers/mtd/rammtd.c +++ b/drivers/mtd/rammtd.c @@ -172,7 +172,7 @@ static void *ram_write(FAR void *dest, FAR const void *src, size_t len) #ifdef CONFIG_DEBUG_FEATURES if (newvalue != srcvalue) { - dbg("ERROR: Bad write: source=%02x dest=%02x result=%02x\n", + err("ERROR: Bad write: source=%02x dest=%02x result=%02x\n", srcvalue, oldvalue, newvalue); } #endif @@ -446,7 +446,7 @@ FAR struct mtd_dev_s *rammtd_initialize(FAR uint8_t *start, size_t size) priv = (FAR struct ram_dev_s *)kmm_zalloc(sizeof(struct ram_dev_s)); if (!priv) { - fdbg("Failed to allocate the RAM MTD state structure\n"); + ferr("Failed to allocate the RAM MTD state structure\n"); return NULL; } @@ -455,7 +455,7 @@ FAR struct mtd_dev_s *rammtd_initialize(FAR uint8_t *start, size_t size) nblocks = size / CONFIG_RAMMTD_ERASESIZE; if (nblocks < 1) { - fdbg("Need to provide at least one full erase block\n"); + ferr("Need to provide at least one full erase block\n"); return NULL; } diff --git a/drivers/mtd/ramtron.c b/drivers/mtd/ramtron.c index 84f8828276..5784dc1622 100644 --- a/drivers/mtd/ramtron.c +++ b/drivers/mtd/ramtron.c @@ -476,7 +476,7 @@ static int ramtron_waitwritecomplete(struct ramtron_dev_s *priv) } else { - fdbg("timeout waiting for write completion\n"); + ferr("timeout waiting for write completion\n"); retries = -EAGAIN; } @@ -694,7 +694,7 @@ static ssize_t ramtron_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt status = SPI_SEND(priv->dev, RAMTRON_DUMMY); if ((status & ~RAMTRON_SR_SRWD) == 0) { - fdbg("read status failed - got 0x%02x\n", (unsigned)status); + ferr("read status failed - got 0x%02x\n", (unsigned)status); nbytes = -EIO; } #endif diff --git a/drivers/mtd/s25fl1.c b/drivers/mtd/s25fl1.c index ae9a47cbe4..f3181dd475 100644 --- a/drivers/mtd/s25fl1.c +++ b/drivers/mtd/s25fl1.c @@ -620,7 +620,7 @@ static inline int s25fl1_readid(struct s25fl1_dev_s *priv) if (priv->cmdbuf[1] != S25FL1_JEDEC_DEVICE_TYPE) { - fdbg("ERROR: Unrecognized device type: %02x\n", priv->cmdbuf[1]); + ferr("ERROR: Unrecognized device type: %02x\n", priv->cmdbuf[1]); return -ENODEV; } @@ -649,7 +649,7 @@ static inline int s25fl1_readid(struct s25fl1_dev_s *priv) /* Support for this part is not implemented yet */ default: - fdbg("ERROR: Unsupported memory capacity: %02x\n", priv->cmdbuf[2]); + ferr("ERROR: Unsupported memory capacity: %02x\n", priv->cmdbuf[2]); return -ENODEV; } @@ -837,7 +837,7 @@ static int s25fl1_erase_sector(struct s25fl1_dev_s *priv, off_t sector) status = sf25fl1_read_status1(priv); if ((status & STATUS1_BUSY_MASK) != STATUS1_READY) { - fdbg("ERROR: Flash busy: %02x", status); + ferr("ERROR: Flash busy: %02x", status); return -EBUSY; } @@ -848,7 +848,7 @@ static int s25fl1_erase_sector(struct s25fl1_dev_s *priv, off_t sector) if ((status & STATUS1_BP_MASK) != 0 && s25fl1_isprotected(priv, status, address)) { - fdbg("ERROR: Flash protected: %02x", status); + ferr("ERROR: Flash protected: %02x", status); return -EACCES; } @@ -876,7 +876,7 @@ static int s25fl1_erase_chip(struct s25fl1_dev_s *priv) status = sf25fl1_read_status1(priv); if ((status & STATUS1_BP_MASK) != 0) { - fdbg("ERROR: FLASH is Protected: %02x", status); + ferr("ERROR: FLASH is Protected: %02x", status); return -EACCES; } @@ -976,7 +976,7 @@ static int s25fl1_write_page(struct s25fl1_dev_s *priv, FAR const uint8_t *buffe if (ret < 0) { - fdbg("ERROR: QSPI_MEMORY failed writing address=%06x\n", + ferr("ERROR: QSPI_MEMORY failed writing address=%06x\n", address); return ret; } @@ -1023,7 +1023,7 @@ static int s25fl1_flush_cache(struct s25fl1_dev_s *priv) ret = s25fl1_write_page(priv, priv->sector, address, 1 << priv->sectorshift); if (ret < 0) { - fdbg("ERROR: s25fl1_write_page failed: %d\n", ret); + ferr("ERROR: s25fl1_write_page failed: %d\n", ret); } /* The case is no long dirty and the FLASH is no longer erased */ @@ -1066,7 +1066,7 @@ static FAR uint8_t *s25fl1_read_cache(struct s25fl1_dev_s *priv, off_t sector) ret = s25fl1_flush_cache(priv); if (ret < 0) { - fdbg("ERROR: s25fl1_flush_cache failed: %d\n", ret); + ferr("ERROR: s25fl1_flush_cache failed: %d\n", ret); return NULL; } @@ -1077,7 +1077,7 @@ static FAR uint8_t *s25fl1_read_cache(struct s25fl1_dev_s *priv, off_t sector) (1 << priv->sectorshift)); if (ret < 0) { - fdbg("ERROR: s25fl1_read_byte failed: %d\n", ret); + ferr("ERROR: s25fl1_read_byte failed: %d\n", ret); return NULL; } @@ -1172,7 +1172,7 @@ static int s25fl1_write_cache(FAR struct s25fl1_dev_s *priv, ret = s25fl1_erase_sector(priv, esectno); if (ret < 0) { - fdbg("ERROR: s25fl1_erase_sector failed: %d\n", ret); + ferr("ERROR: s25fl1_erase_sector failed: %d\n", ret); return ret; } @@ -1295,7 +1295,7 @@ static ssize_t s25fl1_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, ret = s25fl1_write_cache(priv, buffer, startblock, nblocks); if (ret < 0) { - fdbg("ERROR: s25fl1_write_cache failed: %d\n", ret); + ferr("ERROR: s25fl1_write_cache failed: %d\n", ret); } #else @@ -1303,7 +1303,7 @@ static ssize_t s25fl1_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, nblocks << priv->sectorshift); if (ret < 0) { - fdbg("ERROR: s25fl1_write_page failed: %d\n", ret); + ferr("ERROR: s25fl1_write_page failed: %d\n", ret); } #endif @@ -1332,7 +1332,7 @@ static ssize_t s25fl1_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyte if (ret < 0) { - fdbg("ERROR: s25fl1_read_byte returned: %d\n", ret); + ferr("ERROR: s25fl1_read_byte returned: %d\n", ret); return (ssize_t)ret; } @@ -1476,7 +1476,7 @@ FAR struct mtd_dev_s *s25fl1_initialize(FAR struct qspi_dev_s *qspi, bool unprot priv->cmdbuf = (FAR uint8_t *)QSPI_ALLOC(qspi, 4); if (priv->cmdbuf == NULL) { - fdbg("ERROR Failed to allocate command buffer\n"); + ferr("ERROR Failed to allocate command buffer\n"); goto errout_with_priv; } @@ -1485,7 +1485,7 @@ FAR struct mtd_dev_s *s25fl1_initialize(FAR struct qspi_dev_s *qspi, bool unprot priv->readbuf = (FAR uint8_t *)QSPI_ALLOC(qspi, 1); if (priv->readbuf == NULL) { - fdbg("ERROR Failed to allocate read buffer\n"); + ferr("ERROR Failed to allocate read buffer\n"); goto errout_with_cmdbuf; } @@ -1496,7 +1496,7 @@ FAR struct mtd_dev_s *s25fl1_initialize(FAR struct qspi_dev_s *qspi, bool unprot { /* Unrecognized! Discard all of that work we just did and return NULL */ - fdbg("ERROR Unrecognized QSPI device\n"); + ferr("ERROR Unrecognized QSPI device\n"); goto errout_with_readbuf; } @@ -1521,7 +1521,7 @@ FAR struct mtd_dev_s *s25fl1_initialize(FAR struct qspi_dev_s *qspi, bool unprot ret = s25fl1_unprotect(priv, 0, priv->nsectors - 1); if (ret < 0) { - fdbg("ERROR: Sector unprotect failed\n"); + ferr("ERROR: Sector unprotect failed\n"); } } @@ -1533,7 +1533,7 @@ FAR struct mtd_dev_s *s25fl1_initialize(FAR struct qspi_dev_s *qspi, bool unprot { /* Allocation failed! Discard all of that work we just did and return NULL */ - fdbg("ERROR: Sector allocation failed\n"); + ferr("ERROR: Sector allocation failed\n"); goto errout_with_readbuf; } #endif diff --git a/drivers/mtd/sector512.c b/drivers/mtd/sector512.c index 11f317c256..57cceabd0b 100644 --- a/drivers/mtd/sector512.c +++ b/drivers/mtd/sector512.c @@ -173,7 +173,7 @@ static FAR uint8_t *s512_cacheread(struct s512_dev_s *priv, off_t sector512) priv->eblock); if (result < 0) { - fdbg("ERROR: bread(%lu, %lu) returned %ld\n", + ferr("ERROR: bread(%lu, %lu) returned %ld\n", (unsigned long)sector, (unsigned long)priv->eblocksize, (long)result); @@ -221,7 +221,7 @@ static void s512_cacheflush(struct s512_dev_s *priv) result = priv->dev->bwrite(priv->dev, sector, priv->sectperblock, priv->eblock); if (result < 0) { - fdbg("ERROR: bwrite(%lu, %lu) returned %ld\n", + ferr("ERROR: bwrite(%lu, %lu) returned %ld\n", (unsigned long)sector, (unsigned long)priv->eblocksize, (long)result); @@ -263,7 +263,7 @@ static int s512_erase(FAR struct mtd_dev_s *dev, off_t sector512, size_t nsector dest = s512_cacheread(priv, sector512); if (!dest) { - fdbg("ERROR: s512_cacheread(%ul) failed\n", (unsigned long)sector512); + ferr("ERROR: s512_cacheread(%ul) failed\n", (unsigned long)sector512); DEBUGPANIC(); return -EIO; } @@ -282,7 +282,7 @@ static int s512_erase(FAR struct mtd_dev_s *dev, off_t sector512, size_t nsector ret = priv->dev->erase(priv->dev, eblockno, 1); if (ret < 0) { - fdbg("ERROR: Failed to erase block %lu: %d\n", + ferr("ERROR: Failed to erase block %lu: %d\n", (unsigned long)eblockno, ret); return ret; } @@ -331,7 +331,7 @@ static ssize_t s512_bread(FAR struct mtd_dev_s *dev, off_t sector512, src = s512_cacheread(priv, sector512); if (!src) { - fdbg("ERROR: s512_cacheread(%ul) failed\n", (unsigned long)sector512); + ferr("ERROR: s512_cacheread(%ul) failed\n", (unsigned long)sector512); DEBUGPANIC(); result = (ssize_t)nsectors - remaining; @@ -405,7 +405,7 @@ static ssize_t s512_bwrite(FAR struct mtd_dev_s *dev, off_t sector512, size_t ns result = priv->dev->erase(priv->dev, eblockno, 1); if (result < 0) { - fdbg("ERROR: Failed to erase block %lu: %ld\n", + ferr("ERROR: Failed to erase block %lu: %ld\n", (unsigned long)eblockno, (long)result); return result; } @@ -464,7 +464,7 @@ static ssize_t s512_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, { int result; - fdbg("ERROR: s512_cacheread(%ul) failed\n", (unsigned long)sector); + ferr("ERROR: s512_cacheread(%ul) failed\n", (unsigned long)sector); DEBUGPANIC(); result = (ssize_t)nbytes - remaining; @@ -590,7 +590,7 @@ FAR struct mtd_dev_s *s512_initialize(FAR struct mtd_dev_s *mtd) if (ret < 0 || geo.erasesize <= SECTOR_512 || (geo.erasesize & ~MASK_512) != geo.erasesize) { - fdbg("ERROR: MTDIOC_GEOMETRY ioctl returned %d, eraseize=%d\n", + ferr("ERROR: MTDIOC_GEOMETRY ioctl returned %d, eraseize=%d\n", ret, geo.erasesize); DEBUGPANIC(); return NULL; @@ -629,7 +629,7 @@ FAR struct mtd_dev_s *s512_initialize(FAR struct mtd_dev_s *mtd) { /* Allocation failed! Discard all of that work we just did and return NULL */ - fdbg("Allocation failed\n"); + ferr("Allocation failed\n"); kmm_free(priv); priv = NULL; } diff --git a/drivers/mtd/smart.c b/drivers/mtd/smart.c index 56629e2689..9ad4a342b7 100644 --- a/drivers/mtd/smart.c +++ b/drivers/mtd/smart.c @@ -493,7 +493,7 @@ FAR static void *smart_malloc(FAR struct smart_struct_s *dev, } } - fdbg("SMART alloc: %ld\n", dev->bytesalloc); + ferr("SMART alloc: %ld\n", dev->bytesalloc); return ret; } #endif @@ -672,12 +672,12 @@ int smart_checkfree(FAR struct smart_struct_s *dev, int lineno) #ifdef CONFIG_DEBUG_FS if (freecount != dev->freesectors) { - fdbg("Free count incorrect in line %d! Calculated=%d, dev->freesectors=%d\n", + ferr("Free count incorrect in line %d! Calculated=%d, dev->freesectors=%d\n", lineno, freecount, dev->freesectors); /* Determine what changed from the last time which caused this error */ - fdbg(" ... Prev freesectors=%d, prev releasesectors=%d\n", + ferr(" ... Prev freesectors=%d, prev releasesectors=%d\n", prev_freesectors, prev_releasesectors); if (prev_freecount) @@ -695,7 +695,7 @@ int smart_checkfree(FAR struct smart_struct_s *dev, int lineno) { /* This block's values are different from the last time ... report it */ - fdbg(" ... Block %d: Old Free=%d, old release=%d, New free=%d, new release = %d\n", + ferr(" ... Block %d: Old Free=%d, old release=%d, New free=%d, new release = %d\n", x, prev_freecount[x], prev_releasecount[x], blockfree, blockrelease); } } @@ -771,7 +771,7 @@ static ssize_t smart_reload(struct smart_struct_s *dev, FAR uint8_t *buffer, nread = MTD_BREAD(dev->mtd, mtdStartBlock, mtdBlocks, buffer); if (nread != mtdBlocks) { - fdbg("Read %d blocks starting at block %d failed: %d\n", + ferr("Read %d blocks starting at block %d failed: %d\n", nblocks, startblock, nread); } @@ -873,7 +873,7 @@ static ssize_t smart_write(FAR struct inode *inode, ret = MTD_ERASE(dev->mtd, eraseblock, 1); if (ret < 0) { - fdbg("Erase block=%d failed: %d\n", eraseblock, ret); + ferr("Erase block=%d failed: %d\n", eraseblock, ret); /* Unlock the mutex if we add one */ @@ -896,13 +896,13 @@ static ssize_t smart_write(FAR struct inode *inode, /* Try to write to the sector. */ - fdbg("Write MTD block %d from offset %d\n", nextblock, offset); + ferr("Write MTD block %d from offset %d\n", nextblock, offset); nxfrd = MTD_BWRITE(dev->mtd, nextblock, blkstowrite, &buffer[offset]); if (nxfrd != blkstowrite) { /* The block is not empty!! What to do? */ - fdbg("Write block %d failed: %d.\n", nextblock, nxfrd); + ferr("Write block %d failed: %d.\n", nextblock, nxfrd); /* Unlock the mutex if we add one */ @@ -1001,7 +1001,7 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) if (erasesize / dev->sectorsize > 256) { - /* We can't throw a dbg message here becasue it is too early. + /* We can't throw a err message here becasue it is too early. * set the erasesize to zero and exit, then we will detect * it during mksmartfs or mount. */ @@ -1079,7 +1079,7 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) if (totalsectors > 65536) { - dbg("Invalid SMART sector count %ld\n", totalsectors); + err("Invalid SMART sector count %ld\n", totalsectors); return -EINVAL; } else if (totalsectors == 65536) @@ -1099,7 +1099,7 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) allocsize, "Sector map"); if (!dev->sMap) { - fdbg("Error allocating SMART virtual map buffer\n"); + ferr("Error allocating SMART virtual map buffer\n"); goto errexit; } @@ -1109,7 +1109,7 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) dev->sBitMap = (FAR uint8_t *) smart_malloc(dev, (totalsectors+7) >> 3, "Sector Bitmap"); if (dev->sBitMap == NULL) { - fdbg("Error allocating SMART sector cache\n"); + ferr("Error allocating SMART sector cache\n"); goto errexit; } @@ -1144,7 +1144,7 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) if (!dev->sCache) { - fdbg("Error allocating SMART sector cache\n"); + ferr("Error allocating SMART sector cache\n"); goto errexit; } @@ -1181,7 +1181,7 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) if (!dev->erasecounts) { - fdbg("Error allocating erase count array\n"); + ferr("Error allocating erase count array\n"); goto errexit; } @@ -1195,7 +1195,7 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) SMART_WEAR_BIT_DIVIDE, "Wear status"); if (!dev->wearstatus) { - fdbg("Error allocating wear level status array\n"); + ferr("Error allocating wear level status array\n"); goto errexit; } @@ -1210,7 +1210,7 @@ static int smart_setsectorsize(FAR struct smart_struct_s *dev, uint16_t size) dev->rwbuffer = (FAR char *) smart_malloc(dev, size, "RW Buffer"); if (!dev->rwbuffer) { - fdbg("Error allocating SMART read/write buffer\n"); + ferr("Error allocating SMART read/write buffer\n"); goto errexit; } @@ -1304,7 +1304,7 @@ static ssize_t smart_bytewrite(FAR struct smart_struct_s *dev, size_t offset, ret = MTD_BREAD(dev->mtd, startblock, nblocks, (FAR uint8_t *) dev->rwbuffer); if (ret < 0) { - fdbg("Error %d reading from device\n", -ret); + ferr("Error %d reading from device\n", -ret); goto errout; } @@ -1317,7 +1317,7 @@ static ssize_t smart_bytewrite(FAR struct smart_struct_s *dev, size_t offset, ret = MTD_BWRITE(dev->mtd, startblock, nblocks, (FAR uint8_t *) dev->rwbuffer); if (ret < 0) { - fdbg("Error %d writing to device\n", -ret); + ferr("Error %d writing to device\n", -ret); goto errout; } } @@ -1387,7 +1387,7 @@ static int smart_add_sector_to_cache(FAR struct smart_struct_s *dev, if (dev->debuglevel > 1) { - dbg("Add Cache sector: Log=%d, Phys=%d at index %d from line %d\n", + err("Add Cache sector: Log=%d, Phys=%d at index %d from line %d\n", logical, physical, index, line); } @@ -1575,7 +1575,7 @@ static void smart_update_cache(FAR struct smart_struct_s *dev, uint16_t if (dev->debuglevel > 1) { - dbg("Update Cache: Log=%d, Phys=%d at index %d\n", logical, physical, x); + err("Update Cache: Log=%d, Phys=%d at index %d\n", logical, physical, x); } break; @@ -1712,7 +1712,7 @@ static int smart_set_wear_level(FAR struct smart_struct_s *dev, uint16_t block, if (level > 15) { - dbg("Fatal Design Error! Wear level > 15, block=%d\n", block); + err("Fatal Design Error! Wear level > 15, block=%d\n", block); /* This is a design flaw, but we still allow processing, otherwise we * will corrupt the volume. It's better to have a few blocks that are @@ -1984,7 +1984,7 @@ static int smart_scan(FAR struct smart_struct_s *dev) { /* Error in logical sector read from the MTD device */ - fdbg("Invalid logical sector %d at physical %d.\n", + ferr("Invalid logical sector %d at physical %d.\n", logicalsector, sector); continue; } @@ -2001,7 +2001,7 @@ static int smart_scan(FAR struct smart_struct_s *dev) (FAR uint8_t *)dev->rwbuffer); if (ret != 32) { - fdbg("Error reading physical sector %d.\n", sector); + ferr("Error reading physical sector %d.\n", sector); goto err_out; } @@ -2053,7 +2053,7 @@ static int smart_scan(FAR struct smart_struct_s *dev) smart_malloc(dev, sizeof(*rootdirdev), "Root Dir"); if (rootdirdev == NULL) { - fdbg("Memory alloc failed\n"); + ferr("Memory alloc failed\n"); ret = -ENOMEM; goto err_out; } @@ -2221,7 +2221,7 @@ static int smart_scan(FAR struct smart_struct_s *dev) ret = smart_bytewrite(dev, offset, 1, &header.status); if (ret < 0) { - fdbg("Error %d releasing duplicate sector\n", -ret); + ferr("Error %d releasing duplicate sector\n", -ret); goto err_out; } } @@ -2267,7 +2267,7 @@ static int smart_scan(FAR struct smart_struct_s *dev) dev->mtdBlksPerSector, (uint8_t *) dev->rwbuffer); if (ret != dev->mtdBlksPerSector) { - fdbg("Error reading physical sector %d.\n", sector); + ferr("Error reading physical sector %d.\n", sector); goto err_out; } @@ -2284,7 +2284,7 @@ static int smart_scan(FAR struct smart_struct_s *dev) { /* Unable to find a free sector!!! */ - fdbg("Can't find a free sector for relocation\n"); + ferr("Can't find a free sector for relocation\n"); ret = -ENOSPC; goto err_out; } @@ -2321,29 +2321,29 @@ static int smart_scan(FAR struct smart_struct_s *dev) smart_read_wearstatus(dev); #endif - fdbg("SMART Scan\n"); - fdbg(" Erase size: %10d\n", dev->sectorsPerBlk * dev->sectorsize); - fdbg(" Erase count: %10d\n", dev->neraseblocks); - fdbg(" Sect/block: %10d\n", dev->sectorsPerBlk); - fdbg(" MTD Blk/Sect: %10d\n", dev->mtdBlksPerSector); + ferr("SMART Scan\n"); + ferr(" Erase size: %10d\n", dev->sectorsPerBlk * dev->sectorsize); + ferr(" Erase count: %10d\n", dev->neraseblocks); + ferr(" Sect/block: %10d\n", dev->sectorsPerBlk); + ferr(" MTD Blk/Sect: %10d\n", dev->mtdBlksPerSector); /* Validate the geometry */ if (dev->mtdBlksPerSector == 0 || dev->sectorsPerBlk == 0 || dev->sectorsPerBlk == 0 || dev->sectorsize == 0) { - fdbg("Invalid Geometry!\n"); + ferr("Invalid Geometry!\n"); ret = -EINVAL; goto err_out; } #ifdef CONFIG_MTD_SMART_ALLOC_DEBUG - fdbg(" Allocations:\n"); + ferr(" Allocations:\n"); for (sector = 0; sector < SMART_MAX_ALLOCS; sector++) { if (dev->alloc[sector].ptr != NULL) { - fdbg(" %s: %d\n", dev->alloc[sector].name, dev->alloc[sector].size); + ferr(" %s: %d\n", dev->alloc[sector].name, dev->alloc[sector].size); } } #endif @@ -2515,7 +2515,7 @@ static void smart_erase_block_if_empty(FAR struct smart_struct_s *dev, #ifdef CONFIG_SMART_LOCAL_CHECKFREE if (smart_checkfree(dev, __LINE__) != OK) { - fdbg(" ...while eraseing block %d\n", block); + ferr(" ...while eraseing block %d\n", block); } #endif } @@ -2554,7 +2554,7 @@ static int smart_relocate_static_data(FAR struct smart_struct_s *dev, uint16_t b #ifdef CONFIG_SMART_LOCAL_CHECKFREE if (smart_checkfree(dev, __LINE__) != OK) { - fdbg(" ...about to relocate static data %d\n", block); + ferr(" ...about to relocate static data %d\n", block); } #endif @@ -2645,7 +2645,7 @@ static int smart_relocate_static_data(FAR struct smart_struct_s *dev, uint16_t b dev->mtdBlksPerSector, (FAR uint8_t *) dev->rwbuffer); if (ret != dev->mtdBlksPerSector) { - fdbg("Error reading sector %d\n", sector); + ferr("Error reading sector %d\n", sector); ret = -EIO; goto errout; } @@ -2681,7 +2681,7 @@ static int smart_relocate_static_data(FAR struct smart_struct_s *dev, uint16_t b { /* Unable to find a free sector!!! */ - fdbg("Can't find a free sector for relocation\n"); + ferr("Can't find a free sector for relocation\n"); ret = -ENOSPC; goto errout; } @@ -2736,7 +2736,7 @@ static int smart_relocate_static_data(FAR struct smart_struct_s *dev, uint16_t b #ifdef CONFIG_SMART_LOCAL_CHECKFREE if (smart_checkfree(dev, __LINE__) != OK) { - fdbg(" ...about to erase static block %d\n", block); + ferr(" ...about to erase static block %d\n", block); } #endif @@ -2748,7 +2748,7 @@ static int smart_relocate_static_data(FAR struct smart_struct_s *dev, uint16_t b #ifdef CONFIG_SMART_LOCAL_CHECKFREE if (smart_checkfree(dev, __LINE__) != OK) { - fdbg(" ...done erasing static block %d\n", block); + ferr(" ...done erasing static block %d\n", block); } #endif @@ -2862,10 +2862,10 @@ static inline int smart_llformat(FAR struct smart_struct_s *dev, unsigned long a { dev->erasesize = dev->geo.erasesize; - dbg("ERROR: Invalid geometery ... Sectors per erase block must be 1-256\n"); - dbg(" Erase block size = %d\n", dev->erasesize); - dbg(" Sector size = %d\n", dev->sectorsize); - dbg(" Sectors/erase block = %d\n", dev->erasesize / dev->sectorsize); + err("ERROR: Invalid geometery ... Sectors per erase block must be 1-256\n"); + err(" Erase block size = %d\n", dev->erasesize); + err(" Sector size = %d\n", dev->sectorsize); + err(" Sectors/erase block = %d\n", dev->erasesize / dev->sectorsize); return -EINVAL; } @@ -2951,7 +2951,7 @@ static inline int smart_llformat(FAR struct smart_struct_s *dev, unsigned long a { /* The block is not empty!! What to do? */ - fdbg("Write block 0 failed: %d.\n", wrcount); + ferr("Write block 0 failed: %d.\n", wrcount); /* Unlock the mutex if we add one */ @@ -3132,7 +3132,7 @@ static int smart_relocate_sector(FAR struct smart_struct_s *dev, ret = smart_bytewrite(dev, offset, 1, &newstatus); if (ret < 0) { - fdbg("Error %d committing new sector %d\n" -ret, newsector); + ferr("Error %d committing new sector %d\n" -ret, newsector); goto errout; } #endif /* CONFIG_MTD_SMART_ENABLE_CRC */ @@ -3149,7 +3149,7 @@ static int smart_relocate_sector(FAR struct smart_struct_s *dev, ret = smart_bytewrite(dev, offset, 1, &newstatus); if (ret < 0) { - fdbg("Error %d releasing old sector %d\n" -ret, oldsector); + ferr("Error %d releasing old sector %d\n" -ret, oldsector); } #ifndef CONFIG_MTD_SMART_ENABLE_CRC @@ -3193,7 +3193,7 @@ static int smart_relocate_block(FAR struct smart_struct_s *dev, uint16_t block) #ifdef CONFIG_SMART_LOCAL_CHECKFREE if (smart_checkfree(dev, __LINE__) != OK) { - fdbg(" ...while relocating block %d, free=%d\n", block, dev->freesectors); + ferr(" ...while relocating block %d, free=%d\n", block, dev->freesectors); } #endif @@ -3210,7 +3210,7 @@ static int smart_relocate_block(FAR struct smart_struct_s *dev, uint16_t block) if (freecount >= dev->freesectors) { - fdbg("Program bug! Relocating the only block (%d) with free sectors!\n", + ferr("Program bug! Relocating the only block (%d) with free sectors!\n", block); ret = -EIO; goto errout; @@ -3240,7 +3240,7 @@ static int smart_relocate_block(FAR struct smart_struct_s *dev, uint16_t block) dev->mtdBlksPerSector, (FAR uint8_t *) dev->rwbuffer); if (ret != dev->mtdBlksPerSector) { - fdbg("Error reading sector %d\n", x); + ferr("Error reading sector %d\n", x); ret = -EIO; goto errout; } @@ -3271,7 +3271,7 @@ static int smart_relocate_block(FAR struct smart_struct_s *dev, uint16_t block) { /* Unable to find a free sector!!! */ - fdbg("Can't find a free sector for relocation\n"); + ferr("Can't find a free sector for relocation\n"); ret = -ENOSPC; goto errout; } @@ -3303,7 +3303,7 @@ static int smart_relocate_block(FAR struct smart_struct_s *dev, uint16_t block) { /* Unable to find a free sector!!! */ - fdbg("Can't find a free sector for relocation\n"); + ferr("Can't find a free sector for relocation\n"); ret = -ENOSPC; goto errout; } @@ -3383,7 +3383,7 @@ static int smart_relocate_block(FAR struct smart_struct_s *dev, uint16_t block) #ifdef CONFIG_SMART_LOCAL_CHECKFREE if (smart_checkfree(dev, __LINE__) != OK) { - fdbg(" ...while relocating block %d, free=%d, release=%d, oldrelease=%d\n", + ferr(" ...while relocating block %d, free=%d, release=%d, oldrelease=%d\n", block, freecount, releasecount, oldrelease); } #endif @@ -3533,7 +3533,7 @@ retry: { if (smart_relocate_block(dev, block) < 0) { - fdbg("Error relocating block while finding free phys sector\n"); + ferr("Error relocating block while finding free phys sector\n"); return -1; } @@ -3566,7 +3566,7 @@ retry: #endif { - dbg("Program bug! Expected a free sector, free=%d\n", dev->freesectors); + err("Program bug! Expected a free sector, free=%d\n", dev->freesectors); for (x = 0; x < dev->neraseblocks; x++) { printf("%d ", dev->freecount[x]); @@ -3620,7 +3620,7 @@ retry: (FAR uint8_t *) &header); if (ret != sizeof(struct smart_sect_header_s)) { - fdbg("Error reading phys sector %d\n", physicalsector); + ferr("Error reading phys sector %d\n", physicalsector); return -1; } @@ -3641,12 +3641,12 @@ retry: if (physicalsector == 0xFFFF) { - dbg("Program bug! Expected a free sector\n"); + err("Program bug! Expected a free sector\n"); } if (physicalsector >= dev->totalsectors) { - dbg("Program bug! Selected sector too big!!!\n"); + err("Program bug! Selected sector too big!!!\n"); } return physicalsector; @@ -3742,7 +3742,7 @@ static int smart_garbagecollect(FAR struct smart_struct_s *dev) #ifdef CONFIG_SMART_LOCAL_CHECKFREE if (smart_checkfree(dev, __LINE__) != OK) { - fdbg(" ...before collecting block %d\n", collectblock); + ferr(" ...before collecting block %d\n", collectblock); } #endif @@ -3763,7 +3763,7 @@ static int smart_garbagecollect(FAR struct smart_struct_s *dev) #ifdef CONFIG_SMART_LOCAL_CHECKFREE if (smart_checkfree(dev, __LINE__) != OK) { - fdbg(" ...while collecting block %d\n", collectblock); + ferr(" ...while collecting block %d\n", collectblock); } #endif @@ -3876,7 +3876,7 @@ static int smart_write_wearstatus(struct smart_struct_s *dev) if (sector >= SMART_FIRST_DIR_SECTOR) { /* Error, wear status bit too large! */ - fdbg("Invalid geometry - wear level status too large\n"); + ferr("Invalid geometry - wear level status too large\n"); ret = -EINVAL; goto errout; } @@ -3987,7 +3987,7 @@ static inline int smart_read_wearstatus(FAR struct smart_struct_s *dev) ret = smart_allocsector(dev, sector); if (ret != sector) { - fdbg("Unable to allocate wear level status sector %d\n", sector); + ferr("Unable to allocate wear level status sector %d\n", sector); ret = -EINVAL; goto errout; } @@ -4014,7 +4014,7 @@ static inline int smart_read_wearstatus(FAR struct smart_struct_s *dev) { /* Error, wear status bit too large! */ - fdbg("Invalid geometry - wear level status too large\n"); + ferr("Invalid geometry - wear level status too large\n"); ret = -EINVAL; goto errout; } @@ -4095,7 +4095,7 @@ static int smart_write_alloc_sector(FAR struct smart_struct_s *dev, { /* The block is not empty!! What to do? */ - fdbg("Write block %d failed: %d.\n", physical * + ferr("Write block %d failed: %d.\n", physical * dev->mtdBlksPerSector, ret); /* Unlock the mutex if we add one */ @@ -4200,7 +4200,7 @@ static int smart_writesector(FAR struct smart_struct_s *dev, if (req->logsector >= dev->totalsectors) { - fdbg("Logical sector %d too large\n", req->logsector); + ferr("Logical sector %d too large\n", req->logsector); ret = -EINVAL; goto errout; @@ -4239,7 +4239,7 @@ static int smart_writesector(FAR struct smart_struct_s *dev, #endif if (physsector == 0xFFFF) { - fdbg("Logical sector %d not allocated\n", req->logsector); + ferr("Logical sector %d not allocated\n", req->logsector); ret = -EINVAL; goto errout; } @@ -4251,7 +4251,7 @@ static int smart_writesector(FAR struct smart_struct_s *dev, dev->rwbuffer); if (ret != dev->mtdBlksPerSector) { - fdbg("Error reading phys sector %d\n", physsector); + ferr("Error reading phys sector %d\n", physsector); ret = -EIO; goto errout; } @@ -4323,7 +4323,7 @@ static int smart_writesector(FAR struct smart_struct_s *dev, physsector = smart_findfreephyssector(dev, FALSE); if (physsector == 0xFFFF) { - fdbg("Error relocating sector %d\n", req->logsector); + ferr("Error relocating sector %d\n", req->logsector); ret = -EIO; goto errout; } @@ -4443,7 +4443,7 @@ static int smart_writesector(FAR struct smart_struct_s *dev, dev->mtdBlksPerSector, (FAR uint8_t *) dev->rwbuffer); if (ret != dev->mtdBlksPerSector) { - fdbg("Error writing to physical sector %d\n", physsector); + ferr("Error writing to physical sector %d\n", physsector); ret = -EIO; goto errout; } @@ -4527,7 +4527,7 @@ static int smart_writesector(FAR struct smart_struct_s *dev, dev->mtdBlksPerSector, (FAR uint8_t *) dev->rwbuffer); if (ret != dev->mtdBlksPerSector) { - fdbg("Error writing to physical sector %d\n", physsector); + ferr("Error writing to physical sector %d\n", physsector); ret = -EIO; goto errout; } @@ -4547,7 +4547,7 @@ static int smart_writesector(FAR struct smart_struct_s *dev, { /* TODO: Mark this as a bad block! */ - fdbg("Error validating physical sector %d\n", physsector); + ferr("Error validating physical sector %d\n", physsector); ret = -EIO; goto errout; } @@ -4602,7 +4602,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev, if (req->logsector >= dev->totalsectors) { - fdbg("Logical sector %d too large\n", req->logsector); + ferr("Logical sector %d too large\n", req->logsector); ret = -EINVAL; goto errout; @@ -4615,7 +4615,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev, #endif if (physsector == 0xFFFF) { - fdbg("Logical sector %d not allocated\n", req->logsector); + ferr("Logical sector %d not allocated\n", req->logsector); ret = -EINVAL; goto errout; } @@ -4632,7 +4632,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev, { /* TODO: Mark the block bad */ - fdbg("Error reading phys sector %d\n", physsector); + ferr("Error reading phys sector %d\n", physsector); ret = -EIO; goto errout; } @@ -4657,7 +4657,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev, { /* TODO: Mark the block bad */ - fdbg("Error validating sector %d CRC during read\n", physsector); + ferr("Error validating sector %d CRC during read\n", physsector); ret = -EIO; goto errout; } @@ -4690,7 +4690,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev, { /* Error in sector header! How do we handle this? */ - fdbg("Error in logical sector %d header, phys=%d\n", + ferr("Error in logical sector %d header, phys=%d\n", req->logsector, physsector); ret = -EIO; goto errout; @@ -4705,7 +4705,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev, req->buffer); if (ret != req->count) { - fdbg("Error reading phys sector %d\n", physsector); + ferr("Error reading phys sector %d\n", physsector); ret = -EIO; goto errout; } @@ -4873,7 +4873,7 @@ static inline int smart_allocsector(FAR struct smart_struct_s *dev, * bug in our code? */ - fdbg("No free logical sector numbers! Free sectors = %d\n", + ferr("No free logical sector numbers! Free sectors = %d\n", dev->freesectors); return -EIO; @@ -4907,7 +4907,7 @@ static inline int smart_allocsector(FAR struct smart_struct_s *dev, kmm_malloc(sizeof(struct smart_allocsector_s)); if (allocsect == NULL) { - fdbg("Out of memory allocting sector\n"); + ferr("Out of memory allocting sector\n"); return -ENOMEM; } @@ -4988,7 +4988,7 @@ static inline int smart_freesector(FAR struct smart_struct_s *dev, if (!(dev->sBitMap[logicalsector >> 3] & (1 << (logicalsector & 0x07)))) #endif { - fdbg("Invalid release - sector %d not allocated\n", logicalsector); + ferr("Invalid release - sector %d not allocated\n", logicalsector); ret = -EINVAL; goto errout; } @@ -5015,7 +5015,7 @@ static inline int smart_freesector(FAR struct smart_struct_s *dev, { /* Hmmm... something is wrong. This should always match! Bug in our code? */ - fdbg("Sector %d logical sector in header doesn't match\n", logicalsector); + ferr("Sector %d logical sector in header doesn't match\n", logicalsector); ret = -EINVAL; goto errout; } @@ -5034,7 +5034,7 @@ static inline int smart_freesector(FAR struct smart_struct_s *dev, ret = smart_bytewrite(dev, offset, 1, &header.status); if (ret != 1) { - fdbg("Error updating physical sector %d status\n", physsector); + ferr("Error updating physical sector %d status\n", physsector); goto errout; } @@ -5107,7 +5107,7 @@ static int smart_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) #ifdef CONFIG_DEBUG_FEATURES if (arg == 0) { - fdbg("ERROR: BIOC_XIPBASE argument is NULL\n"); + ferr("ERROR: BIOC_XIPBASE argument is NULL\n"); return -EINVAL; } #endif @@ -5228,7 +5228,7 @@ static int smart_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) { case SMART_DEBUG_CMD_SET_DEBUG_LEVEL: dev->debuglevel = debug_data->debugdata; - dbg("Debug level set to %d\n", dev->debuglevel); + err("Debug level set to %d\n", dev->debuglevel); ret = OK; goto ok_out; @@ -5246,7 +5246,7 @@ static int smart_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) ret = MTD_IOCTL(dev->mtd, cmd, arg); if (ret < 0) { - fdbg("ERROR: MTD ioctl(%04x) failed: %d\n", cmd, ret); + ferr("ERROR: MTD ioctl(%04x) failed: %d\n", cmd, ret); } ok_out: @@ -5314,7 +5314,7 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd, FAR const char *partn ret = MTD_IOCTL(mtd, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&dev->geo)); if (ret < 0) { - fdbg("MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", ret); + ferr("MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", ret); goto errout; } @@ -5348,7 +5348,7 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd, FAR const char *partn totalsectors = dev->neraseblocks * dev->sectorsPerBlk; if (totalsectors > 65536) { - fdbg("SMART Sector size too small for device\n"); + ferr("SMART Sector size too small for device\n"); ret = -EINVAL; goto errout; } @@ -5399,7 +5399,7 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd, FAR const char *partn smart_malloc(dev, sizeof(*rootdirdev), "Root Dir"); if (rootdirdev == NULL) { - fdbg("register_blockdriver failed: %d\n", -ret); + ferr("register_blockdriver failed: %d\n", -ret); ret = -ENOMEM; goto errout; } @@ -5427,7 +5427,7 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd, FAR const char *partn if (ret < 0) { - fdbg("register_blockdriver failed: %d\n", -ret); + ferr("register_blockdriver failed: %d\n", -ret); goto errout; } @@ -5436,7 +5436,7 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd, FAR const char *partn ret = smart_scan(dev); if (ret < 0) { - fdbg("smart_scan failed: %d\n", -ret); + ferr("smart_scan failed: %d\n", -ret); goto errout; } } @@ -5564,7 +5564,7 @@ static int smart_loteardown(FAR const char *devname) ret = open_blockdriver(devname, MS_RDONLY, &inode); if (ret < 0) { - dbg("Failed to open %s: %d\n", devname, -ret); + err("Failed to open %s: %d\n", devname, -ret); return ret; } @@ -5576,7 +5576,7 @@ static int smart_loteardown(FAR const char *devname) if (!filemtd_isfilemtd(dev->mtd)) { - fdbg("Device is not a SMART loop: %s\n", devname); + ferr("Device is not a SMART loop: %s\n", devname); return -EINVAL; } diff --git a/drivers/mtd/sst25.c b/drivers/mtd/sst25.c index 24105a01b7..e079de8b93 100644 --- a/drivers/mtd/sst25.c +++ b/drivers/mtd/sst25.c @@ -1206,7 +1206,7 @@ FAR struct mtd_dev_s *sst25_initialize(FAR struct spi_dev_s *dev) { /* Unrecognized! Discard all of that work we just did and return NULL */ - fdbg("Unrecognized\n"); + ferr("Unrecognized\n"); kmm_free(priv); priv = NULL; } @@ -1226,7 +1226,7 @@ FAR struct mtd_dev_s *sst25_initialize(FAR struct spi_dev_s *dev) { /* Allocation failed! Discard all of that work we just did and return NULL */ - fdbg("Allocation failed\n"); + ferr("Allocation failed\n"); kmm_free(priv); priv = NULL; } diff --git a/drivers/mtd/sst25xx.c b/drivers/mtd/sst25xx.c index ee6f6a55fa..202019fda3 100644 --- a/drivers/mtd/sst25xx.c +++ b/drivers/mtd/sst25xx.c @@ -954,7 +954,7 @@ FAR struct mtd_dev_s *sst25xx_initialize(FAR struct spi_dev_s *dev) { /* Unrecognized! Discard all of that work we just did and return NULL */ - fdbg("Unrecognized\n"); + ferr("Unrecognized\n"); kmm_free(priv); priv = NULL; } diff --git a/drivers/mtd/sst26.c b/drivers/mtd/sst26.c index c92b90bd17..4e31a592a0 100644 --- a/drivers/mtd/sst26.c +++ b/drivers/mtd/sst26.c @@ -208,12 +208,12 @@ /* Debug ****************************************************************************/ #ifdef CONFIG_SST26_DEBUG -# define sstdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define ssterr(format, ...) err(format, ##__VA_ARGS__) # define sstllerr(format, ...) llerr(format, ##__VA_ARGS__) # define sstinfo(format, ...) info(format, ##__VA_ARGS__) # define sstllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define sstdbg(x...) +# define ssterr(x...) # define sstllerr(x...) # define sstinfo(x...) # define sstllinfo(x...) @@ -936,7 +936,7 @@ FAR struct mtd_dev_s *sst26_initialize_spi(FAR struct spi_dev_s *dev) { /* Unrecognized! Discard all of that work we just did and return NULL */ - sstdbg("Unrecognized\n"); + ssterr("Unrecognized\n"); kmm_free(priv); priv = NULL; } diff --git a/drivers/mtd/sst39vf.c b/drivers/mtd/sst39vf.c index 0c7e2cac61..2b5cbe9c6a 100644 --- a/drivers/mtd/sst39vf.c +++ b/drivers/mtd/sst39vf.c @@ -819,7 +819,7 @@ FAR struct mtd_dev_s *sst39vf_initialize(void) if (manufacturer != SST_MANUFACTURER_ID) { - fdbg("Unrecognized manufacturer: %02x\n", manufacturer); + ferr("Unrecognized manufacturer: %02x\n", manufacturer); return NULL; } else if (chipid == g_sst39vf1601.chipid) @@ -840,7 +840,7 @@ FAR struct mtd_dev_s *sst39vf_initialize(void) } else { - fdbg("Unrecognized chip ID: %04x\n", chipid); + ferr("Unrecognized chip ID: %04x\n", chipid); return NULL; } diff --git a/drivers/mtd/w25.c b/drivers/mtd/w25.c index 0f3696ffd8..8dce926494 100644 --- a/drivers/mtd/w25.c +++ b/drivers/mtd/w25.c @@ -1256,7 +1256,7 @@ FAR struct mtd_dev_s *w25_initialize(FAR struct spi_dev_s *spi) { /* Unrecognized! Discard all of that work we just did and return NULL */ - fdbg("Unrecognized\n"); + ferr("Unrecognized\n"); kmm_free(priv); priv = NULL; } @@ -1276,7 +1276,7 @@ FAR struct mtd_dev_s *w25_initialize(FAR struct spi_dev_s *spi) { /* Allocation failed! Discard all of that work we just did and return NULL */ - fdbg("Allocation failed\n"); + ferr("Allocation failed\n"); kmm_free(priv); priv = NULL; } diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index a9e26152ed..274c247ebb 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c @@ -704,7 +704,7 @@ static int cs89x0_interrupt(int irq, FAR void *context) case ISQ_BUFEVENT: if ((isq & ISQ_BUFEVENT_TXUNDERRUN) != 0) { - ndbg("Transmit underrun\n"); + nerr("Transmit underrun\n"); #ifdef CONFIG_CS89x0_XMITEARLY cd89x0->cs_txunderrun++; if (cd89x0->cs_txunderrun == 3) @@ -819,7 +819,7 @@ static int cs89x0_ifup(struct net_driver_s *dev) { struct cs89x0_driver_s *cs89x0 = (struct cs89x0_driver_s *)dev->d_private; - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); diff --git a/drivers/net/dm90x0.c b/drivers/net/dm90x0.c index 26b29c2904..1b59a49485 100644 --- a/drivers/net/dm90x0.c +++ b/drivers/net/dm90x0.c @@ -865,7 +865,7 @@ static void dm9x_receive(FAR struct dm9x_driver_s *dm9x) { /* Bad RX packet... update statistics */ - ndbg("Received packet with errors: %02x\n", rx.desc.rx_status); + nerr("Received packet with errors: %02x\n", rx.desc.rx_status); NETDEV_RXERRORS(&dm9x->dm_dev); /* Drop this packet and continue to check the next packet */ @@ -877,7 +877,7 @@ static void dm9x_receive(FAR struct dm9x_driver_s *dm9x) else if (rx.desc.rx_len < ETH_HDRLEN || rx.desc.rx_len > (CONFIG_NET_ETH_MTU + 2)) { - ndbg("RX length error\n"); + nerr("RX length error\n"); NETDEV_RXERRORS(&dm9x->dm_dev); /* Drop this packet and continue to check the next packet */ @@ -1042,7 +1042,7 @@ static void dm9x_txdone(struct dm9x_driver_s *dm9x) } else { - ndbg("Bad TX count (TX1END)\n"); + nerr("Bad TX count (TX1END)\n"); } } @@ -1054,7 +1054,7 @@ static void dm9x_txdone(struct dm9x_driver_s *dm9x) } else { - ndbg("Bad TX count (TX2END)\n"); + nerr("Bad TX count (TX2END)\n"); } } @@ -1144,7 +1144,7 @@ static int dm9x_interrupt(int irq, FAR void *context) } up_mdelay(1); } - ndbg("delay: %dmS speed: %s\n", i, dm9x->dm_b100M ? "100M" : "10M"); + nerr("delay: %dmS speed: %s\n", i, dm9x->dm_b100M ? "100M" : "10M"); } /* Check if we received an incoming packet */ @@ -1206,16 +1206,16 @@ static void dm9x_txtimeout(int argc, uint32_t arg, ...) { struct dm9x_driver_s *dm9x = (struct dm9x_driver_s *)arg; - ndbg("TX timeout\n"); + nerr("TX timeout\n"); /* Increment statistics and dump debug info */ NETDEV_TXTIMEOUTS(dm9x->dm_dev); - ndbg(" TX packet count: %d\n", dm9x->dm_ntxpending); - ndbg(" TX read pointer address: 0x%02x:%02x\n", + nerr(" TX packet count: %d\n", dm9x->dm_ntxpending); + nerr(" TX read pointer address: 0x%02x:%02x\n", getreg(DM9X_TRPAH), getreg(DM9X_TRPAL)); - ndbg(" Memory data write address: 0x%02x:%02x (DM9010)\n", + nerr(" Memory data write address: 0x%02x:%02x (DM9010)\n", getreg(DM9X_MDWAH), getreg(DM9X_MDWAL)); /* Then reset the DM90x0 */ @@ -1342,7 +1342,7 @@ static int dm9x_ifup(struct net_driver_s *dev) uint8_t netstatus; int i; - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); @@ -1372,7 +1372,7 @@ static int dm9x_ifup(struct net_driver_s *dev) up_mdelay(1); } - ndbg("delay: %dmS speed: %s\n", i, dm9x->dm_b100M ? "100M" : "10M"); + nerr("delay: %dmS speed: %s\n", i, dm9x->dm_b100M ? "100M" : "10M"); /* Set and activate a timer process */ @@ -1407,7 +1407,7 @@ static int dm9x_ifdown(struct net_driver_s *dev) struct dm9x_driver_s *dm9x = (struct dm9x_driver_s *)dev->d_private; irqstate_t flags; - ndbg("Stopping\n"); + nerr("Stopping\n"); /* Disable the DM9X interrupt */ @@ -1456,7 +1456,7 @@ static int dm9x_txavail(struct net_driver_s *dev) struct dm9x_driver_s *dm9x = (struct dm9x_driver_s *)dev->d_private; irqstate_t flags; - ndbg("Polling\n"); + nerr("Polling\n"); flags = enter_critical_section(); /* Ignore the notification if the interface is not yet up */ @@ -1557,7 +1557,7 @@ static int dm9x_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac) static void dm9x_bringup(struct dm9x_driver_s *dm9x) { - ndbg("Initializing\n"); + nerr("Initializing\n"); /* Set the internal PHY power-on, GPIOs normal, and wait 2ms */ diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index c176abc732..ae65ce3532 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -799,7 +799,7 @@ static int e1000_ifup(struct net_driver_s *dev) { struct e1000_dev *e1000 = (struct e1000_dev *)dev->d_private; - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c index f6ad670b2c..cf6bda2dbc 100644 --- a/drivers/net/ftmac100.c +++ b/drivers/net/ftmac100.c @@ -455,7 +455,7 @@ static void ftmac100_init(FAR struct ftmac100_driver_s *priv) FAR unsigned char *kmem; int i; - ndbg ("%s()\n", __func__); + nerr ("%s()\n", __func__); /* Disable all interrupts */ @@ -1311,12 +1311,12 @@ static int ftmac100_ifup(struct net_driver_s *dev) FAR struct ftmac100_driver_s *priv = (FAR struct ftmac100_driver_s *)dev->d_private; #ifdef CONFIG_NET_IPv4 - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); #endif #ifdef CONFIG_NET_IPv6 - ndbg("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + nerr("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2], dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5], dev->d_ipv6addr[6], dev->d_ipv6addr[7]); diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index c963f9e7b8..759e11d9b0 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c @@ -203,7 +203,7 @@ static int lo_txpoll(FAR struct net_driver_s *dev) else #endif { - ndbg("WARNING: Unrecognized packet type dropped: %02x\n", IPv4BUF->vhl); + nerr("WARNING: Unrecognized packet type dropped: %02x\n", IPv4BUF->vhl); NETDEV_RXDROPPED(&priv->lo_dev); priv->lo_dev.d_len = 0; } @@ -323,12 +323,12 @@ static int lo_ifup(FAR struct net_driver_s *dev) FAR struct lo_driver_s *priv = (FAR struct lo_driver_s *)dev->d_private; #ifdef CONFIG_NET_IPv4 - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); #endif #ifdef CONFIG_NET_IPv6 - ndbg("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + nerr("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2], dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5], dev->d_ipv6addr[6], dev->d_ipv6addr[7]); diff --git a/drivers/net/phy_notify.c b/drivers/net/phy_notify.c index b78cc65810..6c8e6c8a1e 100644 --- a/drivers/net/phy_notify.c +++ b/drivers/net/phy_notify.c @@ -82,10 +82,10 @@ */ #ifdef CONFIG_NETDEV_PHY_DEBUG -# define phydbg dbg +# define phyerr err # define phyllerr llerr #else -# define phydbg(x...) +# define phyerr(x...) # define phyllerr(x...) #endif @@ -208,14 +208,14 @@ static FAR struct phy_notify_s *phy_find_unassigned(void) /* Return the client entry assigned to the caller */ phy_semgive(); - phydbg("Returning client %d\n", i); + phyerr("Returning client %d\n", i); return client; } } /* Ooops... too many */ - ndbg("ERROR: No free client entries\n"); + nerr("ERROR: No free client entries\n"); phy_semgive(); return NULL; } @@ -243,7 +243,7 @@ static FAR struct phy_notify_s *phy_find_assigned(FAR const char *intf, /* Return the matching client entry to the caller */ phy_semgive(); - phydbg("Returning client %d\n", i); + phyerr("Returning client %d\n", i); return client; } } @@ -367,7 +367,7 @@ int phy_notify_subscribe(FAR const char *intf, pid_t pid, int signo, if (pid == 0) { pid = getpid(); - phydbg("Actual PID=%d\n", pid); + phyerr("Actual PID=%d\n", pid); } /* Check if this client already exists */ @@ -387,7 +387,7 @@ int phy_notify_subscribe(FAR const char *intf, pid_t pid, int signo, client = phy_find_unassigned(); if (!client) { - ndbg("ERROR: Failed to allocate a client entry\n"); + nerr("ERROR: Failed to allocate a client entry\n"); return -ENOMEM; } @@ -446,7 +446,7 @@ int phy_notify_unsubscribe(FAR const char *intf, pid_t pid) client = phy_find_assigned(intf, pid); if (!client) { - ndbg("ERROR: No such client\n"); + nerr("ERROR: No such client\n"); return -ENOENT; } diff --git a/drivers/net/skeleton.c b/drivers/net/skeleton.c index 4b49514da3..59b2e56c77 100644 --- a/drivers/net/skeleton.c +++ b/drivers/net/skeleton.c @@ -855,12 +855,12 @@ static int skel_ifup(FAR struct net_driver_s *dev) FAR struct skel_driver_s *priv = (FAR struct skel_driver_s *)dev->d_private; #ifdef CONFIG_NET_IPv4 - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); #endif #ifdef CONFIG_NET_IPv6 - ndbg("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + nerr("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2], dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5], dev->d_ipv6addr[6], dev->d_ipv6addr[7]); diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 98cd0117e4..4105314c78 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c @@ -438,7 +438,7 @@ static void slip_txtask(int argc, FAR char *argv[]) systime_t msec_now; unsigned int hsec; - ndbg("index: %d\n", index); + nerr("index: %d\n", index); DEBUGASSERT(index < CONFIG_NET_SLIP_NINTERFACES); /* Get our private data structure instance and wake up the waiting @@ -616,7 +616,7 @@ static inline void slip_receive(FAR struct slip_driver_s *priv) break; default: - ndbg("ERROR: Protocol violation: %02x\n", ch); + nerr("ERROR: Protocol violation: %02x\n", ch); break; } @@ -661,7 +661,7 @@ static int slip_rxtask(int argc, FAR char *argv[]) net_lock_t flags; int ch; - ndbg("index: %d\n", index); + nerr("index: %d\n", index); DEBUGASSERT(index < CONFIG_NET_SLIP_NINTERFACES); /* Get our private data structure instance and wake up the waiting @@ -779,7 +779,7 @@ static int slip_ifup(FAR struct net_driver_s *dev) { FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private; - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); @@ -958,7 +958,7 @@ int slip_initialize(int intf, FAR const char *devname) priv->fd = open(devname, O_RDWR, 0666); if (priv->fd < 0) { - ndbg("ERROR: Failed to open %s: %d\n", devname, errno); + nerr("ERROR: Failed to open %s: %d\n", devname, errno); return -errno; } @@ -983,7 +983,7 @@ int slip_initialize(int intf, FAR const char *devname) (FAR char * const *)argv); if (priv->rxpid < 0) { - ndbg("ERROR: Failed to start receiver task\n"); + nerr("ERROR: Failed to start receiver task\n"); return -errno; } @@ -998,7 +998,7 @@ int slip_initialize(int intf, FAR const char *devname) (FAR char * const *)argv); if (priv->txpid < 0) { - ndbg("ERROR: Failed to start receiver task\n"); + nerr("ERROR: Failed to start receiver task\n"); return -errno; } diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 96de54844c..bffd391b36 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -646,12 +646,12 @@ static int tun_ifup(struct net_driver_s *dev) FAR struct tun_device_s *priv = (FAR struct tun_device_s *)dev->d_private; #ifdef CONFIG_NET_IPv4 - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); #endif #ifdef CONFIG_NET_IPv6 - ndbg("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + nerr("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2], dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5], dev->d_ipv6addr[6], dev->d_ipv6addr[7]); diff --git a/drivers/net/vnet.c b/drivers/net/vnet.c index c96845c1b9..86a5070813 100644 --- a/drivers/net/vnet.c +++ b/drivers/net/vnet.c @@ -546,7 +546,7 @@ static int vnet_ifup(struct net_driver_s *dev) { FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private; - ndbg("Bringing up: %d.%d.%d.%d\n", + nerr("Bringing up: %d.%d.%d.%d\n", dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); diff --git a/drivers/pipes/pipe_common.c b/drivers/pipes/pipe_common.c index fe728c2f35..3f5e72ae5a 100644 --- a/drivers/pipes/pipe_common.c +++ b/drivers/pipes/pipe_common.c @@ -205,7 +205,7 @@ int pipecommon_open(FAR struct file *filep) ret = sem_wait(&dev->d_bfsem); if (ret != OK) { - fdbg("sem_wait failed: %d\n", get_errno()); + ferr("sem_wait failed: %d\n", get_errno()); DEBUGASSERT(get_errno() > 0); return -get_errno(); } @@ -283,7 +283,7 @@ int pipecommon_open(FAR struct file *filep) * a signal. */ - fdbg("sem_wait failed: %d\n", get_errno()); + ferr("sem_wait failed: %d\n", get_errno()); DEBUGASSERT(get_errno() > 0); ret = -get_errno(); @@ -519,7 +519,7 @@ ssize_t pipecommon_write(FAR struct file *filep, FAR const char *buffer, /* At present, this method cannot be called from interrupt handlers. That is * because it calls sem_wait (via pipecommon_semtake below) and sem_wait cannot * be called from interrupt level. This actually happens fairly commonly - * IF dbg() is called from interrupt handlers and stdout is being redirected + * IF err() is called from interrupt handlers and stdout is being redirected * via a pipe. In that case, the debug output will try to go out the pipe * (interrupt handlers should use the llerr() APIs). * diff --git a/drivers/power/battery_charger.c b/drivers/power/battery_charger.c index 056e16e98c..2fff5afc2c 100644 --- a/drivers/power/battery_charger.c +++ b/drivers/power/battery_charger.c @@ -228,7 +228,7 @@ static int bat_charger_ioctl(FAR struct file *filep, int cmd, break; default: - dbg("Unrecognized cmd: %d\n", cmd); + err("Unrecognized cmd: %d\n", cmd); ret = -ENOTTY; break; } @@ -268,7 +268,7 @@ int battery_charger_register(FAR const char *devpath, ret = register_driver(devpath, &g_batteryops, 0555, dev); if (ret < 0) { - dbg("Failed to register driver: %d\n", ret); + err("Failed to register driver: %d\n", ret); } return ret; diff --git a/drivers/power/battery_gauge.c b/drivers/power/battery_gauge.c index cf6a962e2b..e913c733c8 100644 --- a/drivers/power/battery_gauge.c +++ b/drivers/power/battery_gauge.c @@ -213,7 +213,7 @@ static int bat_gauge_ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; default: - dbg("Unrecognized cmd: %d\n", cmd); + err("Unrecognized cmd: %d\n", cmd); ret = -ENOTTY; break; } @@ -253,7 +253,7 @@ int battery_gauge_register(FAR const char *devpath, ret = register_driver(devpath, &g_batteryops, 0555, dev); if (ret < 0) { - dbg("Failed to register driver: %d\n", ret); + err("Failed to register driver: %d\n", ret); } return ret; diff --git a/drivers/power/bq2425x.c b/drivers/power/bq2425x.c index 073c3ce379..8f2198f213 100644 --- a/drivers/power/bq2425x.c +++ b/drivers/power/bq2425x.c @@ -78,12 +78,12 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_BQ2425X -# define batdbg dbg +# define baterr err #else # ifdef CONFIG_CPP_HAVE_VARARGS -# define batdbg(x...) +# define baterr(x...) # else -# define batdbg (void) +# define baterr (void) # endif #endif @@ -176,7 +176,7 @@ static int bq2425x_getreg8(FAR struct bq2425x_dev_s *priv, uint8_t regaddr, ret = i2c_write(priv->i2c, &config, ®addr, 1); if (ret < 0) { - batdbg("i2c_write failed: %d\n", ret); + baterr("i2c_write failed: %d\n", ret); return ret; } @@ -185,7 +185,7 @@ static int bq2425x_getreg8(FAR struct bq2425x_dev_s *priv, uint8_t regaddr, ret = i2c_read(priv->i2c, &config, &val, 1); if (ret < 0) { - batdbg("i2c_read failed: %d\n", ret); + baterr("i2c_read failed: %d\n", ret); return ret; } @@ -217,7 +217,7 @@ static int bq2425x_putreg8(FAR struct bq2425x_dev_s *priv, uint8_t regaddr, config.address = priv->addr; config.addrlen = 7; - batdbg("addr: %02x regval: %08x\n", regaddr, regval); + baterr("addr: %02x regval: %08x\n", regaddr, regval); /* Set up a 3 byte message to send */ @@ -270,7 +270,7 @@ static inline int bq2425x_reset(FAR struct bq2425x_dev_s *priv) ret = bq2425x_getreg8(priv, BQ2425X_REG_2, ®val); if (ret < 0) { - batdbg("Error reading from BQ2425X! Error = %d\n", ret); + baterr("Error reading from BQ2425X! Error = %d\n", ret); return ret; } @@ -280,7 +280,7 @@ static inline int bq2425x_reset(FAR struct bq2425x_dev_s *priv) ret = bq2425x_putreg8(priv, BQ2425X_REG_2, regval); if (ret < 0) { - batdbg("Error writing to BQ2425X! Error = %d\n", ret); + baterr("Error writing to BQ2425X! Error = %d\n", ret); return ret; } @@ -294,7 +294,7 @@ static inline int bq2425x_reset(FAR struct bq2425x_dev_s *priv) ret = bq2425x_putreg8(priv, BQ2425X_REG_2, regval); if (ret < 0) { - batdbg("Error writing to BQ2425X! Error = %d\n", ret); + baterr("Error writing to BQ2425X! Error = %d\n", ret); return ret; } @@ -317,7 +317,7 @@ static inline int bq2425x_watchdog(FAR struct bq2425x_dev_s *priv, bool enable) ret = bq2425x_getreg8(priv, BQ2425X_REG_1, ®val); if (ret < 0) { - batdbg("Error reading from BQ2425X! Error = %d\n", ret); + baterr("Error reading from BQ2425X! Error = %d\n", ret); return ret; } @@ -333,7 +333,7 @@ static inline int bq2425x_watchdog(FAR struct bq2425x_dev_s *priv, bool enable) ret = bq2425x_putreg8(priv, BQ2425X_REG_1, regval); if (ret < 0) { - batdbg("Error writing to BQ2425X! Error = %d\n", ret); + baterr("Error writing to BQ2425X! Error = %d\n", ret); return ret; } @@ -515,7 +515,7 @@ static inline int bq2425x_powersupply(FAR struct bq2425x_dev_s *priv, int curren break; default: - batdbg("Current not supported, setting default to 100mA.!\n"); + baterr("Current not supported, setting default to 100mA.!\n"); idx = BQ2425X_INP_CURR_LIM_100MA; break; } @@ -525,7 +525,7 @@ static inline int bq2425x_powersupply(FAR struct bq2425x_dev_s *priv, int curren ret = bq2425x_getreg8(priv, BQ2425X_REG_2, ®val); if (ret < 0) { - batdbg("Error reading from BQ2425X! Error = %d\n", ret); + baterr("Error reading from BQ2425X! Error = %d\n", ret); return ret; } @@ -541,7 +541,7 @@ static inline int bq2425x_powersupply(FAR struct bq2425x_dev_s *priv, int curren ret = bq2425x_putreg8(priv, BQ2425X_REG_2, regval); if (ret < 0) { - batdbg("Error writing to BQ2425X! Error = %d\n", ret); + baterr("Error writing to BQ2425X! Error = %d\n", ret); return ret; } @@ -565,14 +565,14 @@ static inline int bq2425x_setvolt(FAR struct bq2425x_dev_s *priv, int volts) if (volts < BQ2425X_VOLT_MIN || volts > BQ2425X_VOLT_MAX) { - batdbg("Voltage %d mV is out of range.\n", volts); + baterr("Voltage %d mV is out of range.\n", volts); return -EINVAL; } ret = bq2425x_getreg8(priv, BQ2425X_REG_3, ®val); if (ret < 0) { - batdbg("Error reading from BQ2425X! Error = %d\n", ret); + baterr("Error reading from BQ2425X! Error = %d\n", ret); return ret; } @@ -589,7 +589,7 @@ static inline int bq2425x_setvolt(FAR struct bq2425x_dev_s *priv, int volts) ret = bq2425x_putreg8(priv, BQ2425X_REG_3, regval); if (ret < 0) { - batdbg("Error writing to BQ2425X! Error = %d\n", ret); + baterr("Error writing to BQ2425X! Error = %d\n", ret); return ret; } @@ -613,14 +613,14 @@ static inline int bq2425x_setcurr(FAR struct bq2425x_dev_s *priv, int current) if (current < BQ2425X_CURR_MIN || current > BQ2425X_CURR_MAX) { - batdbg("Current %d mA is out of range.\n", volts); + baterr("Current %d mA is out of range.\n", volts); return -EINVAL; } ret = bq2425x_getreg8(priv, BQ2425X_REG_4, ®val); if (ret < 0) { - batdbg("Error reading from BQ2425X! Error = %d\n", ret); + baterr("Error reading from BQ2425X! Error = %d\n", ret); return ret; } @@ -637,7 +637,7 @@ static inline int bq2425x_setcurr(FAR struct bq2425x_dev_s *priv, int current) ret = bq2425x_putreg8(priv, BQ2425X_REG_4, regval); if (ret < 0) { - batdbg("Error writing to BQ2425X! Error = %d\n", ret); + baterr("Error writing to BQ2425X! Error = %d\n", ret); return ret; } @@ -663,7 +663,7 @@ static int bq2425x_voltage(struct battery_charger_dev_s *dev, int value) ret = bq2425x_setvolt(priv, value); if (ret < 0) { - batdbg("Error setting voltage to BQ2425X! Error = %d\n", ret); + baterr("Error setting voltage to BQ2425X! Error = %d\n", ret); return ret; } @@ -688,7 +688,7 @@ static int bq2425x_current(struct battery_charger_dev_s *dev, int value) ret = bq2425x_setcurr(priv, value); if (ret < 0) { - batdbg("Error setting current to BQ2425X! Error = %d\n", ret); + baterr("Error setting current to BQ2425X! Error = %d\n", ret); return ret; } @@ -749,7 +749,7 @@ FAR struct battery_charger_dev_s * ret = bq2425x_reset(priv); if (ret < 0) { - batdbg("Failed to reset the BQ2425x: %d\n", ret); + baterr("Failed to reset the BQ2425x: %d\n", ret); kmm_free(priv); return NULL; } @@ -759,7 +759,7 @@ FAR struct battery_charger_dev_s * ret = bq2425x_watchdog(priv, false); if (ret < 0) { - batdbg("Failed to disable BQ2425x watchdog: %d\n", ret); + baterr("Failed to disable BQ2425x watchdog: %d\n", ret); kmm_free(priv); return NULL; } @@ -769,7 +769,7 @@ FAR struct battery_charger_dev_s * ret = bq2425x_powersupply(priv, 2000); if (ret < 0) { - batdbg("Failed to set BQ2425x power supply current: %d\n", ret); + baterr("Failed to set BQ2425x power supply current: %d\n", ret); kmm_free(priv); return NULL; } diff --git a/drivers/power/max1704x.c b/drivers/power/max1704x.c index 7fa3f85060..ac1d7ef80f 100644 --- a/drivers/power/max1704x.c +++ b/drivers/power/max1704x.c @@ -160,12 +160,12 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_MAX1704X -# define batdbg dbg +# define baterr err #else # ifdef CONFIG_CPP_HAVE_VARARGS -# define batdbg(x...) +# define baterr(x...) # else -# define batdbg (void) +# define baterr (void) # endif #endif @@ -258,7 +258,7 @@ static int max1704x_getreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr, ret = i2c_write(priv->i2c, &config, ®addr, 1); if (ret < 0) { - batdbg("i2c_write failed: %d\n", ret); + baterr("i2c_write failed: %d\n", ret); return ret; } @@ -267,7 +267,7 @@ static int max1704x_getreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr, ret = i2c_read(priv->i2c, &config, buffer, 2); if (ret < 0) { - batdbg("i2c_read failed: %d\n", ret); + baterr("i2c_read failed: %d\n", ret); return ret; } @@ -292,7 +292,7 @@ static int max1704x_putreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr, struct i2c_config_s config; uint8_t buffer[3]; - batdbg("addr: %02x regval: %08x\n", regaddr, regval); + baterr("addr: %02x regval: %08x\n", regaddr, regval); /* Set up a 3 byte message to send */ @@ -554,7 +554,7 @@ FAR struct battery_gauge_dev_s *max1704x_initialize(FAR struct i2c_master_s *i2c ret = max1704x_reset(priv); if (ret < 0) { - batdbg("Failed to reset the MAX1704x: %d\n", ret); + baterr("Failed to reset the MAX1704x: %d\n", ret); kmm_free(priv); return NULL; } diff --git a/drivers/pwm.c b/drivers/pwm.c index 0b0e173d4e..d8b023042b 100644 --- a/drivers/pwm.c +++ b/drivers/pwm.c @@ -71,12 +71,12 @@ /* Non-standard debug that may be enabled just for testing PWM */ #ifdef CONFIG_DEBUG_PWM -# define pwmdbg dbg +# define pwmerr err # define pwminfo info # define pwmllerr llerr # define pwmllinfo llinfo #else -# define pwmdbg(x...) +# define pwmerr(x...) # define pwminfo(x...) # define pwmllerr(x...) # define pwmllinfo(x...) @@ -610,7 +610,7 @@ int pwm_register(FAR const char *path, FAR struct pwm_lowerhalf_s *dev) upper = (FAR struct pwm_upperhalf_s *)kmm_zalloc(sizeof(struct pwm_upperhalf_s)); if (!upper) { - pwmdbg("Allocation failed\n"); + pwmerr("Allocation failed\n"); return -ENOMEM; } diff --git a/drivers/ramdisk.c b/drivers/ramdisk.c index ef35b11656..4ce4057103 100644 --- a/drivers/ramdisk.c +++ b/drivers/ramdisk.c @@ -487,7 +487,7 @@ int romdisk_register(int minor, FAR const uint8_t *buffer, uint32_t nsectors, ret = register_blockdriver(devname, &g_bops, 0, dev); if (ret < 0) { - fdbg("register_blockdriver failed: %d\n", -ret); + ferr("register_blockdriver failed: %d\n", -ret); kmm_free(dev); } } diff --git a/drivers/rwbuffer.c b/drivers/rwbuffer.c index 3eb4b8338b..fd5b6e53ee 100644 --- a/drivers/rwbuffer.c +++ b/drivers/rwbuffer.c @@ -176,7 +176,7 @@ static void rwb_wrflush(struct rwbuffer_s *rwb) ret = rwb->wrflush(rwb->dev, rwb->wrbuffer, rwb->wrblockstart, rwb->wrnblocks); if (ret != rwb->wrnblocks) { - fdbg("ERROR: Error flushing write buffer: %d\n", ret); + ferr("ERROR: Error flushing write buffer: %d\n", ret); } rwb_resetwrbuffer(rwb); @@ -260,7 +260,7 @@ static ssize_t rwb_writebuffer(FAR struct rwbuffer_s *rwb, ret = rwb->wrflush(rwb->dev, rwb->wrbuffer, rwb->wrblockstart, rwb->wrnblocks); if (ret < 0) { - fdbg("ERROR: Error writing multiple from cache: %d\n", -ret); + ferr("ERROR: Error writing multiple from cache: %d\n", -ret); return ret; } @@ -461,7 +461,7 @@ int rwb_invalidate_writebuffer(FAR struct rwbuffer_s *rwb, ret = rwb->wrflush(rwb->dev, src, block, nblocks); if (ret < 0) { - fdbg("ERROR: wrflush failed: %d\n", ret); + ferr("ERROR: wrflush failed: %d\n", ret); } /* Keep the blocks at the beginning of the buffer up the @@ -670,7 +670,7 @@ int rwb_initialize(FAR struct rwbuffer_s *rwb) rwb->wrbuffer = kmm_malloc(allocsize); if (!rwb->wrbuffer) { - fdbg("Write buffer kmm_malloc(%d) failed\n", allocsize); + ferr("Write buffer kmm_malloc(%d) failed\n", allocsize); return -ENOMEM; } } @@ -701,7 +701,7 @@ int rwb_initialize(FAR struct rwbuffer_s *rwb) rwb->rhbuffer = kmm_malloc(allocsize); if (!rwb->rhbuffer) { - fdbg("Read-ahead buffer kmm_malloc(%d) failed\n", allocsize); + ferr("Read-ahead buffer kmm_malloc(%d) failed\n", allocsize); return -ENOMEM; } } @@ -821,7 +821,7 @@ ssize_t rwb_read(FAR struct rwbuffer_s *rwb, off_t startblock, ret = rwb_rhreload(rwb, startblock); if (ret < 0) { - fdbg("ERROR: Failed to fill the read-ahead buffer: %d\n", ret); + ferr("ERROR: Failed to fill the read-ahead buffer: %d\n", ret); return (ssize_t)ret; } } @@ -999,7 +999,7 @@ int rwb_invalidate(FAR struct rwbuffer_s *rwb, ret = rwb_invalidate_writebuffer(rwb, startblock, blockcount); if (ret < 0) { - fdbg("ERROR: rwb_invalidate_writebuffer failed: %d\n", ret); + ferr("ERROR: rwb_invalidate_writebuffer failed: %d\n", ret); return ret; } #endif @@ -1008,7 +1008,7 @@ int rwb_invalidate(FAR struct rwbuffer_s *rwb, ret = rwb_invalidate_readahead(rwb, startblock, blockcount); if (ret < 0) { - fdbg("ERROR: rwb_invalidate_readahead failed: %d\n", ret); + ferr("ERROR: rwb_invalidate_readahead failed: %d\n", ret); return ret; } #endif diff --git a/drivers/sensors/adxl345_base.c b/drivers/sensors/adxl345_base.c index e96aff0838..2b30508207 100644 --- a/drivers/sensors/adxl345_base.c +++ b/drivers/sensors/adxl345_base.c @@ -205,7 +205,7 @@ int adxl345_register(ADXL345_HANDLE handle, int minor) if (ret < 0) { int errval = errno; - sndbg("ERROR: sem_wait failed: %d\n", errval); + snerr("ERROR: sem_wait failed: %d\n", errval); return -errval; } @@ -221,7 +221,7 @@ int adxl345_register(ADXL345_HANDLE handle, int minor) ret = register_driver(devname, &g_adxl345fops, 0666, priv); if (ret < 0) { - sndbg("ERROR: Failed to register driver %s: %d\n", devname, ret); + snerr("ERROR: Failed to register driver %s: %d\n", devname, ret); sem_post(&priv->exclsem); return ret; } @@ -397,7 +397,7 @@ ADXL345_HANDLE adxl345_instantiate(FAR struct i2c_master_s *dev, priv = (FAR struct adxl345_dev_s *)kmm_zalloc(sizeof(struct adxl345_dev_s)); if (!priv) { - sndbg("Failed to allocate the device structure!\n"); + snerr("Failed to allocate the device structure!\n"); return NULL; } @@ -418,7 +418,7 @@ ADXL345_HANDLE adxl345_instantiate(FAR struct i2c_master_s *dev, ret = adxl345_checkid(priv); if (ret < 0) { - sndbg("Wrong Device ID!\n"); + snerr("Wrong Device ID!\n"); kmm_free(priv); return NULL; } diff --git a/drivers/sensors/adxl345_i2c.c b/drivers/sensors/adxl345_i2c.c index a2dfd81961..54c0aef44b 100644 --- a/drivers/sensors/adxl345_i2c.c +++ b/drivers/sensors/adxl345_i2c.c @@ -97,12 +97,12 @@ uint8_t adxl345_getreg8(FAR struct adxl345_dev_s *priv, uint8_t regaddr) ret = I2C_TRANSFER(priv->i2c, msg, 2); if (ret < 0) { - sndbg("I2C_TRANSFER failed: %d\n", ret); + snerr("I2C_TRANSFER failed: %d\n", ret); return 0; } #ifdef CONFIG_ADXL345_REGDEBUG - dbg("%02x->%02x\n", regaddr, regval); + err("%02x->%02x\n", regaddr, regval); #endif return regval; } @@ -130,7 +130,7 @@ void adxl345_putreg8(FAR struct adxl345_dev_s *priv, int ret; #ifdef CONFIG_ADXL345_REGDEBUG - dbg("%02x<-%02x\n", regaddr, regval); + err("%02x<-%02x\n", regaddr, regval); #endif /* Setup to the data to be transferred. Two bytes: The ADXL345 register @@ -154,7 +154,7 @@ void adxl345_putreg8(FAR struct adxl345_dev_s *priv, ret = I2C_TRANSFER(priv->i2c, &msg, 1); if (ret < 0) { - sndbg("I2C_TRANSFER failed: %d\n", ret); + snerr("I2C_TRANSFER failed: %d\n", ret); } } #endif @@ -204,12 +204,12 @@ uint16_t adxl345_getreg16(FAR struct adxl345_dev_s *priv, uint8_t regaddr) ret = I2C_TRANSFER(priv->i2c, msg, 2); if (ret < 0) { - sndbg("I2C_TRANSFER failed: %d\n", ret); + snerr("I2C_TRANSFER failed: %d\n", ret); return 0; } #ifdef CONFIG_ADXL345_REGDEBUG - dbg("%02x->%02x%02x\n", regaddr, rxbuffer[0], rxbuffer[1]); + err("%02x->%02x%02x\n", regaddr, rxbuffer[0], rxbuffer[1]); #endif return (uint16_t)rxbuffer[0] << 8 | (uint16_t)rxbuffer[1]; } diff --git a/drivers/sensors/adxl345_spi.c b/drivers/sensors/adxl345_spi.c index 1e837132af..38dd9179c2 100644 --- a/drivers/sensors/adxl345_spi.c +++ b/drivers/sensors/adxl345_spi.c @@ -113,7 +113,7 @@ uint8_t adxl345_getreg8(FAR struct adxl345_dev_s *priv, uint8_t regaddr) (void)SPI_LOCK(priv->spi, false); #ifdef CONFIG_ADXL345_REGDEBUG - dbg("%02x->%02x\n", regaddr, regval); + err("%02x->%02x\n", regaddr, regval); #endif return regval; } @@ -130,7 +130,7 @@ void adxl345_putreg8(FAR struct adxl345_dev_s *priv, uint8_t regaddr, uint8_t regval) { #ifdef CONFIG_ADXL345_REGDEBUG - dbg("%02x<-%02x\n", regaddr, regval); + err("%02x<-%02x\n", regaddr, regval); #endif /* If SPI bus is shared then lock and configure it */ @@ -191,7 +191,7 @@ uint16_t adxl345_getreg16(FAR struct adxl345_dev_s *priv, uint8_t regaddr) (void)SPI_LOCK(priv->spi, false); #ifdef CONFIG_ADXL345_REGDEBUG - dbg("%02x->%04x\n", regaddr, regval); + err("%02x->%04x\n", regaddr, regval); #endif return regval; diff --git a/drivers/sensors/as5048b.c b/drivers/sensors/as5048b.c index 96b3d4d19f..4e29a1f929 100644 --- a/drivers/sensors/as5048b.c +++ b/drivers/sensors/as5048b.c @@ -139,7 +139,7 @@ static int as5048b_readu8(FAR struct as5048b_dev_s *priv, uint8_t regaddr, ret = i2c_write(priv->i2c, &config, ®addr, sizeof(regaddr)); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } @@ -148,11 +148,11 @@ static int as5048b_readu8(FAR struct as5048b_dev_s *priv, uint8_t regaddr, ret = i2c_read(priv->i2c, &config, regval, sizeof(*regval)); if (ret < 0) { - sndbg("i2c_read failed: %d\n", ret); + snerr("i2c_read failed: %d\n", ret); return ret; } - sndbg("addr: %02x value: %02x ret: %d\n", regaddr, *regval, ret); + snerr("addr: %02x value: %02x ret: %d\n", regaddr, *regval, ret); return ret; } @@ -175,7 +175,7 @@ static int as5048b_readu16(FAR struct as5048b_dev_s *priv, uint8_t regaddrhi, ret = as5048b_readu8(priv, regaddrhi, &hi); if (ret < 0) { - sndbg("as5048b_readu8 failed: %d\n", ret); + snerr("as5048b_readu8 failed: %d\n", ret); return ret; } @@ -184,12 +184,12 @@ static int as5048b_readu16(FAR struct as5048b_dev_s *priv, uint8_t regaddrhi, ret = as5048b_readu8(priv, regaddrlo, &lo); if (ret < 0) { - sndbg("as5048b_readu8 failed: %d\n", ret); + snerr("as5048b_readu8 failed: %d\n", ret); return ret; } *regval = (uint16_t)hi << 6 | (uint16_t)lo; - sndbg("addrhi: %02x addrlo: %02x value: %04x ret: %d\n", + snerr("addrhi: %02x addrlo: %02x value: %04x ret: %d\n", regaddrhi, regaddrlo, *regval, ret); return ret; } @@ -209,7 +209,7 @@ static int as5048b_writeu8(FAR struct as5048b_dev_s *priv, uint8_t regaddr, uint8_t buffer[2]; int ret; - sndbg("addr: %02x value: %02x\n", regaddr, regval); + snerr("addr: %02x value: %02x\n", regaddr, regval); /* Set up the I2C configuration */ @@ -227,7 +227,7 @@ static int as5048b_writeu8(FAR struct as5048b_dev_s *priv, uint8_t regaddr, ret = i2c_write(priv->i2c, &config, buffer, sizeof(buffer)); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); } return ret; @@ -246,7 +246,7 @@ static int as5048b_writeu16(FAR struct as5048b_dev_s *priv, uint8_t regaddrhi, { int ret; - sndbg("addrhi: %02x addrlo: %02x value: %04x\n", + snerr("addrhi: %02x addrlo: %02x value: %04x\n", regaddrhi, regaddrlo, regval); /* Write the high 8 bits of the 13-bit value */ @@ -254,7 +254,7 @@ static int as5048b_writeu16(FAR struct as5048b_dev_s *priv, uint8_t regaddrhi, ret = as5048b_writeu8(priv, regaddrhi, (uint8_t)(regval >> 6)); if (ret < 0) { - sndbg("as5048b_writeu8 failed: %d\n", ret); + snerr("as5048b_writeu8 failed: %d\n", ret); return ret; } @@ -263,7 +263,7 @@ static int as5048b_writeu16(FAR struct as5048b_dev_s *priv, uint8_t regaddrhi, ret = as5048b_writeu8(priv, regaddrhi, (uint8_t)regval); if (ret < 0) { - sndbg("as5048b_writeu8 failed: %d\n", ret); + snerr("as5048b_writeu8 failed: %d\n", ret); } return ret; @@ -285,11 +285,11 @@ static int as5048b_readzero(FAR struct as5048b_dev_s *priv, ret = as5048b_readu16(priv, AS5048B_ZEROHI_REG, AS5048B_ZEROLO_REG, zero); if (ret < 0) { - sndbg("as5048b_readu16 failed: %d\n", ret); + snerr("as5048b_readu16 failed: %d\n", ret); return ret; } - sndbg("zero: %04x ret: %d\n", *zero, ret); + snerr("zero: %04x ret: %d\n", *zero, ret); return ret; } @@ -305,12 +305,12 @@ static int as5048b_writezero(FAR struct as5048b_dev_s *priv, uint16_t zero) { int ret; - sndbg("zero: %04x\n", zero); + snerr("zero: %04x\n", zero); ret = as5048b_writeu16(priv, AS5048B_ZEROHI_REG, AS5048B_ZEROLO_REG, zero); if (ret < 0) { - sndbg("as5048b_writeu16 failed: %d\n", ret); + snerr("as5048b_writeu16 failed: %d\n", ret); } return ret; @@ -331,11 +331,11 @@ static int as5048b_readagc(FAR struct as5048b_dev_s *priv, FAR uint8_t *agc) ret = as5048b_readu8(priv, AS5048B_AGC_REG, agc); if (ret < 0) { - sndbg("as5048b_readu8 failed: %d\n", ret); + snerr("as5048b_readu8 failed: %d\n", ret); return ret; } - sndbg("agc: %02x ret: %d\n", *agc, ret); + snerr("agc: %02x ret: %d\n", *agc, ret); return ret; } @@ -354,11 +354,11 @@ static int as5048b_readdiag(FAR struct as5048b_dev_s *priv, FAR uint8_t *diag) ret = as5048b_readu8(priv, AS5048B_DIAG_REG, diag); if (ret < 0) { - sndbg("as5048b_readu8 failed: %d\n", ret); + snerr("as5048b_readu8 failed: %d\n", ret); return ret; } - sndbg("diag: %02x ret: %d\n", *diag, ret); + snerr("diag: %02x ret: %d\n", *diag, ret); return ret; } @@ -377,11 +377,11 @@ static int as5048b_readmag(FAR struct as5048b_dev_s *priv, FAR uint16_t *mag) ret = as5048b_readu16(priv, AS5048B_MAGHI_REG, AS5048B_MAGLO_REG, mag); if (ret < 0) { - sndbg("as5048b_readu16 failed: %d\n", ret); + snerr("as5048b_readu16 failed: %d\n", ret); return ret; } - sndbg("mag: %04x ret: %d\n", *mag, ret); + snerr("mag: %04x ret: %d\n", *mag, ret); return ret; } @@ -400,11 +400,11 @@ static int as5048b_readang(FAR struct as5048b_dev_s *priv, FAR uint16_t *ang) ret = as5048b_readu16(priv, AS5048B_ANGHI_REG, AS5048B_ANGLO_REG, ang); if (ret < 0) { - sndbg("as5048b_readu16 failed: %d\n", ret); + snerr("as5048b_readu16 failed: %d\n", ret); return ret; } - sndbg("ang: %04x ret: %d\n", *ang, ret); + snerr("ang: %04x ret: %d\n", *ang, ret); return ret; } @@ -452,7 +452,7 @@ static int as5048b_position(FAR struct qe_lowerhalf_s *lower, ret = as5048b_readang(priv, &ang); if (ret < 0) { - sndbg("as5048b_readang failed: %d\n", ret); + snerr("as5048b_readang failed: %d\n", ret); return ret; } @@ -477,21 +477,21 @@ static int as5048b_reset(FAR struct qe_lowerhalf_s *lower) ret = as5048b_writezero(priv, 0); if (ret < 0) { - sndbg("as5048b_writezero failed: %d\n", ret); + snerr("as5048b_writezero failed: %d\n", ret); return ret; } ret = as5048b_readang(priv, &ang); if (ret < 0) { - sndbg("as5048b_readang failed: %d\n", ret); + snerr("as5048b_readang failed: %d\n", ret); return ret; } ret = as5048b_writezero(priv, ang); if (ret < 0) { - sndbg("as5048b_writezero failed: %d\n", ret); + snerr("as5048b_writezero failed: %d\n", ret); } return ret; @@ -521,7 +521,7 @@ static int as5048b_ioctl(FAR struct qe_lowerhalf_s *lower, int cmd, { *ptr = (int32_t)zero; } - sndbg("zero: %04x ret: %d\n", *ptr, ret); + snerr("zero: %04x ret: %d\n", *ptr, ret); } break; @@ -532,7 +532,7 @@ static int as5048b_ioctl(FAR struct qe_lowerhalf_s *lower, int cmd, FAR uint8_t *ptr = (FAR uint8_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); ret = as5048b_readagc(priv, ptr); - sndbg("agc: %02x ret: %d\n", *ptr, ret); + snerr("agc: %02x ret: %d\n", *ptr, ret); } break; @@ -543,7 +543,7 @@ static int as5048b_ioctl(FAR struct qe_lowerhalf_s *lower, int cmd, FAR uint8_t *ptr = (FAR uint8_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); ret = as5048b_readdiag(priv, ptr); - sndbg("diag: %02x ret: %d\n", *ptr, ret); + snerr("diag: %02x ret: %d\n", *ptr, ret); } break; @@ -559,12 +559,12 @@ static int as5048b_ioctl(FAR struct qe_lowerhalf_s *lower, int cmd, { *ptr = (int32_t)mag; } - sndbg("mag: %04x ret: %d\n", *ptr, ret); + snerr("mag: %04x ret: %d\n", *ptr, ret); } break; default: - sndbg("Unrecognized cmd: %d arg: %ld\n", cmd, arg); + snerr("Unrecognized cmd: %d arg: %ld\n", cmd, arg); ret = -ENOTTY; break; } @@ -604,7 +604,7 @@ FAR struct qe_lowerhalf_s *as5048b_initialize(FAR struct i2c_master_s *i2c, priv = (FAR struct as5048b_dev_s *)kmm_malloc(sizeof(*priv)); if (priv == NULL) { - sndbg("Failed to allocate instance\n"); + snerr("Failed to allocate instance\n"); return NULL; } diff --git a/drivers/sensors/bh1750fvi.c b/drivers/sensors/bh1750fvi.c index 9823e12997..aa22de6b53 100644 --- a/drivers/sensors/bh1750fvi.c +++ b/drivers/sensors/bh1750fvi.c @@ -144,7 +144,7 @@ static int bh1750fvi_read16(FAR struct bh1750fvi_dev_s *priv, ret = i2c_read(priv->i2c, &config, buffer, 2); if (ret < 0) { - sndbg ("i2c_read failed: %d\n", ret); + snerr ("i2c_read failed: %d\n", ret); return ret; } @@ -152,7 +152,7 @@ static int bh1750fvi_read16(FAR struct bh1750fvi_dev_s *priv, *regval = (uint16_t)((buffer[0]<<8) | (buffer[1])); - sndbg("value: %08x ret: %d\n", *regval, ret); + snerr("value: %08x ret: %d\n", *regval, ret); return OK; } @@ -169,7 +169,7 @@ static int bh1750fvi_write8(FAR struct bh1750fvi_dev_s *priv, uint8_t regval) struct i2c_config_s config; int ret; - sndbg("value: %02x\n", regval); + snerr("value: %02x\n", regval); /* Set up the I2C configuration */ @@ -182,7 +182,7 @@ static int bh1750fvi_write8(FAR struct bh1750fvi_dev_s *priv, uint8_t regval) ret = i2c_write(priv->i2c, &config, ®val, 1); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); } return ret; @@ -236,14 +236,14 @@ static ssize_t bh1750fvi_read(FAR struct file *filep, FAR char *buffer, if (buflen != 2) { - sndbg("You need to read 2 bytes from this sensor!\n"); + snerr("You need to read 2 bytes from this sensor!\n"); return -EINVAL; } ret = bh1750fvi_read16(priv, &lux); if (ret < 0) { - sndbg("Error reading light sensor!\n"); + snerr("Error reading light sensor!\n"); return ret; } @@ -283,7 +283,7 @@ static int bh1750fvi_ioctl(FAR struct file *filep, int cmd, ret = bh1750fvi_write8(priv, BH1750FVI_CONTINUOUS_HRM); if (ret < 0) { - sndbg("Cannot change to Continuously H-Resolution Mode!\n"); + snerr("Cannot change to Continuously H-Resolution Mode!\n"); } } break; @@ -295,7 +295,7 @@ static int bh1750fvi_ioctl(FAR struct file *filep, int cmd, ret = bh1750fvi_write8(priv, BH1750FVI_CONTINUOUS_HRM2); if (ret < 0) { - sndbg("Cannot change to Continuously H-Resolution Mode2!\n"); + snerr("Cannot change to Continuously H-Resolution Mode2!\n"); } } break; @@ -307,7 +307,7 @@ static int bh1750fvi_ioctl(FAR struct file *filep, int cmd, ret = bh1750fvi_write8(priv, BH1750FVI_CONTINUOUS_LRM); if (ret < 0) { - sndbg("Cannot change to Continuously L-Resolution Mode!\n"); + snerr("Cannot change to Continuously L-Resolution Mode!\n"); } } break; @@ -319,7 +319,7 @@ static int bh1750fvi_ioctl(FAR struct file *filep, int cmd, ret = bh1750fvi_write8(priv, BH1750FVI_ONETIME_HRM); if (ret < 0) { - sndbg("Cannot change to One Time H-Resolution Mode!\n"); + snerr("Cannot change to One Time H-Resolution Mode!\n"); } } break; @@ -331,7 +331,7 @@ static int bh1750fvi_ioctl(FAR struct file *filep, int cmd, ret = bh1750fvi_write8(priv, BH1750FVI_ONETIME_HRM2); if (ret < 0) { - sndbg("Cannot change to One Time H-Resolution Mode2!\n"); + snerr("Cannot change to One Time H-Resolution Mode2!\n"); } } break; @@ -343,7 +343,7 @@ static int bh1750fvi_ioctl(FAR struct file *filep, int cmd, ret = bh1750fvi_write8(priv, BH1750FVI_ONETIME_LRM); if (ret < 0) { - sndbg("Cannot change to One Time L-Resolution Mode!\n"); + snerr("Cannot change to One Time L-Resolution Mode!\n"); } } break; @@ -361,7 +361,7 @@ static int bh1750fvi_ioctl(FAR struct file *filep, int cmd, ret = bh1750fvi_write8(priv, reg); if (ret < 0) { - sndbg("Cannot Change Measure Time at MEASURE_TIMEH!\n"); + snerr("Cannot Change Measure Time at MEASURE_TIMEH!\n"); } reg = BH1750FVI_MEASURE_TIMEL | (*ptr & 0x1F); @@ -369,13 +369,13 @@ static int bh1750fvi_ioctl(FAR struct file *filep, int cmd, ret = bh1750fvi_write8(priv, reg); if (ret < 0) { - sndbg("Cannot Change Measure Time at MEASURE_TIMEL!\n"); + snerr("Cannot Change Measure Time at MEASURE_TIMEL!\n"); } } break; default: - sndbg("Unrecognized cmd: %d\n", cmd); + snerr("Unrecognized cmd: %d\n", cmd); ret = -ENOTTY; break; } @@ -419,7 +419,7 @@ int bh1750fvi_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, if (priv == NULL) { - sndbg("Failed to allocate instance\n"); + snerr("Failed to allocate instance\n"); return -ENOMEM; } @@ -431,7 +431,7 @@ int bh1750fvi_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, ret = bh1750fvi_write8(priv, BH1750FVI_POWERON); if (ret < 0) { - sndbg("Failed to power-on the BH1750FVI!\n"); + snerr("Failed to power-on the BH1750FVI!\n"); return ret; } @@ -440,7 +440,7 @@ int bh1750fvi_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, ret = bh1750fvi_write8(priv, BH1750FVI_CONTINUOUS_HRM); if (ret < 0) { - sndbg("Failed to enable the Continuosly H-Resolution Mode!\n"); + snerr("Failed to enable the Continuosly H-Resolution Mode!\n"); return ret; } @@ -449,7 +449,7 @@ int bh1750fvi_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, ret = register_driver(devpath, &g_bh1750fvi_fops, 0666, priv); if (ret < 0) { - sndbg("Failed to register driver: %d\n", ret); + snerr("Failed to register driver: %d\n", ret); kmm_free(priv); } diff --git a/drivers/sensors/bmp180.c b/drivers/sensors/bmp180.c index 113ad049cc..b0df89d2c8 100644 --- a/drivers/sensors/bmp180.c +++ b/drivers/sensors/bmp180.c @@ -198,7 +198,7 @@ static uint8_t bmp180_getreg8(FAR struct bmp180_dev_s *priv, uint8_t regaddr) ret = i2c_write(priv->i2c, &config, ®addr, 1); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } @@ -207,7 +207,7 @@ static uint8_t bmp180_getreg8(FAR struct bmp180_dev_s *priv, uint8_t regaddr) ret = i2c_read(priv->i2c, &config, ®val, 1); if (ret < 0) { - sndbg("i2c_read failed: %d\n", ret); + snerr("i2c_read failed: %d\n", ret); return ret; } @@ -240,7 +240,7 @@ static uint16_t bmp180_getreg16(FAR struct bmp180_dev_s *priv, uint8_t regaddr) ret = i2c_write(priv->i2c, &config, ®addr, 1); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } @@ -249,7 +249,7 @@ static uint16_t bmp180_getreg16(FAR struct bmp180_dev_s *priv, uint8_t regaddr) ret = i2c_read(priv->i2c, &config, (uint8_t *)®val, 2); if (ret < 0) { - sndbg("i2c_read failed: %d\n", ret); + snerr("i2c_read failed: %d\n", ret); return ret; } @@ -292,7 +292,7 @@ static void bmp180_putreg8(FAR struct bmp180_dev_s *priv, uint8_t regaddr, ret = i2c_write(priv->i2c, &config, (uint8_t *) &data, 2); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return; } @@ -320,7 +320,7 @@ static int bmp180_checkid(FAR struct bmp180_dev_s *priv) { /* ID is not Correct */ - sndbg("Wrong Device ID!\n"); + snerr("Wrong Device ID!\n"); return -ENODEV; } @@ -543,13 +543,13 @@ static ssize_t bmp180_read(FAR struct file *filep, FAR char *buffer, if (!buffer) { - sndbg("Buffer is null\n"); + snerr("Buffer is null\n"); return -1; } if (buflen != 4) { - sndbg("You can't read something other than 32 bits (4 bytes)\n"); + snerr("You can't read something other than 32 bits (4 bytes)\n"); return -1; } @@ -602,7 +602,7 @@ int bmp180_register(FAR const char *devpath, FAR struct i2c_master_s *i2c) priv = (FAR struct bmp180_dev_s *)kmm_malloc(sizeof(struct bmp180_dev_s)); if (!priv) { - sndbg("Failed to allocate instance\n"); + snerr("Failed to allocate instance\n"); return -ENOMEM; } @@ -615,7 +615,7 @@ int bmp180_register(FAR const char *devpath, FAR struct i2c_master_s *i2c) ret = bmp180_checkid(priv); if (ret < 0) { - sndbg("Failed to register driver: %d\n", ret); + snerr("Failed to register driver: %d\n", ret); kmm_free(priv); return ret; } @@ -629,7 +629,7 @@ int bmp180_register(FAR const char *devpath, FAR struct i2c_master_s *i2c) ret = register_driver(devpath, &g_bmp180fops, 0666, priv); if (ret < 0) { - sndbg("Failed to register driver: %d\n", ret); + snerr("Failed to register driver: %d\n", ret); kmm_free(priv); } diff --git a/drivers/sensors/lm75.c b/drivers/sensors/lm75.c index f3fad73972..e8f84e2933 100644 --- a/drivers/sensors/lm75.c +++ b/drivers/sensors/lm75.c @@ -195,7 +195,7 @@ static int lm75_readb16(FAR struct lm75_dev_s *priv, uint8_t regaddr, ret = lm75_i2c_write(priv, ®addr, 1); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } @@ -204,7 +204,7 @@ static int lm75_readb16(FAR struct lm75_dev_s *priv, uint8_t regaddr, ret = lm75_i2c_read(priv, buffer, 2); if (ret < 0) { - sndbg("i2c_read failed: %d\n", ret); + snerr("i2c_read failed: %d\n", ret); return ret; } @@ -214,7 +214,7 @@ static int lm75_readb16(FAR struct lm75_dev_s *priv, uint8_t regaddr, */ *regvalue = b8tob16((b8_t)buffer[0] << 8 | (b8_t)buffer[1]); - sndbg("addr: %02x value: %08x ret: %d\n", regaddr, *regvalue, ret); + snerr("addr: %02x value: %08x ret: %d\n", regaddr, *regvalue, ret); return OK; } @@ -232,7 +232,7 @@ static int lm75_writeb16(FAR struct lm75_dev_s *priv, uint8_t regaddr, uint8_t buffer[3]; b8_t regb8; - sndbg("addr: %02x value: %08x\n", regaddr, regval); + snerr("addr: %02x value: %08x\n", regaddr, regval); /* Set up a 3 byte message to send */ @@ -265,11 +265,11 @@ static int lm75_readtemp(FAR struct lm75_dev_s *priv, FAR b16_t *temp) ret = lm75_readb16(priv, LM75_TEMP_REG, &temp16); if (ret < 0) { - sndbg("lm75_readb16 failed: %d\n", ret); + snerr("lm75_readb16 failed: %d\n", ret); return ret; } - sndbg("Centigrade: %08x\n", temp16); + snerr("Centigrade: %08x\n", temp16); /* Was fahrenheit requested? */ @@ -278,7 +278,7 @@ static int lm75_readtemp(FAR struct lm75_dev_s *priv, FAR b16_t *temp) /* Centigrade to Fahrenheit conversion: F = 9*C/5 + 32 */ temp16 = b16mulb16(temp16, B16_9DIV5) + B16_32; - sndbg("Fahrenheit: %08x\n", temp16); + snerr("Fahrenheit: %08x\n", temp16); } *temp = temp16; @@ -305,14 +305,14 @@ static int lm75_readconf(FAR struct lm75_dev_s *priv, FAR uint8_t *conf) ret = lm75_i2c_write(priv, &buffer, 1); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } /* Restart and read 8-bits from the register */ ret = lm75_i2c_read(priv, conf, 1); - sndbg("conf: %02x ret: %d\n", *conf, ret); + snerr("conf: %02x ret: %d\n", *conf, ret); return ret; } @@ -328,7 +328,7 @@ static int lm75_writeconf(FAR struct lm75_dev_s *priv, uint8_t conf) { uint8_t buffer[2]; - sndbg("conf: %02x\n", conf); + snerr("conf: %02x\n", conf); /* Set up a 2 byte message to send */ @@ -384,7 +384,7 @@ static ssize_t lm75_read(FAR struct file *filep, FAR char *buffer, size_t buflen nsamples = buflen / sizeof(b16_t); ptr = (FAR b16_t *)buffer; - sndbg("buflen: %d nsamples: %d\n", buflen, nsamples); + snerr("buflen: %d nsamples: %d\n", buflen, nsamples); /* Get the requested number of samples */ @@ -397,7 +397,7 @@ static ssize_t lm75_read(FAR struct file *filep, FAR char *buffer, size_t buflen ret = lm75_readtemp(priv, &temp); if (ret < 0) { - sndbg("lm75_readtemp failed: %d\n", ret); + snerr("lm75_readtemp failed: %d\n", ret); return (ssize_t)ret; } @@ -438,7 +438,7 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR uint8_t *ptr = (FAR uint8_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); ret = lm75_readconf(priv, ptr); - sndbg("conf: %02x ret: %d\n", *ptr, ret); + snerr("conf: %02x ret: %d\n", *ptr, ret); } break; @@ -446,7 +446,7 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_WRITECONF: ret = lm75_writeconf(priv, (uint8_t)arg); - sndbg("conf: %02x ret: %d\n", *(FAR uint8_t *)arg, ret); + snerr("conf: %02x ret: %d\n", *(FAR uint8_t *)arg, ret); break; /* Shutdown the LM75, Arg: None */ @@ -460,7 +460,7 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = lm75_writeconf(priv, conf | LM75_CONF_SHUTDOWN); } - sndbg("conf: %02x ret: %d\n", conf | LM75_CONF_SHUTDOWN, ret); + snerr("conf: %02x ret: %d\n", conf | LM75_CONF_SHUTDOWN, ret); } break; @@ -475,7 +475,7 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = lm75_writeconf(priv, conf & ~LM75_CONF_SHUTDOWN); } - sndbg("conf: %02x ret: %d\n", conf & ~LM75_CONF_SHUTDOWN, ret); + snerr("conf: %02x ret: %d\n", conf & ~LM75_CONF_SHUTDOWN, ret); } break; @@ -483,14 +483,14 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_FAHRENHEIT: priv->fahrenheit = true; - sndbg("Fahrenheit\n"); + snerr("Fahrenheit\n"); break; /* Report Samples in Centigrade */ case SNIOC_CENTIGRADE: priv->fahrenheit = false; - sndbg("Centigrade\n"); + snerr("Centigrade\n"); break; /* Read THYS temperature register. Arg: b16_t* pointer */ @@ -500,7 +500,7 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR b16_t *ptr = (FAR b16_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); ret = lm75_readb16(priv, LM75_THYS_REG, ptr); - sndbg("THYS: %08x ret: %d\n", *ptr, ret); + snerr("THYS: %08x ret: %d\n", *ptr, ret); } break; @@ -508,7 +508,7 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_WRITETHYS: ret = lm75_writeb16(priv, LM75_THYS_REG, (b16_t)arg); - sndbg("THYS: %08x ret: %d\n", (b16_t)arg, ret); + snerr("THYS: %08x ret: %d\n", (b16_t)arg, ret); break; /* Read TOS (Over-temp Shutdown Threshold) Register. Arg: b16_t* pointer */ @@ -518,7 +518,7 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR b16_t *ptr = (FAR b16_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); ret = lm75_readb16(priv, LM75_TOS_REG, ptr); - sndbg("TOS: %08x ret: %d\n", *ptr, ret); + snerr("TOS: %08x ret: %d\n", *ptr, ret); } break; @@ -526,11 +526,11 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_WRITETOS: ret = lm75_writeb16(priv, LM75_TOS_REG, (b16_t)arg); - sndbg("TOS: %08x ret: %d\n", (b16_t)arg, ret); + snerr("TOS: %08x ret: %d\n", (b16_t)arg, ret); break; default: - sndbg("Unrecognized cmd: %d\n", cmd); + snerr("Unrecognized cmd: %d\n", cmd); ret = -ENOTTY; break; } @@ -578,7 +578,7 @@ int lm75_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t priv = (FAR struct lm75_dev_s *)kmm_malloc(sizeof(struct lm75_dev_s)); if (priv == NULL) { - sndbg("Failed to allocate instance\n"); + snerr("Failed to allocate instance\n"); return -ENOMEM; } @@ -591,7 +591,7 @@ int lm75_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t ret = register_driver(devpath, &g_lm75fops, 0666, priv); if (ret < 0) { - sndbg("Failed to register driver: %d\n", ret); + snerr("Failed to register driver: %d\n", ret); kmm_free(priv); } diff --git a/drivers/sensors/lm92.c b/drivers/sensors/lm92.c index 73f4d54634..b1d96f2040 100644 --- a/drivers/sensors/lm92.c +++ b/drivers/sensors/lm92.c @@ -198,7 +198,7 @@ static int lm92_readb16(FAR struct lm92_dev_s *priv, uint8_t regaddr, ret = lm92_i2c_write(priv, ®addr, 1); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } @@ -207,7 +207,7 @@ static int lm92_readb16(FAR struct lm92_dev_s *priv, uint8_t regaddr, ret = lm92_i2c_read(priv, buffer, 2); if (ret < 0) { - sndbg("i2c_read failed: %d\n", ret); + snerr("i2c_read failed: %d\n", ret); return ret; } @@ -218,7 +218,7 @@ static int lm92_readb16(FAR struct lm92_dev_s *priv, uint8_t regaddr, *regvalue = (b16_t)((uint32_t)(buffer[0] & (1 << 7)) << 24 | (uint32_t)(buffer[0] & ~(1 << 7)) << 17 | (uint32_t)(buffer[1] & ~7) << 9); - sndbg("addr: %02x value: %08x ret: %d\n", regaddr, *regvalue, ret); + snerr("addr: %02x value: %08x ret: %d\n", regaddr, *regvalue, ret); return OK; } @@ -236,7 +236,7 @@ static int lm92_writeb16(FAR struct lm92_dev_s *priv, uint8_t regaddr, { uint8_t buffer[3]; - sndbg("addr: %02x value: %08x\n", regaddr, regval); + snerr("addr: %02x value: %08x\n", regaddr, regval); /* Set up a 3-byte message to send */ @@ -268,11 +268,11 @@ static int lm92_readtemp(FAR struct lm92_dev_s *priv, FAR b16_t *temp) ret = lm92_readb16(priv, LM92_TEMP_REG, &temp16); if (ret < 0) { - sndbg("lm92_readb16 failed: %d\n", ret); + snerr("lm92_readb16 failed: %d\n", ret); return ret; } - sndbg("Centigrade: %08x\n", temp16); + snerr("Centigrade: %08x\n", temp16); /* Was Fahrenheit requested? */ @@ -281,7 +281,7 @@ static int lm92_readtemp(FAR struct lm92_dev_s *priv, FAR b16_t *temp) /* Centigrade to Fahrenheit conversion: F = 9*C/5 + 32 */ temp16 = b16mulb16(temp16, B16_9DIV5) + B16_32; - sndbg("Fahrenheit: %08x\n", temp16); + snerr("Fahrenheit: %08x\n", temp16); } *temp = temp16; @@ -308,14 +308,14 @@ static int lm92_readconf(FAR struct lm92_dev_s *priv, FAR uint8_t *conf) ret = lm92_i2c_write(priv, &buffer, 1); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } /* Restart and read 8 bits from the register */ ret = lm92_i2c_read(priv, conf, 1); - sndbg("conf: %02x ret: %d\n", *conf, ret); + snerr("conf: %02x ret: %d\n", *conf, ret); return ret; } @@ -331,7 +331,7 @@ static int lm92_writeconf(FAR struct lm92_dev_s *priv, uint8_t conf) { uint8_t buffer[2]; - sndbg("conf: %02x\n", conf); + snerr("conf: %02x\n", conf); /* Set up a 2-byte message to send */ @@ -364,7 +364,7 @@ static int lm92_readid(FAR struct lm92_dev_s *priv, FAR uint16_t *id) ret = lm92_i2c_write(priv, ®addr, 1); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } @@ -373,12 +373,12 @@ static int lm92_readid(FAR struct lm92_dev_s *priv, FAR uint16_t *id) ret = lm92_i2c_read(priv, buffer, 2); if (ret < 0) { - sndbg("i2c_read failed: %d\n", ret); + snerr("i2c_read failed: %d\n", ret); return ret; } *id = (uint16_t)buffer[0] << 8 | (uint16_t)buffer[1]; - sndbg("id: %04x ret: %d\n", *id, ret); + snerr("id: %04x ret: %d\n", *id, ret); return OK; } @@ -427,7 +427,7 @@ static ssize_t lm92_read(FAR struct file *filep, FAR char *buffer, nsamples = buflen / sizeof(b16_t); ptr = (FAR b16_t *)buffer; - sndbg("buflen: %d nsamples: %d\n", buflen, nsamples); + snerr("buflen: %d nsamples: %d\n", buflen, nsamples); /* Get the requested number of samples */ @@ -440,7 +440,7 @@ static ssize_t lm92_read(FAR struct file *filep, FAR char *buffer, ret = lm92_readtemp(priv, &temp); if (ret < 0) { - sndbg("lm92_readtemp failed: %d\n", ret); + snerr("lm92_readtemp failed: %d\n", ret); return (ssize_t)ret; } @@ -481,7 +481,7 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR uint8_t *ptr = (FAR uint8_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); ret = lm92_readconf(priv, ptr); - sndbg("conf: %02x ret: %d\n", *ptr, ret); + snerr("conf: %02x ret: %d\n", *ptr, ret); } break; @@ -489,7 +489,7 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_WRITECONF: ret = lm92_writeconf(priv, (uint8_t)arg); - sndbg("conf: %02x ret: %d\n", *(uint8_t *)arg, ret); + snerr("conf: %02x ret: %d\n", *(uint8_t *)arg, ret); break; /* Shutdown the LM92. Arg: None */ @@ -503,7 +503,7 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = lm92_writeconf(priv, conf | LM92_CONF_SHUTDOWN); } - sndbg("conf: %02x ret: %d\n", conf | LM92_CONF_SHUTDOWN, ret); + snerr("conf: %02x ret: %d\n", conf | LM92_CONF_SHUTDOWN, ret); } break; @@ -518,7 +518,7 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = lm92_writeconf(priv, conf & ~LM92_CONF_SHUTDOWN); } - sndbg("conf: %02x ret: %d\n", conf & ~LM92_CONF_SHUTDOWN, ret); + snerr("conf: %02x ret: %d\n", conf & ~LM92_CONF_SHUTDOWN, ret); } break; @@ -526,14 +526,14 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_FAHRENHEIT: priv->fahrenheit = true; - sndbg("Fahrenheit\n"); + snerr("Fahrenheit\n"); break; /* Report samples in Centigrade. Arg: None */ case SNIOC_CENTIGRADE: priv->fahrenheit = false; - sndbg("Centigrade\n"); + snerr("Centigrade\n"); break; /* Read THYS temperature register. Arg: b16_t* pointer */ @@ -543,7 +543,7 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR b16_t *ptr = (FAR b16_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); ret = lm92_readb16(priv, LM92_THYS_REG, ptr); - sndbg("THYS: %08x ret: %d\n", *ptr, ret); + snerr("THYS: %08x ret: %d\n", *ptr, ret); } break; @@ -551,7 +551,7 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_WRITETHYS: ret = lm92_writeb16(priv, LM92_THYS_REG, (b16_t)arg); - sndbg("THYS: %08x ret: %d\n", (b16_t)arg, ret); + snerr("THYS: %08x ret: %d\n", (b16_t)arg, ret); break; /* Read TCRIT temperature register. Arg: b16_t* pointer */ @@ -561,7 +561,7 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR b16_t *ptr = (FAR b16_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); ret = lm92_readb16(priv, LM92_TCRIT_REG, ptr); - sndbg("TCRIT: %08x ret: %d\n", *ptr, ret); + snerr("TCRIT: %08x ret: %d\n", *ptr, ret); } break; @@ -569,7 +569,7 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_WRITETCRIT: ret = lm92_writeb16(priv, LM92_TCRIT_REG, (b16_t)arg); - sndbg("TCRIT: %08x ret: %d\n", (b16_t)arg, ret); + snerr("TCRIT: %08x ret: %d\n", (b16_t)arg, ret); break; /* Read TLOW temperature register. Arg: b16_t* pointer */ @@ -579,7 +579,7 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR b16_t *ptr = (FAR b16_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); ret = lm92_readb16(priv, LM92_TLOW_REG, ptr); - sndbg("TLOW: %08x ret: %d\n", *ptr, ret); + snerr("TLOW: %08x ret: %d\n", *ptr, ret); } break; @@ -587,7 +587,7 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_WRITETLOW: ret = lm92_writeb16(priv, LM92_TLOW_REG, (b16_t)arg); - sndbg("TLOW: %08x ret: %d\n", (b16_t)arg, ret); + snerr("TLOW: %08x ret: %d\n", (b16_t)arg, ret); break; /* Read THIGH temperature register. Arg: b16_t* pointer */ @@ -597,7 +597,7 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR b16_t *ptr = (FAR b16_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); ret = lm92_readb16(priv, LM92_THIGH_REG, ptr); - sndbg("THIGH: %08x ret: %d\n", *ptr, ret); + snerr("THIGH: %08x ret: %d\n", *ptr, ret); } break; @@ -605,7 +605,7 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_WRITETHIGH: ret = lm92_writeb16(priv, LM92_THIGH_REG, (b16_t)arg); - sndbg("THIGH: %08x ret: %d\n", (b16_t)arg, ret); + snerr("THIGH: %08x ret: %d\n", (b16_t)arg, ret); break; /* Read from the identification register. Arg: uint16_t* pointer */ @@ -615,12 +615,12 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR uint16_t *ptr = (FAR uint16_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); ret = lm92_readid(priv, ptr); - sndbg("id: %04x ret: %d\n", *ptr, ret); + snerr("id: %04x ret: %d\n", *ptr, ret); } break; default: - sndbg("Unrecognized cmd: %d\n", cmd); + snerr("Unrecognized cmd: %d\n", cmd); ret = -ENOTTY; break; } @@ -668,7 +668,7 @@ int lm92_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, priv = (FAR struct lm92_dev_s *)kmm_malloc(sizeof(struct lm92_dev_s)); if (priv == NULL) { - sndbg("Failed to allocate instance\n"); + snerr("Failed to allocate instance\n"); return -ENOMEM; } @@ -681,7 +681,7 @@ int lm92_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, ret = register_driver(devpath, &g_lm92fops, 0666, priv); if (ret < 0) { - sndbg("Failed to register driver: %d\n", ret); + snerr("Failed to register driver: %d\n", ret); kmm_free(priv); } diff --git a/drivers/sensors/lsm9ds1.c b/drivers/sensors/lsm9ds1.c index e6ea884414..be5d79b88c 100644 --- a/drivers/sensors/lsm9ds1.c +++ b/drivers/sensors/lsm9ds1.c @@ -660,7 +660,7 @@ static int lsm9ds1_readreg8(FAR struct lsm9ds1_dev_s *priv, uint8_t regaddr, ret = i2c_write(priv->i2c, &config, ®addr, sizeof(regaddr)); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } @@ -669,7 +669,7 @@ static int lsm9ds1_readreg8(FAR struct lsm9ds1_dev_s *priv, uint8_t regaddr, ret = i2c_read(priv->i2c, &config, regval, sizeof(*regval)); if (ret < 0) { - sndbg("i2c_read failed: %d\n", ret); + snerr("i2c_read failed: %d\n", ret); return ret; } @@ -712,7 +712,7 @@ static int lsm9ds1_writereg8(FAR struct lsm9ds1_dev_s *priv, uint8_t regaddr, ret = i2c_write(priv->i2c, &config, buffer, sizeof(buffer)); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } @@ -741,7 +741,7 @@ static int lsm9ds1_modifyreg8(FAR struct lsm9ds1_dev_s *priv, uint8_t regaddr, ret = lsm9ds1_readreg8(priv, regaddr, ®val); if (ret < 0) { - sndbg("lsm9ds1_readreg8 failed: %d\n", ret); + snerr("lsm9ds1_readreg8 failed: %d\n", ret); return ret; } @@ -751,7 +751,7 @@ static int lsm9ds1_modifyreg8(FAR struct lsm9ds1_dev_s *priv, uint8_t regaddr, ret = lsm9ds1_writereg8(priv, regaddr, regval); if (ret < 0) { - sndbg("lsm9ds1_writereg8 failed: %d\n", ret); + snerr("lsm9ds1_writereg8 failed: %d\n", ret); return ret; } @@ -793,13 +793,13 @@ static int lsm9ds1accelgyro_config(FAR struct lsm9ds1_dev_s *priv) ret = lsm9ds1_readreg8(priv, LSM9DS1_WHO_AM_I, ®val); if (ret < 0) { - sndbg("lsm9ds1_readreg8 failed: %d\n", ret); + snerr("lsm9ds1_readreg8 failed: %d\n", ret); return ret; } if (regval != LSM9DS1_WHO_AM_I_VALUE) { - sndbg("Invalid device identification %02x\n", regval); + snerr("Invalid device identification %02x\n", regval); return -ENODEV; } @@ -1047,13 +1047,13 @@ static int lsm9ds1mag_config(FAR struct lsm9ds1_dev_s *priv) ret = lsm9ds1_readreg8(priv, LSM9DS1_WHO_AM_I_M, ®val); if (ret < 0) { - sndbg("lsm9ds1_readreg8 failed: %d\n", ret); + snerr("lsm9ds1_readreg8 failed: %d\n", ret); return ret; } if (regval != LSM9DS1_WHO_AM_I_M_VALUE) { - sndbg("Invalid device identification %02x\n", regval); + snerr("Invalid device identification %02x\n", regval); return -ENODEV; } @@ -1280,7 +1280,7 @@ static ssize_t lsm9ds1_read(FAR struct file *filep, FAR char *buffer, ret = lsm9ds1_readreg8(priv, regaddr, &lo); if (ret < 0) { - sndbg("lsm9ds1_readreg8 failed: %d\n", ret); + snerr("lsm9ds1_readreg8 failed: %d\n", ret); return (ssize_t)ret; } @@ -1291,7 +1291,7 @@ static ssize_t lsm9ds1_read(FAR struct file *filep, FAR char *buffer, ret = lsm9ds1_readreg8(priv, regaddr, &hi); if (ret < 0) { - sndbg("lsm9ds1_readreg8 failed: %d\n", ret); + snerr("lsm9ds1_readreg8 failed: %d\n", ret); return (ssize_t)ret; } @@ -1390,20 +1390,20 @@ static int lsm9ds1_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_SETSAMPLERATE: ret = priv->ops->setsamplerate(priv, (uint32_t)arg); - sndbg("sample rate: %08x ret: %d\n", (uint32_t)arg, ret); + snerr("sample rate: %08x ret: %d\n", (uint32_t)arg, ret); break; /* Set the full-scale range. Arg: uint32_t value. */ case SNIOC_SETFULLSCALE: ret = priv->ops->setfullscale(priv, (uint32_t)arg); - sndbg("full-scale range: %08x ret: %d\n", (uint32_t)arg, ret); + snerr("full-scale range: %08x ret: %d\n", (uint32_t)arg, ret); break; /* Unrecognized commands */ default: - sndbg("Unrecognized cmd: %d arg: %lu\n", cmd, arg); + snerr("Unrecognized cmd: %d arg: %lu\n", cmd, arg); ret = -ENOTTY; break; } @@ -1453,7 +1453,7 @@ static int lsm9ds1_register(FAR const char *devpath, priv = (FAR struct lsm9ds1_dev_s *)kmm_malloc(sizeof(*priv)); if (priv == NULL) { - sndbg("Failed to allocate instance\n"); + snerr("Failed to allocate instance\n"); return -ENOMEM; } @@ -1468,7 +1468,7 @@ static int lsm9ds1_register(FAR const char *devpath, ret = priv->ops->config(priv); if (ret < 0) { - sndbg("Failed to configure device: %d\n", ret); + snerr("Failed to configure device: %d\n", ret); kmm_free(priv); return ret; } @@ -1478,7 +1478,7 @@ static int lsm9ds1_register(FAR const char *devpath, ret = register_driver(devpath, &g_fops, 0666, priv); if (ret < 0) { - sndbg("Failed to register driver: %d\n", ret); + snerr("Failed to register driver: %d\n", ret); kmm_free(priv); return ret; } diff --git a/drivers/sensors/max31855.c b/drivers/sensors/max31855.c index d3e5b8e8f6..73e45c191c 100644 --- a/drivers/sensors/max31855.c +++ b/drivers/sensors/max31855.c @@ -189,13 +189,13 @@ static ssize_t max31855_read(FAR struct file *filep, FAR char *buffer, size_t bu if (!buffer) { - sndbg("Buffer is null\n"); + snerr("Buffer is null\n"); return -EINVAL; } if (buflen != 2) { - sndbg("You can't read something other than 16 bits (2 bytes)\n"); + snerr("You can't read something other than 16 bits (2 bytes)\n"); return -EINVAL; } @@ -218,7 +218,7 @@ static ssize_t max31855_read(FAR struct file *filep, FAR char *buffer, size_t bu regval |= (regmsb & 0xFF00) << 8; regval |= (regmsb & 0xFF) << 24; - sndbg("Read from MAX31855 = 0x%08X\n", regval); + snerr("Read from MAX31855 = 0x%08X\n", regval); /* If negative, fix signal bits */ @@ -235,21 +235,21 @@ static ssize_t max31855_read(FAR struct file *filep, FAR char *buffer, size_t bu if (regval & MAX31855_FAULT) { - sndbg("Error: A fault was detected by MAX31855:\n"); + snerr("Error: A fault was detected by MAX31855:\n"); if (regval & MAX31855_SHORT_VCC) { - sndbg("The thermocouple input is shorted to VCC!\n"); + snerr("The thermocouple input is shorted to VCC!\n"); } if (regval & MAX31855_SHORT_GND) { - sndbg("The thermocouple input is shorted to GND!\n"); + snerr("The thermocouple input is shorted to GND!\n"); } if (regval & MAX31855_OPEN_CIRCUIT) { - sndbg("The thermocouple input is not connected!\n"); + snerr("The thermocouple input is not connected!\n"); } ret = -EINVAL; @@ -308,7 +308,7 @@ int max31855_register(FAR const char *devpath, FAR struct spi_dev_s *spi) priv = (FAR struct max31855_dev_s *)kmm_malloc(sizeof(struct max31855_dev_s)); if (priv == NULL) { - sndbg("Failed to allocate instance\n"); + snerr("Failed to allocate instance\n"); return -ENOMEM; } @@ -320,7 +320,7 @@ int max31855_register(FAR const char *devpath, FAR struct spi_dev_s *spi) ret = register_driver(devpath, &g_max31855fops, 0666, priv); if (ret < 0) { - sndbg("Failed to register driver: %d\n", ret); + snerr("Failed to register driver: %d\n", ret); kmm_free(priv); } diff --git a/drivers/sensors/max6675.c b/drivers/sensors/max6675.c index 329f5185c5..55c2ad47dd 100644 --- a/drivers/sensors/max6675.c +++ b/drivers/sensors/max6675.c @@ -185,13 +185,13 @@ static ssize_t max6675_read(FAR struct file *filep, FAR char *buffer, size_t buf if (!buffer) { - sndbg("Buffer is null\n"); + snerr("Buffer is null\n"); return -EINVAL; } if (buflen != 2) { - sndbg("You can't read something other than 16 bits (2 bytes)\n"); + snerr("You can't read something other than 16 bits (2 bytes)\n"); return -EINVAL; } @@ -212,13 +212,13 @@ static ssize_t max6675_read(FAR struct file *filep, FAR char *buffer, size_t buf regval = (regmsb & 0xFF00) >> 8; regval |= (regmsb & 0xFF) << 8; - sndbg("Read from MAX6675 = 0x%04X\n", regval); + snerr("Read from MAX6675 = 0x%04X\n", regval); /* Verify if the device ID bit is really zero */ if (regval & MAX6675_DEV_ID) { - sndbg("ERROR: The Device ID bit needs to be 0 !\n"); + snerr("ERROR: The Device ID bit needs to be 0 !\n"); ret = -EINVAL; } @@ -226,7 +226,7 @@ static ssize_t max6675_read(FAR struct file *filep, FAR char *buffer, size_t buf if (regval & MAX6675_OPEN_CIRCUIT) { - sndbg("The thermocouple input is not connected!\n"); + snerr("The thermocouple input is not connected!\n"); ret = -EINVAL; } @@ -285,7 +285,7 @@ int max6675_register(FAR const char *devpath, FAR struct spi_dev_s *spi) priv = (FAR struct max6675_dev_s *)kmm_malloc(sizeof(struct max6675_dev_s)); if (priv == NULL) { - sndbg("Failed to allocate instance\n"); + snerr("Failed to allocate instance\n"); return -ENOMEM; } @@ -297,7 +297,7 @@ int max6675_register(FAR const char *devpath, FAR struct spi_dev_s *spi) ret = register_driver(devpath, &g_max6675fops, 0666, priv); if (ret < 0) { - sndbg("Failed to register driver: %d\n", ret); + snerr("Failed to register driver: %d\n", ret); kmm_free(priv); } diff --git a/drivers/sensors/mb7040.c b/drivers/sensors/mb7040.c index 4308b2f73e..57250c4c77 100644 --- a/drivers/sensors/mb7040.c +++ b/drivers/sensors/mb7040.c @@ -131,7 +131,7 @@ static int mb7040_measurerange(FAR struct mb7040_dev_s *priv) uint8_t regaddr; int ret; - sndbg("addr: %02x\n", regaddr); + snerr("addr: %02x\n", regaddr); /* Set up the I2C configuration */ @@ -146,7 +146,7 @@ static int mb7040_measurerange(FAR struct mb7040_dev_s *priv) ret = i2c_write(priv->i2c, &config, ®addr, sizeof(regaddr)); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); } return ret; @@ -178,12 +178,12 @@ static int mb7040_readrange(FAR struct mb7040_dev_s *priv, ret = i2c_read(priv->i2c, &config, buffer, sizeof(buffer)); if (ret < 0) { - sndbg("i2c_read failed: %d\n", ret); + snerr("i2c_read failed: %d\n", ret); return ret; } *range = (uint16_t)buffer[0] << 8 | (uint16_t)buffer[1]; - sndbg("range: %04x ret: %d\n", *range, ret); + snerr("range: %04x ret: %d\n", *range, ret); return ret; } @@ -201,7 +201,7 @@ static int mb7040_changeaddr(FAR struct mb7040_dev_s *priv, uint8_t addr) uint8_t buffer[3]; int ret; - sndbg("new addr: %02x\n", addr); + snerr("new addr: %02x\n", addr); /* Sanity check */ @@ -225,7 +225,7 @@ static int mb7040_changeaddr(FAR struct mb7040_dev_s *priv, uint8_t addr) ret = i2c_write(priv->i2c, &config, buffer, sizeof(buffer)); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } @@ -324,7 +324,7 @@ static int mb7040_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { *ptr = (int32_t)range; } - sndbg("range: %04x ret: %d\n", *ptr, ret); + snerr("range: %04x ret: %d\n", *ptr, ret); } break; @@ -332,13 +332,13 @@ static int mb7040_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_CHANGEADDR: ret = mb7040_changeaddr(priv, (uint8_t)arg); - sndbg("new addr: %02x ret: %d\n", *(uint8_t *)arg, ret); + snerr("new addr: %02x ret: %d\n", *(uint8_t *)arg, ret); break; /* Unrecognized commands */ default: - sndbg("Unrecognized cmd: %d arg: %ld\n", cmd, arg); + snerr("Unrecognized cmd: %d arg: %ld\n", cmd, arg); ret = -ENOTTY; break; } @@ -381,7 +381,7 @@ int mb7040_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, priv = (FAR struct mb7040_dev_s *)kmm_malloc(sizeof(*priv)); if (priv == NULL) { - sndbg("Failed to allocate instance\n"); + snerr("Failed to allocate instance\n"); return -ENOMEM; } @@ -393,7 +393,7 @@ int mb7040_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, ret = register_driver(devpath, &g_fops, 0666, priv); if (ret < 0) { - sndbg("Failed to register driver: %d\n", ret); + snerr("Failed to register driver: %d\n", ret); kmm_free(priv); } diff --git a/drivers/sensors/mcp9844.c b/drivers/sensors/mcp9844.c index c21e415560..47cab8fa9c 100644 --- a/drivers/sensors/mcp9844.c +++ b/drivers/sensors/mcp9844.c @@ -140,7 +140,7 @@ static int mcp9844_read_u16(FAR struct mcp9844_dev_s *priv, ret = i2c_write(priv->i2c, &config, ®addr, 1); if (ret < 0) { - sndbg ("i2c_write failed: %d\n", ret); + snerr ("i2c_write failed: %d\n", ret); return ret; } @@ -149,7 +149,7 @@ static int mcp9844_read_u16(FAR struct mcp9844_dev_s *priv, ret = i2c_read(priv->i2c, &config, buffer, 2); if (ret < 0) { - sndbg ("i2c_read failed: %d\n", ret); + snerr ("i2c_read failed: %d\n", ret); return ret; } @@ -157,7 +157,7 @@ static int mcp9844_read_u16(FAR struct mcp9844_dev_s *priv, *value = (((uint16_t)(buffer[0]))<<8) + ((uint16_t)(buffer[1])); - sndbg("addr: %02x value: %08x ret: %d\n", regaddr, *value, ret); + snerr("addr: %02x value: %08x ret: %d\n", regaddr, *value, ret); return OK; } @@ -174,7 +174,7 @@ static int mcp9844_write_u16(FAR struct mcp9844_dev_s *priv, { struct i2c_config_s config; - sndbg("addr: %02x value: %08x\n", regaddr, regval); + snerr("addr: %02x value: %08x\n", regaddr, regval); /* Set up a 3 byte message to send */ @@ -293,7 +293,7 @@ static int mcp9844_ioctl(FAR struct file *filep, int cmd, unsigned long arg) } else { - sndbg("ioctl::SNIOC_READTEMP - mcp9844_read_u16 failed - no temperature retrieved\n"); + snerr("ioctl::SNIOC_READTEMP - mcp9844_read_u16 failed - no temperature retrieved\n"); } } break; @@ -303,13 +303,13 @@ static int mcp9844_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ret = mcp9844_write_u16(priv, MCP9844_RESO_REG, (uint16_t)(arg)); if (ret != OK) { - sndbg("ioctl::SNIOC_SETRESOLUTION - mcp9844_write_u16 failed - no resolution set\n"); + snerr("ioctl::SNIOC_SETRESOLUTION - mcp9844_write_u16 failed - no resolution set\n"); } } break; default: - sndbg("Unrecognized cmd: %d\n", cmd); + snerr("Unrecognized cmd: %d\n", cmd); ret = -ENOTTY; break; } @@ -351,7 +351,7 @@ int mcp9844_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, if (priv == NULL) { - sndbg("Failed to allocate instance\n"); + snerr("Failed to allocate instance\n"); return -ENOMEM; } @@ -363,7 +363,7 @@ int mcp9844_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, int ret = register_driver(devpath, &g_mcp9844_fops, 0666, priv); if (ret < 0) { - sndbg("Failed to register driver: %d\n", ret); + snerr("Failed to register driver: %d\n", ret); kmm_free(priv); } diff --git a/drivers/sensors/mpl115a.c b/drivers/sensors/mpl115a.c index 0c4e87414c..71a137d5b7 100644 --- a/drivers/sensors/mpl115a.c +++ b/drivers/sensors/mpl115a.c @@ -157,7 +157,7 @@ static uint8_t mpl115a_getreg8(FAR struct mpl115a_dev_s *priv, uint8_t regaddr) (void)SPI_LOCK(priv->spi, false); #ifdef CONFIG_MPL115A_REGDEBUG - dbg("%02x->%02x\n", regaddr, regval); + err("%02x->%02x\n", regaddr, regval); #endif return regval; } @@ -176,25 +176,25 @@ static void mpl115a_updatecaldata(FAR struct mpl115a_dev_s *priv) priv->mpl115a_cal_a0 = mpl115a_getreg8(priv, MPL115A_BASE_CMD | (MPL115A_A0_MSB << 1)) << 8; priv->mpl115a_cal_a0 |= mpl115a_getreg8(priv, MPL115A_BASE_CMD | (MPL115A_A0_LSB << 1)); - sndbg("a0 = %d\n", priv->mpl115a_cal_a0); + snerr("a0 = %d\n", priv->mpl115a_cal_a0); /* Get b1 coefficient */ priv->mpl115a_cal_b1 = mpl115a_getreg8(priv, MPL115A_BASE_CMD | (MPL115A_B1_MSB << 1)) << 8; priv->mpl115a_cal_b1 |= mpl115a_getreg8(priv, MPL115A_BASE_CMD | (MPL115A_B1_LSB << 1)); - sndbg("b1 = %d\n", priv->mpl115a_cal_b1); + snerr("b1 = %d\n", priv->mpl115a_cal_b1); /* Get b2 coefficient */ priv->mpl115a_cal_b2 = mpl115a_getreg8(priv, MPL115A_BASE_CMD | (MPL115A_B2_MSB << 1)) << 8; priv->mpl115a_cal_b2 |= mpl115a_getreg8(priv, MPL115A_BASE_CMD | (MPL115A_B2_LSB << 1)); - sndbg("b2 = %d\n", priv->mpl115a_cal_b2); + snerr("b2 = %d\n", priv->mpl115a_cal_b2); /* Get c12 coefficient */ priv->mpl115a_cal_c12 = mpl115a_getreg8(priv, MPL115A_BASE_CMD | (MPL115A_C12_MSB << 1)) << 8; priv->mpl115a_cal_c12 |= mpl115a_getreg8(priv, MPL115A_BASE_CMD | (MPL115A_C12_LSB << 1)); - sndbg("c12 = %d\n", priv->mpl115a_cal_c12); + snerr("c12 = %d\n", priv->mpl115a_cal_c12); } /**************************************************************************** @@ -220,13 +220,13 @@ static void mpl115a_read_press_temp(FAR struct mpl115a_dev_s *priv) priv->mpl115a_pressure |= mpl115a_getreg8(priv, MPL115A_BASE_CMD | (MPL115A_PADC_LSB << 1)); priv->mpl115a_pressure >>= 6; /* Padc is 10bit unsigned */ - sndbg("Pressure = %d\n", priv->mpl115a_pressure); + snerr("Pressure = %d\n", priv->mpl115a_pressure); priv->mpl115a_temperature = mpl115a_getreg8(priv, MPL115A_BASE_CMD | (MPL115A_TADC_MSB << 1)) << 8; priv->mpl115a_temperature |= mpl115a_getreg8(priv, MPL115A_BASE_CMD | (MPL115A_TADC_LSB << 1)); priv->mpl115a_temperature >>= 6; /* Tadc is 10bit unsigned */ - sndbg("Temperature = %d\n", priv->mpl115a_temperature); + snerr("Temperature = %d\n", priv->mpl115a_temperature); } /**************************************************************************** @@ -274,7 +274,7 @@ static int mpl115a_getpressure(FAR struct mpl115a_dev_s *priv) * This may be eliminated by right shifting the result 4 bits. */ - sndbg("Final Pressure = %d\n", pressure >> 4); + snerr("Final Pressure = %d\n", pressure >> 4); return pressure; } @@ -316,13 +316,13 @@ static ssize_t mpl115a_read(FAR struct file *filep, FAR char *buffer, size_t buf if (!buffer) { - sndbg("Buffer is null\n"); + snerr("Buffer is null\n"); return -1; } if (buflen != 2) { - sndbg("You can't read something other than 16 bits (2 bytes)\n"); + snerr("You can't read something other than 16 bits (2 bytes)\n"); return -1; } @@ -378,7 +378,7 @@ int mpl115a_register(FAR const char *devpath, FAR struct spi_dev_s *spi) priv = (FAR struct mpl115a_dev_s *)kmm_malloc(sizeof(struct mpl115a_dev_s)); if (!priv) { - sndbg("Failed to allocate instance\n"); + snerr("Failed to allocate instance\n"); return -ENOMEM; } @@ -397,7 +397,7 @@ int mpl115a_register(FAR const char *devpath, FAR struct spi_dev_s *spi) ret = register_driver(devpath, &g_mpl115afops, 0666, priv); if (ret < 0) { - sndbg("Failed to register driver: %d\n", ret); + snerr("Failed to register driver: %d\n", ret); kmm_free(priv); } diff --git a/drivers/sensors/ms58xx.c b/drivers/sensors/ms58xx.c index 1cbcdc37e9..cbdd05cb36 100644 --- a/drivers/sensors/ms58xx.c +++ b/drivers/sensors/ms58xx.c @@ -306,14 +306,14 @@ static int ms58xx_readu16(FAR struct ms58xx_dev_s *priv, uint8_t regaddr, uint8_t buffer[2]; int ret; - sndbg("addr: %02x\n", regaddr); + snerr("addr: %02x\n", regaddr); /* Write the register address */ ret = ms58xx_i2c_write(priv, ®addr, sizeof(regaddr)); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } @@ -322,12 +322,12 @@ static int ms58xx_readu16(FAR struct ms58xx_dev_s *priv, uint8_t regaddr, ret = ms58xx_i2c_read(priv, buffer, sizeof(buffer)); if (ret < 0) { - sndbg("i2c_read failed: %d\n", ret); + snerr("i2c_read failed: %d\n", ret); return ret; } *regval = (uint16_t)buffer[0] << 8 | (uint16_t)buffer[1]; - sndbg("value: %04x ret: %d\n", *regval, ret); + snerr("value: %04x ret: %d\n", *regval, ret); return ret; } @@ -346,14 +346,14 @@ static int ms58xx_readadc(FAR struct ms58xx_dev_s *priv, FAR uint32_t *adc) int ret; regaddr = MS58XX_ADC_REG; - sndbg("addr: %02x\n", regaddr); + snerr("addr: %02x\n", regaddr); /* Write the register address */ ret = ms58xx_i2c_write(priv, ®addr, sizeof(regaddr)); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } @@ -362,7 +362,7 @@ static int ms58xx_readadc(FAR struct ms58xx_dev_s *priv, FAR uint32_t *adc) ret = ms58xx_i2c_read(priv, buffer, sizeof(buffer)); if (ret < 0) { - sndbg("i2c_read failed: %d\n", ret); + snerr("i2c_read failed: %d\n", ret); return ret; } @@ -370,7 +370,7 @@ static int ms58xx_readadc(FAR struct ms58xx_dev_s *priv, FAR uint32_t *adc) (uint32_t)buffer[1] << 8 | (uint32_t)buffer[2]; - sndbg("adc: %06x ret: %d\n", *adc, ret); + snerr("adc: %06x ret: %d\n", *adc, ret); return ret; } @@ -483,7 +483,7 @@ static int ms58xx_setosr(FAR struct ms58xx_dev_s *priv, uint16_t osr) { int ret = OK; - sndbg("osr: %04x\n", osr); + snerr("osr: %04x\n", osr); switch (priv->model) { @@ -558,7 +558,7 @@ static int ms58xx_readprom(FAR struct ms58xx_dev_s *priv) ret = ms58xx_readu16(priv, MS58XX_PROM_REG + i * 2, prom + i); if (ret < 0) { - sndbg("ms58xx_readu16 failed: %d\n", ret); + snerr("ms58xx_readu16 failed: %d\n", ret); return ret; } } @@ -568,7 +568,7 @@ static int ms58xx_readprom(FAR struct ms58xx_dev_s *priv) if (crc != ms58xx_crc(prom, crcindex, crcmask)) { - sndbg("crc mismatch\n"); + snerr("crc mismatch\n"); return -ENODEV; } @@ -620,14 +620,14 @@ static int ms58xx_reset(FAR struct ms58xx_dev_s *priv) int ret; regaddr = MS58XX_RESET_REG; - sndbg("addr: %02x\n", regaddr); + snerr("addr: %02x\n", regaddr); /* Write the register address */ ret = ms58xx_i2c_write(priv, ®addr, sizeof(regaddr)); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); return ret; } @@ -636,7 +636,7 @@ static int ms58xx_reset(FAR struct ms58xx_dev_s *priv) ret = ms58xx_readprom(priv); if (ret < 0) { - sndbg("ms58xx_readprom failed: %d\n", ret); + snerr("ms58xx_readprom failed: %d\n", ret); } return ret; @@ -656,14 +656,14 @@ static int ms58xx_convert(FAR struct ms58xx_dev_s *priv, uint8_t regaddr, int ret; regaddr |= priv->osr; - sndbg("addr: %02x\n", regaddr); + snerr("addr: %02x\n", regaddr); /* Write the register address */ ret = ms58xx_i2c_write(priv, ®addr, sizeof(regaddr)); if (ret < 0) { - sndbg("i2c_write failed: %d\n", ret); + snerr("i2c_write failed: %d\n", ret); } /* Wait for the conversion to end */ @@ -675,7 +675,7 @@ static int ms58xx_convert(FAR struct ms58xx_dev_s *priv, uint8_t regaddr, ret = ms58xx_readadc(priv, regval); if (ret < 0) { - sndbg("ms58xx_readadc failed: %d\n", ret); + snerr("ms58xx_readadc failed: %d\n", ret); return ret; } @@ -714,14 +714,14 @@ static int ms58xx_measure(FAR struct ms58xx_dev_s *priv) ret = ms58xx_convert(priv, MS58XX_PRESS_REG, &rawpress); if (ret < 0) { - sndbg("ms58xx_convert failed: %d\n", ret); + snerr("ms58xx_convert failed: %d\n", ret); return ret; } ret = ms58xx_convert(priv, MS58XX_TEMP_REG, &rawtemp); if (ret < 0) { - sndbg("ms58xx_convert failed: %d\n", ret); + snerr("ms58xx_convert failed: %d\n", ret); return ret; } @@ -923,7 +923,7 @@ static int ms58xx_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR int32_t *ptr = (FAR int32_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); *ptr = priv->temp; - sndbg("temp: %08x\n", *ptr); + snerr("temp: %08x\n", *ptr); } break; @@ -934,7 +934,7 @@ static int ms58xx_ioctl(FAR struct file *filep, int cmd, unsigned long arg) FAR int32_t *ptr = (FAR int32_t *)((uintptr_t)arg); DEBUGASSERT(ptr != NULL); *ptr = priv->press; - sndbg("press: %08x\n", *ptr); + snerr("press: %08x\n", *ptr); } break; @@ -949,13 +949,13 @@ static int ms58xx_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case SNIOC_OVERSAMPLING: ret = ms58xx_setosr(priv, (uint16_t)arg); - sndbg("osr: %04x ret: %d\n", *(uint16_t *)arg, ret); + snerr("osr: %04x ret: %d\n", *(uint16_t *)arg, ret); break; /* Unrecognized commands */ default: - sndbg("Unrecognized cmd: %d arg: %ld\n", cmd, arg); + snerr("Unrecognized cmd: %d arg: %ld\n", cmd, arg); ret = -ENOTTY; break; } @@ -1010,7 +1010,7 @@ int ms58xx_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, priv = (FAR struct ms58xx_dev_s *)kmm_malloc(sizeof(*priv)); if (priv == NULL) { - sndbg("Failed to allocate instance\n"); + snerr("Failed to allocate instance\n"); return -ENOMEM; } @@ -1177,14 +1177,14 @@ int ms58xx_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, ret = ms58xx_setosr(priv, osr); if (ret < 0) { - sndbg("ms58xx_setosr failed: %d\n", ret); + snerr("ms58xx_setosr failed: %d\n", ret); goto err; } ret = ms58xx_reset(priv); if (ret < 0) { - sndbg("ms58xx_reset failed: %d\n", ret); + snerr("ms58xx_reset failed: %d\n", ret); goto err; } @@ -1193,7 +1193,7 @@ int ms58xx_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, ret = register_driver(devpath, &g_fops, 0666, priv); if (ret < 0) { - sndbg("Failed to register driver: %d\n", ret); + snerr("Failed to register driver: %d\n", ret); goto err; } diff --git a/drivers/sensors/qencoder.c b/drivers/sensors/qencoder.c index 69053bd357..1171ed472d 100644 --- a/drivers/sensors/qencoder.c +++ b/drivers/sensors/qencoder.c @@ -371,7 +371,7 @@ int qe_register(FAR const char *devpath, FAR struct qe_lowerhalf_s *lower) upper = (FAR struct qe_upperhalf_s *)kmm_zalloc(sizeof(struct qe_upperhalf_s)); if (!upper) { - sndbg("Allocation failed\n"); + snerr("Allocation failed\n"); return -ENOMEM; } diff --git a/drivers/sercomm/console.c b/drivers/sercomm/console.c index 53b321964f..5936d2d5b3 100644 --- a/drivers/sercomm/console.c +++ b/drivers/sercomm/console.c @@ -187,7 +187,7 @@ int sercomm_register(FAR const char *path, FAR uart_dev_t *dev) sem_init(&dev->pollsem, 0, 1); #endif - dbg("Registering %s\n", path); + err("Registering %s\n", path); return register_driver(path, &g_sercom_console_ops, 0666, NULL); } diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 2d8056e126..b643b2b604 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -1369,7 +1369,7 @@ int uart_register(FAR const char *path, FAR uart_dev_t *dev) sem_init(&dev->pollsem, 0, 1); #endif - dbg("Registering %s\n", path); + err("Registering %s\n", path); return register_driver(path, &g_serialops, 0666, dev); } diff --git a/drivers/serial/uart_16550.c b/drivers/serial/uart_16550.c index af730d6d27..2bbae910ad 100644 --- a/drivers/serial/uart_16550.c +++ b/drivers/serial/uart_16550.c @@ -848,7 +848,7 @@ static int u16550_interrupt(int irq, void *context) default: { - dbg("Unexpected IIR: %02x\n", status); + err("Unexpected IIR: %02x\n", status); break; } } diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c index 75667fd135..e2bc8bcc42 100644 --- a/drivers/spi/spi_bitbang.c +++ b/drivers/spi/spi_bitbang.c @@ -89,14 +89,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif @@ -564,7 +564,7 @@ FAR struct spi_dev_s *spi_create_bitbang(FAR const struct spi_bitbang_ops_s *low priv = (FAR struct spi_bitbang_s *)zalloc(sizeof(struct spi_bitbang_s)); if (!priv) { - spidbg("Failed to allocate the device structure\n"); + spierr("Failed to allocate the device structure\n"); return NULL; } diff --git a/drivers/timers/cs2100-cp.c b/drivers/timers/cs2100-cp.c index 11ed144cb4..40f5191cc5 100644 --- a/drivers/timers/cs2100-cp.c +++ b/drivers/timers/cs2100-cp.c @@ -66,33 +66,33 @@ /* Debug ********************************************************************/ -#undef csdbg +#undef cserr #ifdef CONFIG_CS2100CP_DEBUG # ifdef CONFIG_CPP_HAVE_VARARGS -# define csdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define cserr(format, ...) err(format, ##__VA_ARGS__) # else -# define csdbg dbg +# define cserr err # endif #else # ifdef CONFIG_CPP_HAVE_VARARGS -# define csdbg(x...) +# define cserr(x...) # else -# define csdbg (void) +# define cserr (void) # endif #endif -#undef regdbg +#undef regerr #ifdef CONFIG_CS2100CP_REGDEBUG # ifdef CONFIG_CPP_HAVE_VARARGS -# define regdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define regerr(format, ...) err(format, ##__VA_ARGS__) # else -# define regdbg dbg +# define regerr err # endif #else # ifdef CONFIG_CPP_HAVE_VARARGS -# define regdbg(x...) +# define regerr(x...) # else -# define regdbg (void) +# define regerr (void) # endif #endif @@ -129,7 +129,7 @@ static int cs2100_write_reg(FAR const struct cs2100_config_s *config, { struct i2c_msg_s msgs[2]; - regdbg("%02x<-%02x\n", regaddr, regval); + regerr("%02x<-%02x\n", regaddr, regval); DEBUGASSERT(config->i2c->ops && config->i2c->ops->transfer); /* Construct the I2C message (write N+1 bytes with no restart) */ @@ -200,7 +200,7 @@ static int cs2100_read_reg(FAR const struct cs2100_config_s *config, ret = I2C_TRANSFER(config->i2c, &msg, 1); if (ret == OK) { - regdbg("%02x->%02x\n", regaddr, *regval); + regerr("%02x->%02x\n", regaddr, *regval); } } @@ -229,7 +229,7 @@ static int cs2100_write_ratio(FAR const struct cs2100_config_s *config, struct i2c_msg_s msg; uint8_t buffer[5]; - regdbg("%02x<-%04l\n", CS2100_RATIO0, (unsigned long)ratio); + regerr("%02x<-%04l\n", CS2100_RATIO0, (unsigned long)ratio); DEBUGASSERT(config->i2c->ops && config->i2c->ops->transfer); /* Construct the I2C message (write N+1 bytes with no restart) */ @@ -310,7 +310,7 @@ static int cs2100_read_ratio(FAR const struct cs2100_config_s *config, ((uint32_t)buffer[2] << 8) | (uint32_t)buffer[0]; - regdbg("%02x->%04l\n", CS2100_RATIO0, (unsigned long)*ratio); + regerr("%02x->%04l\n", CS2100_RATIO0, (unsigned long)*ratio); } } @@ -356,7 +356,7 @@ static int cs2100_refclk(FAR const struct cs2100_config_s *config) } else { - csdbg("ERROR: reflck too large: %ul\n", (unsigned long)config->refclk); + cserr("ERROR: reflck too large: %ul\n", (unsigned long)config->refclk); return -EINVAL; } @@ -370,7 +370,7 @@ static int cs2100_refclk(FAR const struct cs2100_config_s *config) ret = cs2100_write_reg(config, CS2100_FNCCFG1, regval); if (ret < 0) { - csdbg("ERROR: Failed to set CS2100_FNCCFG1: %d\n", ret); + cserr("ERROR: Failed to set CS2100_FNCCFG1: %d\n", ret); return ret; } @@ -414,7 +414,7 @@ static int cs2100_refclk(FAR const struct cs2100_config_s *config) ret = cs2100_write_reg(config, CS2100_FNCCFG3, regval); if (ret < 0) { - csdbg("ERROR: Failed to set CS2100_FNCCFG3: %d\n", ret); + cserr("ERROR: Failed to set CS2100_FNCCFG3: %d\n", ret); return ret; } @@ -426,7 +426,7 @@ static int cs2100_refclk(FAR const struct cs2100_config_s *config) ret = cs2100_write_reg(config, CS2100_FNCCFG2, CS2100_FNCCFG2_CLKOUTUNL); if (ret < 0) { - csdbg("ERROR: Failed to set CS2100_FNCCFG2: %d\n", ret); + cserr("ERROR: Failed to set CS2100_FNCCFG2: %d\n", ret); } return ret; @@ -554,7 +554,7 @@ static int cs2100_ratio(FAR const struct cs2100_config_s *config) } else { - csdbg("ERROR: Ratio too large: %08llx\n", rudb24); + cserr("ERROR: Ratio too large: %08llx\n", rudb24); return -E2BIG; } @@ -563,7 +563,7 @@ static int cs2100_ratio(FAR const struct cs2100_config_s *config) ret = cs2100_write_ratio(config, rud); if (ret < 0) { - csdbg("ERROR: Failed to set ratio: %d\n", ret); + cserr("ERROR: Failed to set ratio: %d\n", ret); return ret; } @@ -576,7 +576,7 @@ static int cs2100_ratio(FAR const struct cs2100_config_s *config) ret = cs2100_write_reg(config, CS2100_DEVCFG1, regval); if (ret < 0) { - csdbg("ERROR: Failed to set CS2100_DEVCFG1: %d\n", ret); + cserr("ERROR: Failed to set CS2100_DEVCFG1: %d\n", ret); return ret; } @@ -628,7 +628,7 @@ int cs2100_enable(FAR const struct cs2100_config_s *config) ret = cs2100_write_reg(config, CS2100_DEVCTL, regval); if (ret < 0) { - csdbg("ERROR: Failed to set CS2100_DEVCTL: %d\n", ret); + cserr("ERROR: Failed to set CS2100_DEVCTL: %d\n", ret); return ret; } @@ -637,7 +637,7 @@ int cs2100_enable(FAR const struct cs2100_config_s *config) ret = cs2100_refclk(config); if (ret < 0) { - csdbg("ERROR: cs2100_refclk failed: %d\n", ret); + cserr("ERROR: cs2100_refclk failed: %d\n", ret); return ret; } @@ -649,7 +649,7 @@ int cs2100_enable(FAR const struct cs2100_config_s *config) ret = cs2100_write_reg(config, CS2100_GBLCFG, CS2100_GBLCFG_FREEZE); if (ret < 0) { - csdbg("ERROR: Failed to set CS2100_GBLCFG: %d\n", ret); + cserr("ERROR: Failed to set CS2100_GBLCFG: %d\n", ret); return ret; } @@ -658,7 +658,7 @@ int cs2100_enable(FAR const struct cs2100_config_s *config) ret = cs2100_ratio(config); if (ret < 0) { - csdbg("ERROR: cs2100_ratio failed: %d\n", ret); + cserr("ERROR: cs2100_ratio failed: %d\n", ret); return ret; } @@ -667,7 +667,7 @@ int cs2100_enable(FAR const struct cs2100_config_s *config) ret = cs2100_write_reg(config, CS2100_GBLCFG, CS2100_GBLCFG_ENDEVCFG2); if (ret < 0) { - csdbg("ERROR: Failed to set CS2100_GBLCFG: %d\n", ret); + cserr("ERROR: Failed to set CS2100_GBLCFG: %d\n", ret); return ret; } @@ -677,7 +677,7 @@ int cs2100_enable(FAR const struct cs2100_config_s *config) ret = cs2100_write_reg(config, CS2100_DEVCTL, regval); if (ret < 0) { - csdbg("ERROR: Failed to set CS2100_DEVCTL: %d\n", ret); + cserr("ERROR: Failed to set CS2100_DEVCTL: %d\n", ret); } return ret; @@ -709,7 +709,7 @@ int cs2100_disable(FAR const struct cs2100_config_s *config) ret = cs2100_write_reg(config, CS2100_DEVCTL, regval); if (ret < 0) { - csdbg("ERROR: Failed to set CS2100_DEVCTL: %d\n", ret); + cserr("ERROR: Failed to set CS2100_DEVCTL: %d\n", ret); return ret; } @@ -718,7 +718,7 @@ int cs2100_disable(FAR const struct cs2100_config_s *config) ret = cs2100_write_reg(config, CS2100_GBLCFG, 0); if (ret < 0) { - csdbg("ERROR: Failed to set CS2100_GBLCFG: %d\n", ret); + cserr("ERROR: Failed to set CS2100_GBLCFG: %d\n", ret); return ret; } @@ -727,7 +727,7 @@ int cs2100_disable(FAR const struct cs2100_config_s *config) ret = cs2100_write_reg(config, CS2100_DEVCFG1, 0); if (ret < 0) { - csdbg("ERROR: Failed to set CS2100_DEVCFG1: %d\n", ret); + cserr("ERROR: Failed to set CS2100_DEVCFG1: %d\n", ret); return ret; } @@ -737,7 +737,7 @@ int cs2100_disable(FAR const struct cs2100_config_s *config) ret = cs2100_write_reg(config, CS2100_DEVCTL, regval); if (ret < 0) { - csdbg("ERROR: Failed to set CS2100_DEVCTL: %d\n", ret); + cserr("ERROR: Failed to set CS2100_DEVCTL: %d\n", ret); } return ret; @@ -764,79 +764,79 @@ int cs2100_dump(FAR const struct cs2100_config_s *config) uint8_t regval; int ret; - dbg("CS200-CP Registers:\n"); + err("CS200-CP Registers:\n"); ret = cs2100_read_reg(config, CS2100_DEVID, ®val); if (ret < 0) { - csdbg("ERROR: Failed to read CS2100_DEVID: %d\n", ret); + cserr("ERROR: Failed to read CS2100_DEVID: %d\n", ret); return ret; } - dbg(" Devid: %02x\n", regval); + err(" Devid: %02x\n", regval); ret = cs2100_read_reg(config, CS2100_DEVCTL, ®val); if (ret < 0) { - csdbg("ERROR: Failed to read CS2100_DEVCTL: %d\n", ret); + cserr("ERROR: Failed to read CS2100_DEVCTL: %d\n", ret); return ret; } - dbg(" DevCtl: %02x\n", regval); + err(" DevCtl: %02x\n", regval); ret = cs2100_read_reg(config, CS2100_DEVCFG1, ®val); if (ret < 0) { - csdbg("ERROR: Failed to read CS2100_DEVCFG1: %d\n", ret); + cserr("ERROR: Failed to read CS2100_DEVCFG1: %d\n", ret); return ret; } - dbg(" DevCfg1: %02x\n", regval); + err(" DevCfg1: %02x\n", regval); ret = cs2100_read_reg(config, CS2100_GBLCFG, ®val); if (ret < 0) { - csdbg("ERROR: Failed to read CS2100_GBLCFG: %d\n", ret); + cserr("ERROR: Failed to read CS2100_GBLCFG: %d\n", ret); return ret; } - dbg(" GblCfg: %02x\n", regval); + err(" GblCfg: %02x\n", regval); ret = cs2100_read_ratio(config, &ratio); if (ret < 0) { - csdbg("ERROR: cs2100_read_ratio failed: %d\n", ret); + cserr("ERROR: cs2100_read_ratio failed: %d\n", ret); return ret; } - dbg(" Ratio: %04lx\n", (unsigned long)ratio); + err(" Ratio: %04lx\n", (unsigned long)ratio); ret = cs2100_read_reg(config, CS2100_FNCCFG1, ®val); if (ret < 0) { - csdbg("ERROR: Failed to read CS2100_FNCCFG1: %d\n", ret); + cserr("ERROR: Failed to read CS2100_FNCCFG1: %d\n", ret); return ret; } - dbg(" FuncCfg1: %02x\n", regval); + err(" FuncCfg1: %02x\n", regval); ret = cs2100_read_reg(config, CS2100_FNCCFG2, ®val); if (ret < 0) { - csdbg("ERROR: Failed to read CS2100_FNCCFG2: %d\n", ret); + cserr("ERROR: Failed to read CS2100_FNCCFG2: %d\n", ret); return ret; } - dbg(" FuncCfg2: %02x\n", regval); + err(" FuncCfg2: %02x\n", regval); ret = cs2100_read_reg(config, CS2100_FNCCFG3, ®val); if (ret < 0) { - csdbg("ERROR: Failed to read CS2100_FNCCFG3: %d\n", ret); + cserr("ERROR: Failed to read CS2100_FNCCFG3: %d\n", ret); return ret; } - dbg(" FuncCfg3: %02x\n", regval); + err(" FuncCfg3: %02x\n", regval); return OK; } diff --git a/drivers/timers/ds3231.c b/drivers/timers/ds3231.c index 8dbed20dec..f8cd2c6189 100644 --- a/drivers/timers/ds3231.c +++ b/drivers/timers/ds3231.c @@ -84,12 +84,12 @@ /* Debug ****************************************************************************/ #ifdef CONFIG_DEBUG_RTC -# define rtcdbg dbg +# define rtcerr err # define rtcinfo info # define rtcllerr llerr # define rtcllinfo llinfo #else -# define rtcdbg(x...) +# define rtcerr(x...) # define rtcinfo(x...) # define rtcllerr(x...) # define rtcllinfo(x...) @@ -339,7 +339,7 @@ int up_rtc_getdatetime(FAR struct tm *tp) ret = I2C_TRANSFER(g_ds3231.i2c, msg, 4); if (ret < 0) { - rtcdbg("ERROR: I2C_TRANSFER failed: %d\n", ret) + rtcerr("ERROR: I2C_TRANSFER failed: %d\n", ret) return ret; } } @@ -448,13 +448,13 @@ int up_rtc_settime(FAR const struct timespec *tp) #ifdef CONFIG_LIBC_LOCALTIME if (localtime_r(&newtime, &newtm) == NULL) { - rtcdbg("ERROR: localtime_r failed\n") + rtcerr("ERROR: localtime_r failed\n") return -EINVAL; } #else if (gmtime_r(&newtime, &newtm) == NULL) { - rtcdbg("ERROR: gmtime_r failed\n") + rtcerr("ERROR: gmtime_r failed\n") return -EINVAL; } #endif @@ -554,7 +554,7 @@ int up_rtc_settime(FAR const struct timespec *tp) ret = I2C_TRANSFER(g_ds3231.i2c, msg, 3); if (ret < 0) { - rtcdbg("ERROR: I2C_TRANSFER failed: %d\n", ret) + rtcerr("ERROR: I2C_TRANSFER failed: %d\n", ret) return ret; } } diff --git a/drivers/timers/pcf85263.c b/drivers/timers/pcf85263.c index 7a9f22145f..a72b534e8c 100644 --- a/drivers/timers/pcf85263.c +++ b/drivers/timers/pcf85263.c @@ -84,12 +84,12 @@ /* Debug ****************************************************************************/ #ifdef CONFIG_DEBUG_RTC -# define rtcdbg dbg +# define rtcerr err # define rtcinfo info # define rtcllerr llerr # define rtcllinfo llinfo #else -# define rtcdbg(x...) +# define rtcerr(x...) # define rtcinfo(x...) # define rtcllerr(x...) # define rtcllinfo(x...) @@ -338,7 +338,7 @@ int up_rtc_getdatetime(FAR struct tm *tp) ret = I2C_TRANSFER(g_pcf85263.i2c, msg, 4); if (ret < 0) { - rtcdbg("ERROR: I2C_TRANSFER failed: %d\n", ret) + rtcerr("ERROR: I2C_TRANSFER failed: %d\n", ret) return ret; } } @@ -431,13 +431,13 @@ int up_rtc_settime(FAR const struct timespec *tp) #ifdef CONFIG_LIBC_LOCALTIME if (localtime_r(&newtime, &newtm) == NULL) { - rtcdbg("ERROR: localtime_r failed\n") + rtcerr("ERROR: localtime_r failed\n") return -EINVAL; } #else if (gmtime_r(&newtime, &newtm) == NULL) { - rtcdbg("ERROR: gmtime_r failed\n") + rtcerr("ERROR: gmtime_r failed\n") return -EINVAL; } #endif @@ -518,7 +518,7 @@ int up_rtc_settime(FAR const struct timespec *tp) ret = I2C_TRANSFER(g_pcf85263.i2c, msg, 3); if (ret < 0) { - rtcdbg("ERROR: I2C_TRANSFER failed: %d\n", ret) + rtcerr("ERROR: I2C_TRANSFER failed: %d\n", ret) return ret; } } diff --git a/drivers/timers/timer.c b/drivers/timers/timer.c index ead1d4d905..6db72e795f 100644 --- a/drivers/timers/timer.c +++ b/drivers/timers/timer.c @@ -64,12 +64,12 @@ /* Non-standard debug that may be enabled just for testing the timer driver */ #ifdef CONFIG_DEBUG_TIMER -# define tmrdbg dbg +# define tmrerr err # define tmrinfo info # define tmrllerr llerr # define tmrllinfo llinfo #else -# define tmrdbg(x...) +# define tmrerr(x...) # define tmrinfo(x...) # define tmrllerr(x...) # define tmrllinfo(x...) @@ -451,7 +451,7 @@ FAR void *timer_register(FAR const char *path, kmm_zalloc(sizeof(struct timer_upperhalf_s)); if (!upper) { - tmrdbg("Upper half allocation failed\n"); + tmrerr("Upper half allocation failed\n"); goto errout; } @@ -466,7 +466,7 @@ FAR void *timer_register(FAR const char *path, upper->path = strdup(path); if (!upper->path) { - tmrdbg("Path allocation failed\n"); + tmrerr("Path allocation failed\n"); goto errout_with_upper; } @@ -475,7 +475,7 @@ FAR void *timer_register(FAR const char *path, ret = register_driver(path, &g_timerops, 0666, upper); if (ret < 0) { - tmrdbg("register_driver failed: %d\n", ret); + tmrerr("register_driver failed: %d\n", ret); goto errout_with_path; } diff --git a/drivers/timers/watchdog.c b/drivers/timers/watchdog.c index 3f73efd2fe..13b23efd51 100644 --- a/drivers/timers/watchdog.c +++ b/drivers/timers/watchdog.c @@ -63,12 +63,12 @@ /* Non-standard debug that may be enabled just for testing the watchdog driver */ #ifdef CONFIG_DEBUG_WATCHDOG -# define wddbg dbg +# define wderr err # define wdinfo info # define wdllerr llerr # define wdllinfo llinfo #else -# define wddbg(x...) +# define wderr(x...) # define wdinfo(x...) # define wdllerr(x...) # define wdllinfo(x...) @@ -486,7 +486,7 @@ FAR void *watchdog_register(FAR const char *path, kmm_zalloc(sizeof(struct watchdog_upperhalf_s)); if (!upper) { - wddbg("Upper half allocation failed\n"); + wderr("Upper half allocation failed\n"); goto errout; } @@ -502,7 +502,7 @@ FAR void *watchdog_register(FAR const char *path, upper->path = strdup(path); if (!upper->path) { - wddbg("Path allocation failed\n"); + wderr("Path allocation failed\n"); goto errout_with_upper; } @@ -511,7 +511,7 @@ FAR void *watchdog_register(FAR const char *path, ret = register_driver(path, &g_wdogops, 0666, upper); if (ret < 0) { - wddbg("register_driver failed: %d\n", ret); + wderr("register_driver failed: %d\n", ret); goto errout_with_path; } diff --git a/drivers/usbhost/usbhost_cdcacm.c b/drivers/usbhost/usbhost_cdcacm.c index 6b7ef9d020..336d9e639b 100644 --- a/drivers/usbhost/usbhost_cdcacm.c +++ b/drivers/usbhost/usbhost_cdcacm.c @@ -687,7 +687,7 @@ static int usbhost_linecoding_send(FAR struct usbhost_cdcacm_s *priv) ret = DRVR_CTRLOUT(hport->drvr, hport->ep0, ctrlreq, priv->linecode); if (ret < 0) { - udbg("ERROR: DRVR_CTRLOUT failed: %d\n", ret); + uerr("ERROR: DRVR_CTRLOUT failed: %d\n", ret); } return ret; @@ -777,7 +777,7 @@ static void usbhost_notification_work(FAR void *arg) priv); if (ret < 0) { - udbg("ERROR: DRVR_ASYNCH failed: %d\n", ret); + uerr("ERROR: DRVR_ASYNCH failed: %d\n", ret); } } } @@ -837,7 +837,7 @@ static void usbhost_notification_callback(FAR void *arg, ssize_t nbytes) if (nbytes != -EAGAIN) #endif { - udbg("ERROR: Transfer failed: %d\n", nbytes); + uerr("ERROR: Transfer failed: %d\n", nbytes); } /* We don't know the nature of the failure, but we need to do all @@ -961,7 +961,7 @@ static void usbhost_txdata_work(FAR void *arg) * the device is disconnected). */ - udbg("ERROR: DRVR_TRANSFER for packet failed: %d\n", (int)nwritten); + uerr("ERROR: DRVR_TRANSFER for packet failed: %d\n", (int)nwritten); break; } } @@ -986,7 +986,7 @@ static void usbhost_txdata_work(FAR void *arg) * NAK'ed our packet. */ - udbg("ERROR: DRVR_TRANSFER for ZLP failed: %d\n", (int)nwritten); + uerr("ERROR: DRVR_TRANSFER for ZLP failed: %d\n", (int)nwritten); } } @@ -1099,7 +1099,7 @@ static void usbhost_rxdata_work(FAR void *arg) * device was not disconnected. */ - udbg("ERROR: DRVR_TRANSFER for packet failed: %d\n", (int)nread); + uerr("ERROR: DRVR_TRANSFER for packet failed: %d\n", (int)nread); break; } @@ -1559,7 +1559,7 @@ static int usbhost_cfgdesc(FAR struct usbhost_cdcacm_s *priv, if ((found & USBHOST_MINFOUND) != USBHOST_MINFOUND) { - udbg("ERROR: Found DATA IF:%s BULK IN:%s BULK OUT:%s\n", + uerr("ERROR: Found DATA IF:%s BULK IN:%s BULK OUT:%s\n", (found & USBHOST_DATAIF_FOUND) != 0 ? "YES" : "NO", (found & USBHOST_BULKIN_FOUND) != 0 ? "YES" : "NO", (found & USBHOST_BULKOUT_FOUND) != 0 ? "YES" : "NO"); @@ -1571,14 +1571,14 @@ static int usbhost_cfgdesc(FAR struct usbhost_cdcacm_s *priv, ret = DRVR_EPALLOC(hport->drvr, &boutdesc, &priv->bulkout); if (ret < 0) { - udbg("ERROR: Failed to allocate Bulk OUT endpoint\n"); + uerr("ERROR: Failed to allocate Bulk OUT endpoint\n"); return ret; } ret = DRVR_EPALLOC(hport->drvr, &bindesc, &priv->bulkin); if (ret < 0) { - udbg("ERROR: Failed to allocate Bulk IN endpoint\n"); + uerr("ERROR: Failed to allocate Bulk IN endpoint\n"); (void)DRVR_EPFREE(hport->drvr, priv->bulkout); return ret; } @@ -1591,7 +1591,7 @@ static int usbhost_cfgdesc(FAR struct usbhost_cdcacm_s *priv, ret = DRVR_EPALLOC(hport->drvr, &iindesc, &priv->intin); if (ret < 0) { - udbg("ERROR: Failed to allocate Interrupt IN endpoint\n"); + uerr("ERROR: Failed to allocate Interrupt IN endpoint\n"); priv->intin = NULL; } } @@ -1715,7 +1715,7 @@ static int usbhost_alloc_buffers(FAR struct usbhost_cdcacm_s *priv) ret = DRVR_ALLOC(hport->drvr, (FAR uint8_t **)&priv->ctrlreq, &maxlen); if (ret < 0) { - udbg("ERROR: DRVR_ALLOC of ctrlreq failed: %d\n", ret); + uerr("ERROR: DRVR_ALLOC of ctrlreq failed: %d\n", ret); goto errout; } @@ -1727,7 +1727,7 @@ static int usbhost_alloc_buffers(FAR struct usbhost_cdcacm_s *priv) sizeof(struct cdc_linecoding_s)); if (ret < 0) { - udbg("ERROR: DRVR_IOALLOC of line coding failed: %d (%d bytes)\n", + uerr("ERROR: DRVR_IOALLOC of line coding failed: %d (%d bytes)\n", ret, sizeof(struct cdc_linecoding_s)); goto errout; } @@ -1740,7 +1740,7 @@ static int usbhost_alloc_buffers(FAR struct usbhost_cdcacm_s *priv) ret = DRVR_IOALLOC(hport->drvr, &priv->notification, MAX_NOTIFICATION); if (ret < 0) { - udbg("ERROR: DRVR_IOALLOC of line status failed: %d (%d bytes)\n", + uerr("ERROR: DRVR_IOALLOC of line status failed: %d (%d bytes)\n", ret, MAX_NOTIFICATION); goto errout; } @@ -1756,7 +1756,7 @@ static int usbhost_alloc_buffers(FAR struct usbhost_cdcacm_s *priv) ret = DRVR_IOALLOC(hport->drvr, &priv->inbuf, priv->pktsize); if (ret < 0) { - udbg("ERROR: DRVR_IOALLOC of Bulk IN buffer failed: %d (%d bytes)\n", + uerr("ERROR: DRVR_IOALLOC of Bulk IN buffer failed: %d (%d bytes)\n", ret, priv->pktsize); goto errout; } @@ -1766,7 +1766,7 @@ static int usbhost_alloc_buffers(FAR struct usbhost_cdcacm_s *priv) ret = DRVR_IOALLOC(hport->drvr, &priv->outbuf, priv->pktsize); if (ret < 0) { - udbg("ERROR: DRVR_IOALLOC of Bulk OUT buffer failed: %d (%d bytes)\n", + uerr("ERROR: DRVR_IOALLOC of Bulk OUT buffer failed: %d (%d bytes)\n", ret, priv->pktsize); goto errout; } @@ -2002,7 +2002,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, ret = usbhost_cfgdesc(priv, configdesc, desclen); if (ret < 0) { - udbg("usbhost_cfgdesc() failed: %d\n", ret); + uerr("usbhost_cfgdesc() failed: %d\n", ret); goto errout; } @@ -2011,7 +2011,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, ret = usbhost_alloc_buffers(priv); if (ret < 0) { - udbg("ERROR: Failed to allocate transfer buffer\n"); + uerr("ERROR: Failed to allocate transfer buffer\n"); goto errout; } @@ -2021,7 +2021,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, ret = usbhost_linecoding_send(priv); if (ret < 0) { - udbg("usbhost_linecoding_send() failed: %d\n", ret); + uerr("usbhost_linecoding_send() failed: %d\n", ret); } #endif @@ -2034,7 +2034,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, ret = uart_register(devname, &priv->uartdev); if (ret < 0) { - udbg("uart_register() failed: %d\n", ret); + uerr("uart_register() failed: %d\n", ret); goto errout; } @@ -2052,7 +2052,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, priv); if (ret < 0) { - udbg("ERROR: DRVR_ASYNCH failed: %d\n", ret); + uerr("ERROR: DRVR_ASYNCH failed: %d\n", ret); } } #endif @@ -2128,13 +2128,13 @@ static int usbhost_disconnected(struct usbhost_class_s *usbclass) ret = DRVR_CANCEL(hport->drvr, priv->bulkin); if (ret < 0) { - udbg("ERROR: Bulk IN DRVR_CANCEL failed: %d\n", ret); + uerr("ERROR: Bulk IN DRVR_CANCEL failed: %d\n", ret); } ret = DRVR_CANCEL(hport->drvr, priv->bulkout); if (ret < 0) { - udbg("ERROR: Bulk OUT DRVR_CANCEL failed: %d\n", ret); + uerr("ERROR: Bulk OUT DRVR_CANCEL failed: %d\n", ret); } #ifdef HAVE_INTIN_ENDPOINT @@ -2145,7 +2145,7 @@ static int usbhost_disconnected(struct usbhost_class_s *usbclass) int ret = DRVR_CANCEL(hport->drvr, priv->intin); if (ret < 0) { - udbg("ERROR: Interrupt IN DRVR_CANCEL failed: %d\n", ret); + uerr("ERROR: Interrupt IN DRVR_CANCEL failed: %d\n", ret); } } #endif diff --git a/drivers/usbhost/usbhost_devaddr.c b/drivers/usbhost/usbhost_devaddr.c index e26513c540..58fbe04297 100644 --- a/drivers/usbhost/usbhost_devaddr.c +++ b/drivers/usbhost/usbhost_devaddr.c @@ -296,7 +296,7 @@ int usbhost_devaddr_create(FAR struct usbhost_hubport_s *hport) if (devaddr < 0) { - udbg("ERROR: Failed to allocate a device address\n"); + uerr("ERROR: Failed to allocate a device address\n"); } return devaddr; diff --git a/drivers/usbhost/usbhost_enumerate.c b/drivers/usbhost/usbhost_enumerate.c index 0bb30d961b..f3f3579e90 100644 --- a/drivers/usbhost/usbhost_enumerate.c +++ b/drivers/usbhost/usbhost_enumerate.c @@ -256,7 +256,7 @@ static inline int usbhost_classbind(FAR struct usbhost_hubport_s *hport, * should then free the allocated devclass instance. */ - udbg("CLASS_CONNECT failed: %d\n", ret); + uerr("CLASS_CONNECT failed: %d\n", ret); CLASS_DISCONNECTED(devclass); } else @@ -326,14 +326,14 @@ int usbhost_enumerate(FAR struct usbhost_hubport_s *hport, ret = DRVR_ALLOC(hport->drvr, (FAR uint8_t **)&ctrlreq, &maxlen); if (ret < 0) { - udbg("DRVR_ALLOC failed: %d\n", ret); + uerr("DRVR_ALLOC failed: %d\n", ret); return ret; } ret = DRVR_ALLOC(hport->drvr, &buffer, &maxlen); if (ret < 0) { - udbg("DRVR_ALLOC failed: %d\n", ret); + uerr("DRVR_ALLOC failed: %d\n", ret); goto errout; } @@ -381,7 +381,7 @@ int usbhost_enumerate(FAR struct usbhost_hubport_s *hport, ret = DRVR_CTRLIN(hport->drvr, hport->ep0, ctrlreq, buffer); if (ret < 0) { - udbg("ERROR: Failed to get device descriptor, length=%d: %d\n", + uerr("ERROR: Failed to get device descriptor, length=%d: %d\n", descsize, ret); goto errout; } @@ -409,7 +409,7 @@ int usbhost_enumerate(FAR struct usbhost_hubport_s *hport, ret = DRVR_CTRLIN(hport->drvr, hport->ep0, ctrlreq, buffer); if (ret < 0) { - udbg("ERROR: Failed to get device descriptor, length=%d: %d\n", + uerr("ERROR: Failed to get device descriptor, length=%d: %d\n", USB_SIZEOF_DEVDESC, ret); goto errout; } @@ -428,7 +428,7 @@ int usbhost_enumerate(FAR struct usbhost_hubport_s *hport, funcaddr = usbhost_devaddr_create(hport); if (funcaddr < 0) { - udbg("ERROR: usbhost_devaddr_create failed: %d\n", ret); + uerr("ERROR: usbhost_devaddr_create failed: %d\n", ret); goto errout; } @@ -443,7 +443,7 @@ int usbhost_enumerate(FAR struct usbhost_hubport_s *hport, ret = DRVR_CTRLOUT(hport->drvr, hport->ep0, ctrlreq, NULL); if (ret < 0) { - udbg("ERROR: Failed to set address: %d\n"); + uerr("ERROR: Failed to set address: %d\n"); goto errout; } @@ -473,7 +473,7 @@ int usbhost_enumerate(FAR struct usbhost_hubport_s *hport, ret = DRVR_CTRLIN(hport->drvr, hport->ep0, ctrlreq, buffer); if (ret < 0) { - udbg("ERROR: Failed to get configuration descriptor, length=%d: %d\n", + uerr("ERROR: Failed to get configuration descriptor, length=%d: %d\n", USB_SIZEOF_CFGDESC, ret); goto errout; } @@ -496,7 +496,7 @@ int usbhost_enumerate(FAR struct usbhost_hubport_s *hport, ret = DRVR_CTRLIN(hport->drvr, hport->ep0, ctrlreq, buffer); if (ret < 0) { - udbg("ERROR: Failed to get configuration descriptor, length=%d: %d\n", + uerr("ERROR: Failed to get configuration descriptor, length=%d: %d\n", cfglen, ret); goto errout; } @@ -512,7 +512,7 @@ int usbhost_enumerate(FAR struct usbhost_hubport_s *hport, ret = DRVR_CTRLOUT(hport->drvr, hport->ep0, ctrlreq, NULL); if (ret < 0) { - udbg("ERROR: Failed to set configuration: %d\n", ret); + uerr("ERROR: Failed to set configuration: %d\n", ret); goto errout; } @@ -530,7 +530,7 @@ int usbhost_enumerate(FAR struct usbhost_hubport_s *hport, ret = usbhost_configdesc(buffer, cfglen, &id); if (ret < 0) { - udbg("ERROR: usbhost_configdesc failed: %d\n", ret); + uerr("ERROR: usbhost_configdesc failed: %d\n", ret); goto errout; } } @@ -547,7 +547,7 @@ int usbhost_enumerate(FAR struct usbhost_hubport_s *hport, ret = usbhost_classbind(hport, buffer, cfglen, &id, devclass); if (ret < 0) { - udbg("ERROR: usbhost_classbind failed %d\n", ret); + uerr("ERROR: usbhost_classbind failed %d\n", ret); } errout: diff --git a/drivers/usbhost/usbhost_hidkbd.c b/drivers/usbhost/usbhost_hidkbd.c index 5d2a54e48a..910438680c 100644 --- a/drivers/usbhost/usbhost_hidkbd.c +++ b/drivers/usbhost/usbhost_hidkbd.c @@ -176,8 +176,8 @@ */ #ifndef CONFIG_DEBUG_INPUT -# undef idbg -# define idbg udbg +# undef ierr +# define ierr uerr # undef illerr # define illerr ullerr # undef iinfo @@ -1082,12 +1082,12 @@ static int usbhost_kbdpoll(int argc, char *argv[]) if (ret < 0) { nerrors++; - udbg("ERROR: GETREPORT/INPUT, DRVR_CTRLIN returned: %d/%d\n", + uerr("ERROR: GETREPORT/INPUT, DRVR_CTRLIN returned: %d/%d\n", ret, nerrors); if (nerrors > 200) { - udbg("Too many errors... aborting: %d\n", nerrors); + uerr("Too many errors... aborting: %d\n", nerrors); break; } } @@ -1227,7 +1227,7 @@ static int usbhost_kbdpoll(int argc, char *argv[]) npolls++; if ((npolls & 31) == 0) { - udbg("Still polling: %d\n", npolls); + uerr("Still polling: %d\n", npolls); } #endif /* Wait for the required amount (or until a signal is received). We @@ -1267,7 +1267,7 @@ static int usbhost_kbdpoll(int argc, char *argv[]) * of the file descriptors are closed. */ - udbg("Keyboard removed, polling halted\n"); + uerr("Keyboard removed, polling halted\n"); flags = enter_critical_section(); priv->polling = false; @@ -1537,7 +1537,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv, ret = DRVR_EPALLOC(hport->drvr, &epindesc, &priv->epin); if (ret < 0) { - udbg("ERROR: Failed to allocate interrupt IN endpoint\n"); + uerr("ERROR: Failed to allocate interrupt IN endpoint\n"); return ret; } @@ -1551,7 +1551,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv, ret = DRVR_EPALLOC(hport->drvr, &epoutdesc, &priv->epout); if (ret < 0) { - udbg("ERROR: Failed to allocate interrupt OUT endpoint\n"); + uerr("ERROR: Failed to allocate interrupt OUT endpoint\n"); (void)DRVR_EPFREE(hport->drvr, priv->epin); return ret; } @@ -1590,7 +1590,7 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv) ret = usbhost_tdalloc(priv); if (ret < 0) { - udbg("ERROR: Failed to allocate transfer buffer\n"); + uerr("ERROR: Failed to allocate transfer buffer\n"); return ret; } @@ -1932,7 +1932,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, ret = usbhost_cfgdesc(priv, configdesc, desclen); if (ret < 0) { - udbg("usbhost_cfgdesc() failed: %d\n", ret); + uerr("usbhost_cfgdesc() failed: %d\n", ret); } else { @@ -1941,7 +1941,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, ret = usbhost_devinit(priv); if (ret < 0) { - udbg("usbhost_devinit() failed: %d\n", ret); + uerr("usbhost_devinit() failed: %d\n", ret); } } diff --git a/drivers/usbhost/usbhost_hidmouse.c b/drivers/usbhost/usbhost_hidmouse.c index 86536dba22..50decb0e85 100644 --- a/drivers/usbhost/usbhost_hidmouse.c +++ b/drivers/usbhost/usbhost_hidmouse.c @@ -197,8 +197,8 @@ */ #ifndef CONFIG_DEBUG_INPUT -# undef idbg -# define idbg udbg +# undef ierr +# define ierr uerr # undef illerr # define illerr ullerr # undef iinfo @@ -1101,14 +1101,14 @@ static int usbhost_mouse_poll(int argc, char *argv[]) * long time). */ - udbg("ERROR: DRVR_TRANSFER returned: %d/%u\n", + uerr("ERROR: DRVR_TRANSFER returned: %d/%u\n", (int)nbytes, nerrors); if (nbytes != -EAGAIN) { if (++nerrors > 200) { - udbg("Too many errors... aborting: %d\n", nerrors); + uerr("Too many errors... aborting: %d\n", nerrors); ret = (int)nbytes; break; } @@ -1212,7 +1212,7 @@ static int usbhost_mouse_poll(int argc, char *argv[]) npolls++; if ((npolls & 31) == 0) { - udbg("Still polling: %d\n", npolls); + uerr("Still polling: %d\n", npolls); } #endif } @@ -1233,7 +1233,7 @@ static int usbhost_mouse_poll(int argc, char *argv[]) * of the file descriptors are closed. */ - udbg("Mouse removed, polling halted\n"); + uerr("Mouse removed, polling halted\n"); flags = enter_critical_section(); priv->polling = false; @@ -1389,7 +1389,7 @@ static int usbhost_waitsample(FAR struct usbhost_state_s *priv, * the failure now. */ - idbg("sem_wait: %d\n", errno); + ierr("sem_wait: %d\n", errno); DEBUGASSERT(errno == EINTR); ret = -EINTR; goto errout; @@ -1624,7 +1624,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv, ret = DRVR_EPALLOC(hport->drvr, &epindesc, &priv->epin); if (ret < 0) { - udbg("ERROR: Failed to allocate interrupt IN endpoint\n"); + uerr("ERROR: Failed to allocate interrupt IN endpoint\n"); return ret; } @@ -1661,7 +1661,7 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv) ret = usbhost_tdalloc(priv); if (ret < 0) { - udbg("ERROR: Failed to allocate transfer buffer\n"); + uerr("ERROR: Failed to allocate transfer buffer\n"); return ret; } @@ -2002,7 +2002,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, ret = usbhost_cfgdesc(priv, configdesc, desclen); if (ret < 0) { - udbg("usbhost_cfgdesc() failed: %d\n", ret); + uerr("usbhost_cfgdesc() failed: %d\n", ret); } else { @@ -2011,7 +2011,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, ret = usbhost_devinit(priv); if (ret < 0) { - udbg("usbhost_devinit() failed: %d\n", ret); + uerr("usbhost_devinit() failed: %d\n", ret); } } @@ -2345,7 +2345,7 @@ static ssize_t usbhost_read(FAR struct file *filep, FAR char *buffer, size_t len { /* We might have been awakened by a signal */ - idbg("usbhost_waitsample: %d\n", ret); + ierr("usbhost_waitsample: %d\n", ret); goto errout; } } diff --git a/drivers/usbhost/usbhost_hub.c b/drivers/usbhost/usbhost_hub.c index 4bec1b4973..516b123094 100644 --- a/drivers/usbhost/usbhost_hub.c +++ b/drivers/usbhost/usbhost_hub.c @@ -286,7 +286,7 @@ static int usbhost_hport_activate(FAR struct usbhost_hubport_s *hport) ret = DRVR_EPALLOC(hport->drvr, &epdesc, &hport->ep0); if (ret < 0) { - udbg("ERROR: Failed to allocate ep0: %d\n", ret); + uerr("ERROR: Failed to allocate ep0: %d\n", ret); } return ret; @@ -474,7 +474,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_class_s *hubclass, ret = DRVR_EPALLOC(hport->drvr, &intindesc, &priv->intin); if (ret < 0) { - udbg("ERROR: Failed to allocate Interrupt IN endpoint: %d\n", ret); + uerr("ERROR: Failed to allocate Interrupt IN endpoint: %d\n", ret); (void)DRVR_EPFREE(hport->drvr, priv->intin); return ret; } @@ -535,7 +535,7 @@ static inline int usbhost_hubdesc(FAR struct usbhost_class_s *hubclass) ret = DRVR_CTRLIN(hport->drvr, hport->ep0, ctrlreq, (FAR uint8_t *)&hubdesc); if (ret < 0) { - udbg("ERROR: Failed to read hub descriptor: %d\n", ret); + uerr("ERROR: Failed to read hub descriptor: %d\n", ret); return ret; } @@ -642,7 +642,7 @@ static int usbhost_hubpwr(FAR struct usbhost_hubpriv_s *priv, ret = DRVR_CTRLOUT(hport->drvr, hport->ep0, ctrlreq, NULL); if (ret < 0) { - udbg("ERROR: Failed to power %s port %d: %d\n", + uerr("ERROR: Failed to power %s port %d: %d\n", on ? "UP" : "DOWN", port, ret); return ret; } @@ -738,7 +738,7 @@ static void usbhost_hub_event(FAR void *arg) (FAR uint8_t *)&portstatus); if (ret < 0) { - udbg("ERROR: Failed to read port %d status: %d\n", port, ret); + uerr("ERROR: Failed to read port %d status: %d\n", port, ret); continue; } @@ -762,7 +762,7 @@ static void usbhost_hub_event(FAR void *arg) ret = DRVR_CTRLOUT(hport->drvr, hport->ep0, ctrlreq, NULL); if (ret < 0) { - udbg("ERROR: Failed to clear port %d change mask %04x: %d\n", + uerr("ERROR: Failed to clear port %d change mask %04x: %d\n", port, mask, ret); } @@ -799,7 +799,7 @@ static void usbhost_hub_event(FAR void *arg) (FAR uint8_t *)&portstatus); if (ret < 0) { - udbg("ERROR: Failed to get port %d status: %d\n", port, ret); + uerr("ERROR: Failed to get port %d status: %d\n", port, ret); break; } @@ -839,7 +839,7 @@ static void usbhost_hub_event(FAR void *arg) if (ret < 0 || debouncetime >= 1500) { - udbg("ERROR: Failed to debounce port %d: %d\n", port, ret); + uerr("ERROR: Failed to debounce port %d: %d\n", port, ret); continue; } @@ -858,7 +858,7 @@ static void usbhost_hub_event(FAR void *arg) ret = DRVR_CTRLOUT(hport->drvr, hport->ep0, ctrlreq, NULL); if (ret < 0) { - udbg("ERROR: Failed to reset port %d: %d\n", port, ret); + uerr("ERROR: Failed to reset port %d: %d\n", port, ret); continue; } @@ -874,7 +874,7 @@ static void usbhost_hub_event(FAR void *arg) (FAR uint8_t *)&portstatus); if (ret < 0) { - udbg("ERROR: Failed to get port %d status: %d\n", port, ret); + uerr("ERROR: Failed to get port %d status: %d\n", port, ret); continue; } @@ -917,7 +917,7 @@ static void usbhost_hub_event(FAR void *arg) ret = usbhost_hport_activate(connport); if (ret < 0) { - udbg("ERROR: usbhost_hport_activate failed: %d\n", ret); + uerr("ERROR: usbhost_hport_activate failed: %d\n", ret); } else { @@ -926,14 +926,14 @@ static void usbhost_hub_event(FAR void *arg) ret = DRVR_CONNECT(connport->drvr, connport, true); if (ret < 0) { - udbg("ERROR: DRVR_CONNECT failed: %d\n", ret); + uerr("ERROR: DRVR_CONNECT failed: %d\n", ret); usbhost_hport_deactivate(connport); } } } else { - udbg("ERROR: Failed to enable port %d\n", port); + uerr("ERROR: Failed to enable port %d\n", port); continue; } } @@ -961,7 +961,7 @@ static void usbhost_hub_event(FAR void *arg) } else if (change) { - udbg("WARNING: status %04x change %04x not handled\n", status, change); + uerr("WARNING: status %04x change %04x not handled\n", status, change); } } @@ -971,7 +971,7 @@ static void usbhost_hub_event(FAR void *arg) { /* Hub status changed */ - udbg("WARNING: Hub status changed, not handled\n"); + uerr("WARNING: Hub status changed, not handled\n"); } /* The preceding sequence of events may take a significant amount of @@ -990,7 +990,7 @@ static void usbhost_hub_event(FAR void *arg) INTIN_BUFSIZE, usbhost_callback, hubclass); if (ret < 0) { - udbg("ERROR: Failed to queue interrupt endpoint: %d\n", ret); + uerr("ERROR: Failed to queue interrupt endpoint: %d\n", ret); } } @@ -1287,7 +1287,7 @@ static FAR struct usbhost_class_s * ret = DRVR_ALLOC(hport->drvr, (FAR uint8_t **)&priv->ctrlreq, &maxlen); if (ret < 0) { - udbg("ERROR: DRVR_ALLOC failed: %d\n", ret); + uerr("ERROR: DRVR_ALLOC failed: %d\n", ret); goto errout_with_hub; } @@ -1296,7 +1296,7 @@ static FAR struct usbhost_class_s * ret = DRVR_IOALLOC(hport->drvr, &priv->buffer, INTIN_BUFSIZE); if (ret < 0) { - udbg("ERROR: DRVR_IOALLOC failed: %d\n", ret); + uerr("ERROR: DRVR_IOALLOC failed: %d\n", ret); goto errout_with_ctrlreq; } @@ -1385,7 +1385,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *hubclass, ret = usbhost_cfgdesc(hubclass, configdesc, desclen); if (ret < 0) { - udbg("ERROR: Failed to parse config descriptor: %d\n", ret); + uerr("ERROR: Failed to parse config descriptor: %d\n", ret); return ret; } @@ -1399,7 +1399,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *hubclass, if (priv->nports > USBHUB_MAX_PORTS) { - udbg("ERROR: too many downstream ports: %d\n", priv->nports); + uerr("ERROR: too many downstream ports: %d\n", priv->nports); return -ENOSYS; } @@ -1408,7 +1408,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *hubclass, ret = usbhost_hubpwr(priv, hport, true); if (ret < 0) { - udbg("ERROR: usbhost_hubpwr failed: %d\n", ret); + uerr("ERROR: usbhost_hubpwr failed: %d\n", ret); return ret; } @@ -1418,7 +1418,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *hubclass, INTIN_BUFSIZE, usbhost_callback, hubclass); if (ret < 0) { - udbg("ERROR: DRVR_ASYNCH failed: %d\n", ret); + uerr("ERROR: DRVR_ASYNCH failed: %d\n", ret); (void)usbhost_hubpwr(priv, hport, false); } diff --git a/drivers/usbhost/usbhost_skeleton.c b/drivers/usbhost/usbhost_skeleton.c index ae03f341af..29fe5172a8 100644 --- a/drivers/usbhost/usbhost_skeleton.c +++ b/drivers/usbhost/usbhost_skeleton.c @@ -588,14 +588,14 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv, ret = DRVR_EPALLOC(hport->drvr, &boutdesc, &priv->epout); if (ret < 0) { - udbg("ERROR: Failed to allocate Bulk OUT endpoint\n"); + uerr("ERROR: Failed to allocate Bulk OUT endpoint\n"); return ret; } ret = DRVR_EPALLOC(hport->drvr, &bindesc, &priv->epin); if (ret < 0) { - udbg("ERROR: Failed to allocate Bulk IN endpoint\n"); + uerr("ERROR: Failed to allocate Bulk IN endpoint\n"); (void)DRVR_EPFREE(hport->drvr, priv->epout); return ret; } @@ -955,7 +955,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, ret = usbhost_cfgdesc(priv, configdesc, desclen); if (ret < 0) { - udbg("usbhost_cfgdesc() failed: %d\n", ret); + uerr("usbhost_cfgdesc() failed: %d\n", ret); } else { @@ -964,7 +964,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, ret = usbhost_devinit(priv); if (ret < 0) { - udbg("usbhost_devinit() failed: %d\n", ret); + uerr("usbhost_devinit() failed: %d\n", ret); } } diff --git a/drivers/usbhost/usbhost_storage.c b/drivers/usbhost/usbhost_storage.c index e8075c77a6..668daa5595 100644 --- a/drivers/usbhost/usbhost_storage.c +++ b/drivers/usbhost/usbhost_storage.c @@ -722,7 +722,7 @@ static inline int usbhost_testunitready(FAR struct usbhost_state_s *priv) cbw = usbhost_cbwalloc(priv); if (!cbw) { - udbg("ERROR: Failed to create CBW\n"); + uerr("ERROR: Failed to create CBW\n"); return -ENOMEM; } @@ -760,7 +760,7 @@ static inline int usbhost_requestsense(FAR struct usbhost_state_s *priv) cbw = usbhost_cbwalloc(priv); if (!cbw) { - udbg("ERROR: Failed to create CBW\n"); + uerr("ERROR: Failed to create CBW\n"); return -ENOMEM; } @@ -806,7 +806,7 @@ static inline int usbhost_readcapacity(FAR struct usbhost_state_s *priv) cbw = usbhost_cbwalloc(priv); if (!cbw) { - udbg("ERROR: Failed to create CBW\n"); + uerr("ERROR: Failed to create CBW\n"); return -ENOMEM; } @@ -857,7 +857,7 @@ static inline int usbhost_inquiry(FAR struct usbhost_state_s *priv) cbw = usbhost_cbwalloc(priv); if (!cbw) { - udbg("ERROR: Failed to create CBW\n"); + uerr("ERROR: Failed to create CBW\n"); return -ENOMEM; } @@ -1173,14 +1173,14 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv, ret = DRVR_EPALLOC(hport->drvr, &boutdesc, &priv->bulkout); if (ret < 0) { - udbg("ERROR: Failed to allocate Bulk OUT endpoint\n"); + uerr("ERROR: Failed to allocate Bulk OUT endpoint\n"); return ret; } ret = DRVR_EPALLOC(hport->drvr, &bindesc, &priv->bulkin); if (ret < 0) { - udbg("ERROR: Failed to allocate Bulk IN endpoint\n"); + uerr("ERROR: Failed to allocate Bulk IN endpoint\n"); (void)DRVR_EPFREE(hport->drvr, priv->bulkout); return ret; } @@ -1221,7 +1221,7 @@ static inline int usbhost_initvolume(FAR struct usbhost_state_s *priv) ret = usbhost_talloc(priv); if (ret < 0) { - udbg("ERROR: Failed to allocate transfer buffer\n"); + uerr("ERROR: Failed to allocate transfer buffer\n"); return ret; } @@ -1281,7 +1281,7 @@ static inline int usbhost_initvolume(FAR struct usbhost_state_s *priv) if (ret < 0 && ret != -EPERM) { - udbg("ERROR: DRVR_TRANSFER returned: %d\n", ret); + uerr("ERROR: DRVR_TRANSFER returned: %d\n", ret); break; } } @@ -1290,7 +1290,7 @@ static inline int usbhost_initvolume(FAR struct usbhost_state_s *priv) if (retries >= USBHOST_MAX_RETRIES) { - udbg("ERROR: Timeout!\n"); + uerr("ERROR: Timeout!\n"); ret = -ETIMEDOUT; } @@ -1307,7 +1307,7 @@ static inline int usbhost_initvolume(FAR struct usbhost_state_s *priv) csw = (FAR struct usbmsc_csw_s *)priv->tbuffer; if (csw->status != 0) { - udbg("ERROR: CSW status error: %d\n", csw->status); + uerr("ERROR: CSW status error: %d\n", csw->status); ret = -ENODEV; } } @@ -1328,7 +1328,7 @@ static inline int usbhost_initvolume(FAR struct usbhost_state_s *priv) csw = (FAR struct usbmsc_csw_s *)priv->tbuffer; if (csw->status != 0) { - udbg("ERROR: CSW status error: %d\n", csw->status); + uerr("ERROR: CSW status error: %d\n", csw->status); ret = -ENODEV; } } @@ -1772,7 +1772,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, ret = usbhost_cfgdesc(priv, configdesc, desclen); if (ret < 0) { - udbg("usbhost_cfgdesc() failed: %d\n", ret); + uerr("usbhost_cfgdesc() failed: %d\n", ret); } else { @@ -1781,7 +1781,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *usbclass, ret = usbhost_initvolume(priv); if (ret < 0) { - udbg("usbhost_initvolume() failed: %d\n", ret); + uerr("usbhost_initvolume() failed: %d\n", ret); } } @@ -2051,7 +2051,7 @@ static ssize_t usbhost_read(FAR struct inode *inode, unsigned char *buffer, csw = (FAR struct usbmsc_csw_s *)priv->tbuffer; if (csw->status != 0) { - udbg("ERROR: CSW status error: %d\n", csw->status); + uerr("ERROR: CSW status error: %d\n", csw->status); nbytes = -ENODEV; } } @@ -2150,7 +2150,7 @@ static ssize_t usbhost_write(FAR struct inode *inode, const unsigned char *buffe csw = (FAR struct usbmsc_csw_s *)priv->tbuffer; if (csw->status != 0) { - udbg("ERROR: CSW status error: %d\n", csw->status); + uerr("ERROR: CSW status error: %d\n", csw->status); nbytes = -ENODEV; } } diff --git a/drivers/video/ov2640.c b/drivers/video/ov2640.c index 112d3201e3..28b3c4ebc7 100644 --- a/drivers/video/ov2640.c +++ b/drivers/video/ov2640.c @@ -696,7 +696,7 @@ static int ov2640_putreg(FAR struct i2c_master_s *i2c, uint8_t regaddr, int ret; #ifdef CONFIG_OV2640_REGDEBUG - dbg("%02x <- %02x\n", regaddr, regval); + err("%02x <- %02x\n", regaddr, regval); #endif /* Set up for the transfer */ @@ -715,7 +715,7 @@ static int ov2640_putreg(FAR struct i2c_master_s *i2c, uint8_t regaddr, ret = i2c_write(i2c, &config, buffer, 2); if (ret < 0) { - gdbg("ERROR: i2c_write failed: %d\n", ret); + gerr("ERROR: i2c_write failed: %d\n", ret); return ret; } @@ -756,7 +756,7 @@ static uint8_t ov2640_getreg(FAR struct i2c_master_s *i2c, uint8_t regaddr) ret = i2c_write(i2c, &config, ®addr, 1); if (ret < 0) { - gdbg("ERROR: i2c_write failed: %d\n", ret); + gerr("ERROR: i2c_write failed: %d\n", ret); return 0; } @@ -765,13 +765,13 @@ static uint8_t ov2640_getreg(FAR struct i2c_master_s *i2c, uint8_t regaddr) ret = i2c_read(i2c, &config, ®val, 1); if (ret < 0) { - gdbg("ERROR: i2c_read failed: %d\n", ret); + gerr("ERROR: i2c_read failed: %d\n", ret); return 0; } #ifdef CONFIG_OV2640_REGDEBUG else { - dbg("%02x -> %02x\n", regaddr, regval); + err("%02x -> %02x\n", regaddr, regval); } #endif @@ -807,7 +807,7 @@ static int ov2640_putreglist(FAR struct i2c_master_s *i2c, ret = ov2640_putreg(i2c, entry->regaddr, entry->regval); if (ret < 0) { - gdbg("ERROR: ov2640_putreg failed: %d\n", ret); + gerr("ERROR: ov2640_putreg failed: %d\n", ret); return ret; } } @@ -845,7 +845,7 @@ static int ovr2640_chipid(FAR struct i2c_master_s *i2c) ret = ov2640_putreg(i2c, 0xff, 0x01); /* Select the sensor address bank */ if (ret < 0) { - gdbg("ERROR: ov2640_putreg failed: %d\n", ret); + gerr("ERROR: ov2640_putreg failed: %d\n", ret); return ret; } @@ -859,7 +859,7 @@ static int ovr2640_chipid(FAR struct i2c_master_s *i2c) if (pidl != OVR2640_PRODUCT_IDL || pidh != OVR2640_PRODUCT_IDH) { - gdbg("ERROR: Unsupported PID=%02x$02x MID=%02x%02x\n", + gerr("ERROR: Unsupported PID=%02x$02x MID=%02x%02x\n", pidh, pidl, midh, midl); return -ENOSYS; } @@ -892,7 +892,7 @@ static int ov2640_reset(FAR struct i2c_master_s *i2c) ret = ov2640_putreglist(i2c, g_ov2640_reset, OV2640_RESET_NENTRIES); if (ret < 0) { - gdbg("ERROR: ov2640_putreglist failed: %d\n", ret); + gerr("ERROR: ov2640_putreglist failed: %d\n", ret); return ret; } @@ -927,7 +927,7 @@ int ov2640_initialize(FAR struct i2c_master_s *i2c) ret = ov2640_reset(i2c); if (ret < 0) { - gdbg("ERROR: ov2640_reset failed: %d\n", ret); + gerr("ERROR: ov2640_reset failed: %d\n", ret); goto errout; } @@ -936,7 +936,7 @@ int ov2640_initialize(FAR struct i2c_master_s *i2c) ret = ovr2640_chipid(i2c); if (ret < 0) { - gdbg("ERROR: ovr2640_chipid failed: %d\n", ret); + gerr("ERROR: ovr2640_chipid failed: %d\n", ret); goto errout; } @@ -948,35 +948,35 @@ int ov2640_initialize(FAR struct i2c_master_s *i2c) ret = ov2640_putreglist(i2c, g_ov2640_jpeg_init, OV2640_JPEG_INIT_NENTRIES); if (ret < 0) { - gdbg("ERROR: ov2640_putreglist failed: %d\n", ret); + gerr("ERROR: ov2640_putreglist failed: %d\n", ret); goto errout; } ret = ov2640_putreglist(i2c, g_ov2640_yuv422, OV2640_YUV422_NENTRIES); if (ret < 0) { - gdbg("ERROR: ov2640_putreglist failed: %d\n", ret); + gerr("ERROR: ov2640_putreglist failed: %d\n", ret); goto errout; } ret = ov2640_putreglist(i2c, g_ov2640_jpeg, OV2640_JPEG_NENTRIES); if (ret < 0) { - gdbg("ERROR: ov2640_putreglist failed: %d\n", ret); + gerr("ERROR: ov2640_putreglist failed: %d\n", ret); goto errout; } ret = ov2640_putreg(i2c, 0xff, 0x01); if (ret < 0) { - gdbg("ERROR: ov2640_putreg failed: %d\n", ret); + gerr("ERROR: ov2640_putreg failed: %d\n", ret); goto errout; } ret = ov2640_putreg(i2c, 0x15, 0x00); if (ret < 0) { - gdbg("ERROR: ov2640_putreg failed: %d\n", ret); + gerr("ERROR: ov2640_putreg failed: %d\n", ret); goto errout; } @@ -1018,7 +1018,7 @@ int ov2640_initialize(FAR struct i2c_master_s *i2c) if (ret < 0) { - gdbg("ERROR: ov2640_putreglist failed: %d\n", ret); + gerr("ERROR: ov2640_putreglist failed: %d\n", ret); goto errout; } @@ -1030,7 +1030,7 @@ int ov2640_initialize(FAR struct i2c_master_s *i2c) OV2640_INITIALREGS_NENTRIES); if (ret < 0) { - gdbg("ERROR: ov2640_putreglist failed: %d\n", ret); + gerr("ERROR: ov2640_putreglist failed: %d\n", ret); goto errout; } @@ -1040,7 +1040,7 @@ int ov2640_initialize(FAR struct i2c_master_s *i2c) OV2640_RESOLUTION_COMMON_NENTRIES); if (ret < 0) { - gdbg("ERROR: ov2640_putreglist failed: %d\n", ret); + gerr("ERROR: ov2640_putreglist failed: %d\n", ret); goto errout; } @@ -1082,7 +1082,7 @@ int ov2640_initialize(FAR struct i2c_master_s *i2c) if (ret < 0) { - gdbg("ERROR: ov2640_putreglist failed: %d\n", ret); + gerr("ERROR: ov2640_putreglist failed: %d\n", ret); goto errout; } @@ -1092,7 +1092,7 @@ int ov2640_initialize(FAR struct i2c_master_s *i2c) OV2640_COLORFMT_COMMON_NENTRIES); if (ret < 0) { - gdbg("ERROR: ov2640_putreglist failed: %d\n", ret); + gerr("ERROR: ov2640_putreglist failed: %d\n", ret); goto errout; } @@ -1110,7 +1110,7 @@ int ov2640_initialize(FAR struct i2c_master_s *i2c) if (ret < 0) { - gdbg("ERROR: ov2640_putreglist failed: %d\n", ret); + gerr("ERROR: ov2640_putreglist failed: %d\n", ret); goto errout; } @@ -1119,7 +1119,7 @@ int ov2640_initialize(FAR struct i2c_master_s *i2c) return OK; errout: - gdbg("ERROR: Failed to initialize the OV2640: %d\n", ret); + gerr("ERROR: Failed to initialize the OV2640: %d\n", ret); (void)ov2640_reset(i2c); return ret; } diff --git a/drivers/wireless/cc3000/cc3000.c b/drivers/wireless/cc3000/cc3000.c index dd7cc44bd0..d73680f320 100644 --- a/drivers/wireless/cc3000/cc3000.c +++ b/drivers/wireless/cc3000/cc3000.c @@ -251,7 +251,7 @@ static inline void cc3000_devgive(FAR struct cc3000_dev_s *priv) static inline void cc3000_configspi(FAR struct spi_dev_s *spi) { - ndbg("Mode: %d Bits: 8 Frequency: %d\n", + nerr("Mode: %d Bits: 8 Frequency: %d\n", CONFIG_CC3000_SPI_MODE, CONFIG_CC3000_SPI_FREQUENCY); SPI_SETMODE(spi, CONFIG_CC3000_SPI_MODE); @@ -1071,7 +1071,7 @@ static ssize_t cc3000_read(FAR struct file *filep, FAR char *buffer, size_t len) if (len < priv->rx_buffer_max_len) { - ndbg("Unsupported read size: %d\n", len); + nerr("Unsupported read size: %d\n", len); nread = -ENOSYS; goto errout_with_sem; } @@ -1531,7 +1531,7 @@ int cc3000_register(FAR struct spi_dev_s *spi, priv = (FAR struct cc3000_dev_s *)kmm_malloc(sizeof(struct cc3000_dev_s)); if (!priv) { - ndbg("kmm_malloc(%d) failed\n", sizeof(struct cc3000_dev_s)); + nerr("kmm_malloc(%d) failed\n", sizeof(struct cc3000_dev_s)); return -ENOMEM; } #endif @@ -1565,7 +1565,7 @@ int cc3000_register(FAR struct spi_dev_s *spi, ret = config->irq_attach(config, cc3000_interrupt); if (ret < 0) { - ndbg("Failed to attach interrupt\n"); + nerr("Failed to attach interrupt\n"); goto errout_with_priv; } @@ -1577,7 +1577,7 @@ int cc3000_register(FAR struct spi_dev_s *spi, ret = register_driver(drvname, &cc3000_fops, 0666, priv); if (ret < 0) { - ndbg("register_driver() failed: %d\n", ret); + nerr("register_driver() failed: %d\n", ret); goto errout_with_priv; } diff --git a/drivers/wireless/cc3000/cc3000drv.c b/drivers/wireless/cc3000/cc3000drv.c index 3b5cac58d5..44547d4889 100644 --- a/drivers/wireless/cc3000/cc3000drv.c +++ b/drivers/wireless/cc3000/cc3000drv.c @@ -65,7 +65,7 @@ #undef SPI_VERBOSE /* Define to enable verbose debug */ #ifdef SPI_DEBUG -# define spidbg llerr +# define spierr llerr # ifdef SPI_VERBOSE # define spiinfo llerr # else @@ -73,7 +73,7 @@ # endif #else # undef SPI_VERBOSE -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/drivers/wireless/cc3000/socket.c b/drivers/wireless/cc3000/socket.c index a44b9b0bdb..9ca0c2105f 100644 --- a/drivers/wireless/cc3000/socket.c +++ b/drivers/wireless/cc3000/socket.c @@ -267,7 +267,7 @@ int cc3000_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) if (setsockopt(sockfd, CC3000_SOL_SOCKET, CC3000_SOCKOPT_ACCEPT_NONBLOCK, &non_blocking, sizeof(non_blocking)) < 0) { - ndbg("setsockopt failure %d\n", errno); + nerr("setsockopt failure %d\n", errno); return -errno; } @@ -282,7 +282,7 @@ int cc3000_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) if (setsockopt(sockfd, CC3000_SOL_SOCKET, CC3000_SOCKOPT_ACCEPT_NONBLOCK, &nonBlocking, sizeof(nonBlocking)) < 0) { - ndbg("setsockopt failure %d\n", errno); + nerr("setsockopt failure %d\n", errno); return -errno; } diff --git a/drivers/wireless/ieee802154/mrf24j40.c b/drivers/wireless/ieee802154/mrf24j40.c index 35a7ecbbe8..8658ad9a37 100644 --- a/drivers/wireless/ieee802154/mrf24j40.c +++ b/drivers/wireless/ieee802154/mrf24j40.c @@ -303,7 +303,7 @@ static uint8_t mrf24j40_getreg(FAR struct spi_dev_s *spi, uint32_t addr) SPI_SELECT (spi, SPIDEV_IEEE802154, false); mrf24j40_unlock(spi); - /*dbg("r[%04X]=%02X\n",addr,rx[len-1]);*/ + /*err("r[%04X]=%02X\n",addr,rx[len-1]);*/ return rx[len-1]; } @@ -443,7 +443,7 @@ static int mrf24j40_setrxmode(FAR struct mrf24j40_dev_s *dev, int mode) mrf24j40_setreg(dev->spi, MRF24J40_RXMCR, reg); dev->rxmode = mode; - dbg("%u\n",(unsigned)mode); + err("%u\n",(unsigned)mode); return OK; } @@ -470,7 +470,7 @@ static int mrf24j40_setchannel(FAR struct ieee802154_dev_s *ieee, if (chan<11 || chan>26) { - dbg("Invalid chan: %d\n",chan); + err("Invalid chan: %d\n",chan); return -EINVAL; } @@ -485,7 +485,7 @@ static int mrf24j40_setchannel(FAR struct ieee802154_dev_s *ieee, mrf24j40_resetrfsm(dev); dev->channel = chan; - //dbg("%u\n",(unsigned)chan); + //err("%u\n",(unsigned)chan); return OK; } @@ -525,7 +525,7 @@ static int mrf24j40_setpanid(FAR struct ieee802154_dev_s *ieee, mrf24j40_setreg(dev->spi, MRF24J40_PANIDL, (uint8_t)(panid&0xFF)); dev->panid = panid; - dbg("%04X\n",(unsigned)panid); + err("%04X\n",(unsigned)panid); return OK; } @@ -567,7 +567,7 @@ static int mrf24j40_setsaddr(FAR struct ieee802154_dev_s *ieee, mrf24j40_setreg(dev->spi, MRF24J40_SADRL, (uint8_t)(saddr&0xFF)); dev->saddr = saddr; - dbg("%04X\n",(unsigned)saddr); + err("%04X\n",(unsigned)saddr); return OK; } @@ -897,7 +897,7 @@ static int mrf24j40_regdump(FAR struct mrf24j40_dev_s *dev) char buf[4+16*3+2+1]; int len=0; - dbg("Short regs:\n"); + err("Short regs:\n"); for (i = 0; i < 0x40; i++) { @@ -910,11 +910,11 @@ static int mrf24j40_regdump(FAR struct mrf24j40_dev_s *dev) if ((i & 15) == 15) { sprintf(buf+len, "\n"); - dbg("%s",buf); + err("%s",buf); } } - dbg("Long regs:\n"); + err("Long regs:\n"); for (i=0x80000200;i<0x80000250;i++) { if ((i&15)==0) @@ -926,7 +926,7 @@ static int mrf24j40_regdump(FAR struct mrf24j40_dev_s *dev) if ((i & 15) == 15) { sprintf(buf+len, "\n"); - dbg("%s",buf); + err("%s",buf); } } @@ -952,7 +952,7 @@ static int mrf24j40_ioctl(FAR struct ieee802154_dev_s *ieee, int cmd, return mrf24j40_regdump(dev); case 1001: dev->paenabled = (uint8_t)arg; - dbg("PA %sabled\n",arg?"en":"dis"); + err("PA %sabled\n",arg?"en":"dis"); return OK; default: @@ -1043,7 +1043,7 @@ static int mrf24j40_transmit(FAR struct ieee802154_dev_s *ieee, FAR struct ieee8 fc1 = packet->data[0]; fc2 = packet->data[1]; - // dbg("fc1 %02X fc2 %02X\n", fc1,fc2); + // err("fc1 %02X fc2 %02X\n", fc1,fc2); if ((fc2 & IEEE802154_FC2_DADDR) == IEEE802154_DADDR_SHORT) { @@ -1073,7 +1073,7 @@ static int mrf24j40_transmit(FAR struct ieee802154_dev_s *ieee, FAR struct ieee8 hlen += 8; /* Ext saddr */ } -// dbg("hlen %d\n",hlen); +// err("hlen %d\n",hlen); /* Header len, 0, TODO for security modes */ @@ -1131,7 +1131,7 @@ static void mrf24j40_irqwork_tx(FAR struct mrf24j40_dev_s *dev) * channel_busy = (tmp & (1 << CCAFAIL)); */ - //dbg("TXSTAT%02X!\n", txstat); + //err("TXSTAT%02X!\n", txstat); #warning TODO report errors UNUSED(txstat); @@ -1193,7 +1193,7 @@ static void mrf24j40_irqwork_rx(FAR struct mrf24j40_dev_s *dev) uint32_t index; uint8_t reg; - /*dbg("!\n");*/ + /*err("!\n");*/ /* Disable rx int */ @@ -1209,7 +1209,7 @@ static void mrf24j40_irqwork_rx(FAR struct mrf24j40_dev_s *dev) addr = 0x80000300; dev->ieee.rxbuf->len = mrf24j40_getreg(dev->spi, addr++); - /*dbg("len %3d\n", dev->ieee.rxbuf->len);*/ + /*err("len %3d\n", dev->ieee.rxbuf->len);*/ for (index = 0; index < dev->ieee.rxbuf->len; index++) { @@ -1264,7 +1264,7 @@ static void mrf24j40_irqworker(FAR void *arg) /* Read and store INTSTAT - this clears the register. */ intstat = mrf24j40_getreg(dev->spi, MRF24J40_INTSTAT); -// dbg("INT%02X\n", intstat); +// err("INT%02X\n", intstat); /* Do work according to the pending interrupts */ diff --git a/drivers/wireless/nrf24l01.c b/drivers/wireless/nrf24l01.c index 90f9cd3bae..582ac47ebf 100644 --- a/drivers/wireless/nrf24l01.c +++ b/drivers/wireless/nrf24l01.c @@ -551,7 +551,7 @@ static void nrf24l01_worker(FAR void *arg) bool ce = nrf24l01_chipenable(dev, false); - wdbg("RX_DR is set!\n"); + werr("RX_DR is set!\n"); /* Read and store all received payloads */ @@ -586,8 +586,8 @@ static void nrf24l01_worker(FAR void *arg) status = nrf24l01_readreg(dev, NRF24L01_FIFO_STATUS, &fifo_status, 1); - wdbg("FIFO_STATUS=%02x\n", fifo_status); - wdbg("STATUS=%02x\n", status); + werr("FIFO_STATUS=%02x\n", fifo_status); + werr("STATUS=%02x\n", status); } while (!(fifo_status | NRF24L01_RX_EMPTY)); @@ -736,7 +736,7 @@ static int dosend(FAR struct nrf24l01_dev_s *dev, FAR const uint8_t *data, size_ { /* Unexpected... */ - wdbg("No TX_DS nor MAX_RT bit set in STATUS reg!\n"); + werr("No TX_DS nor MAX_RT bit set in STATUS reg!\n"); result = -EIO; } @@ -1257,7 +1257,7 @@ int nrf24l01_register(FAR struct spi_dev_s *spi, FAR struct nrf24l01_config_s *c result = register_driver(DEV_NAME, &nrf24l01_fops, 0666, dev); if (result < 0) { - wdbg("register_driver() failed: %d\n", result); + werr("register_driver() failed: %d\n", result); nrf24l01_unregister(dev); } @@ -1658,7 +1658,7 @@ int nrf24l01_sendto(FAR struct nrf24l01_dev_s *dev, FAR const uint8_t *data, if ((dev->en_aa & 1) && (memcmp(destaddr, dev->pipe0addr, dev->addrlen))) { - wdbg("Change pipe #0 addr to dest addr\n"); + werr("Change pipe #0 addr to dest addr\n"); nrf24l01_writereg(dev, NRF24L01_RX_ADDR_P0, destaddr, NRF24L01_MAX_ADDR_LEN); pipeaddrchg = true; } @@ -1670,7 +1670,7 @@ int nrf24l01_sendto(FAR struct nrf24l01_dev_s *dev, FAR const uint8_t *data, /* Restore pipe #0 addr */ nrf24l01_writereg(dev, NRF24L01_RX_ADDR_P0, dev->pipe0addr, NRF24L01_MAX_ADDR_LEN); - wdbg("Pipe #0 default addr restored\n"); + werr("Pipe #0 default addr restored\n"); } nrf24l01_unlock(dev->spi); diff --git a/drivers/wireless/pn532.c b/drivers/wireless/pn532.c index 0f171950de..877c80fb9d 100644 --- a/drivers/wireless/pn532.c +++ b/drivers/wireless/pn532.c @@ -57,23 +57,23 @@ ****************************************************************************/ #ifdef CONFIG_WL_PN532_DEBUG -# define pn532dbg dbg +# define pn532err err #else # ifdef CONFIG_CPP_HAVE_VARARGS -# define pn532dbg(x...) +# define pn532err(x...) # else -# define pn532dbg (void) +# define pn532err (void) # endif #endif #ifdef CONFIG_WL_PN532_DEBUG_TX -# define tracetx dbgdumpbuffer +# define tracetx errdumpbuffer #else # define tracetx(x...) #endif #ifdef CONFIG_WL_PN532_DEBUG_RX -# define tracerx dbgdumpbuffer +# define tracerx errdumpbuffer #else # define tracerx(x...) #endif @@ -226,7 +226,7 @@ bool pn532_rx_frame_is_valid(struct pn532_frame *f, bool check_data) if (f->start_code != PN532_SOF) { - pn532dbg("Frame startcode 0x%X != 0x%X\n", PN532_SOF, f->start_code); + pn532err("Frame startcode 0x%X != 0x%X\n", PN532_SOF, f->start_code); return false; } @@ -238,7 +238,7 @@ bool pn532_rx_frame_is_valid(struct pn532_frame *f, bool check_data) chk = pn532_checksum(f->len); if (chk != f->lcs) { - pn532dbg("Frame data len checksum failed"); + pn532err("Frame data len checksum failed"); return false; } @@ -247,7 +247,7 @@ bool pn532_rx_frame_is_valid(struct pn532_frame *f, bool check_data) chk = pn532_data_checksum(&f->tfi, f->len); if (chk != f->data[f->len-1]) { - pn532dbg("Frame data checksum failed: calc=0x%X != 0x%X", chk, f->data[f->len-1]); + pn532err("Frame data checksum failed: calc=0x%X != 0x%X", chk, f->data[f->len-1]); return false; } } @@ -303,7 +303,7 @@ static int pn532_wait_rx_ready(struct pn532_dev_s *dev, int timeout) { if (--timeout == 0x00) { - pn532dbg("wait RX timeout!\n"); + pn532err("wait RX timeout!\n"); return -ETIMEDOUT; } @@ -414,7 +414,7 @@ int pn532_read_ack(struct pn532_dev_s *dev) } else { - pn532dbg("ACK NOK"); + pn532err("ACK NOK"); res = 0; } @@ -460,7 +460,7 @@ int pn532_write_frame(struct pn532_dev_s *dev, struct pn532_frame *f) { if (!pn532_read_ack(dev)) { - pn532dbg("command FAILED\n"); + pn532err("command FAILED\n"); res = -EIO; } } @@ -490,7 +490,7 @@ int pn532_read_frame(struct pn532_dev_s *dev, struct pn532_frame *f, int max_siz /* TODO: optimize frame integrity check... * pn532_data_checksum(&f.tfi, f->len); - * dbgdumpbuffer("RX Frame:", f, f->len+6); + * errdumpbuffer("RX Frame:", f, f->len+6); */ if (pn532_rx_frame_is_valid(f, true)) @@ -580,7 +580,7 @@ int pn532_get_fw_version(struct pn532_dev_s *dev, if (f->data[0] == PN532_COMMAND_GETFIRMWAREVERSION + 1) { fw = (struct pn_firmware_version*) &f->data[1]; - pn532dbg("FW: %d.%d on IC:0x%X (Features: 0x%X)\n", + pn532err("FW: %d.%d on IC:0x%X (Features: 0x%X)\n", fw->ver, fw->rev, fw->ic, fw->support); if (fv) { @@ -611,7 +611,7 @@ int pn532_write_gpio(struct pn532_dev_s *dev, uint8_t p3, uint8_t p7) { pn532_read(dev, cmd_buffer, 10); tracetx("Resp:", cmd_buffer, 10); - pn532dbg("TFI=%x, data0=%X", f->tfi, f->data[0]); + pn532err("TFI=%x, data0=%X", f->tfi, f->data[0]); if ((f->tfi == PN532_PN532TOHOST) && (f->data[0] == PN532_COMMAND_WRITEGPIO+1)) { res = OK; @@ -723,15 +723,15 @@ uint32_t pn532_read_passive_target_id(struct pn532_dev_s *dev, uint8_t baudrate) if (r->nbtg == 1) { - pn532dbg("Found %d card(s)\n", r->nbtg); + pn532err("Found %d card(s)\n", r->nbtg); /* now supports only type_a cards * if (poll_mode == PN532_POLL_MOD_106KBPS_A) */ struct pn_target_type_a *t = (struct pn_target_type_a *) &r->target_data; - pn532dbg("sens:0x%x sel:0x%x", t->sens_res, t->sel_res); - pn532dbg("idlen:0x%x ", t->nfcid_len); + pn532err("sens:0x%x sel:0x%x", t->sens_res, t->sel_res); + pn532err("idlen:0x%x ", t->nfcid_len); /* generate 32bit cid from id (could be longer) * HACK: Using only top 4 bytes. @@ -817,7 +817,7 @@ static int irq_handler(int irq, FAR void *context) (void) irq; (void) context; - /* pn532dbg("*IRQ*\n"); */ + /* pn532err("*IRQ*\n"); */ /* work_queue(HPWORK, &g_dev->irq_work, pn532_worker, dev, 0); */ return OK; @@ -1064,7 +1064,7 @@ static int _ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; default: - pn532dbg("Unrecognized cmd: %d\n", cmd); + pn532err("Unrecognized cmd: %d\n", cmd); ret = -EINVAL; break; } @@ -1105,7 +1105,7 @@ int pn532_register(FAR const char *devpath, FAR struct spi_dev_s *spi, dev = (FAR struct pn532_dev_s *)kmm_malloc(sizeof(struct pn532_dev_s)); if (!dev) { - pn532dbg("Failed to allocate instance\n"); + pn532err("Failed to allocate instance\n"); return -ENOMEM; } @@ -1123,7 +1123,7 @@ int pn532_register(FAR const char *devpath, FAR struct spi_dev_s *spi, ret = register_driver(devpath, &g_pn532fops, 0666, dev); if (ret < 0) { - pn532dbg("Failed to register driver: %d\n", ret); + pn532err("Failed to register driver: %d\n", ret); kmm_free(dev); } diff --git a/fs/aio/aio_fsync.c b/fs/aio/aio_fsync.c index 8070817595..fd08328db4 100644 --- a/fs/aio/aio_fsync.c +++ b/fs/aio/aio_fsync.c @@ -100,7 +100,7 @@ static void aio_fsync_worker(FAR void *arg) if (ret < 0) { int errcode = get_errno(); - fdbg("ERROR: fsync failed: %d\n", errcode); + ferr("ERROR: fsync failed: %d\n", errcode); DEBUGASSERT(errcode > 0); aiocbp->aio_result = -errcode; } diff --git a/fs/aio/aio_read.c b/fs/aio/aio_read.c index b3e717b58b..6d261ec7d8 100644 --- a/fs/aio/aio_read.c +++ b/fs/aio/aio_read.c @@ -133,7 +133,7 @@ static void aio_read_worker(FAR void *arg) if (nread < 0) { int errcode = get_errno(); - fdbg("ERROR: pread failed: %d\n", errcode); + ferr("ERROR: pread failed: %d\n", errcode); DEBUGASSERT(errcode > 0); aiocbp->aio_result = -errcode; } diff --git a/fs/aio/aio_signal.c b/fs/aio/aio_signal.c index 5a279044c8..702d7f5b84 100644 --- a/fs/aio/aio_signal.c +++ b/fs/aio/aio_signal.c @@ -102,7 +102,7 @@ int aio_signal(pid_t pid, FAR struct aiocb *aiocbp) if (status < 0) { errcode = get_errno(); - fdbg("ERROR: sigqueue #1 failed: %d\n", errcode); + ferr("ERROR: sigqueue #1 failed: %d\n", errcode); ret = ERROR; } } @@ -115,7 +115,7 @@ int aio_signal(pid_t pid, FAR struct aiocb *aiocbp) ret = sig_notification(pid, &aiocbp->aio_sigevent); if (ret < 0) { - fdbg("ERROR: sig_notification failed: %d\n", ret); + ferr("ERROR: sig_notification failed: %d\n", ret); } } #endif @@ -133,7 +133,7 @@ int aio_signal(pid_t pid, FAR struct aiocb *aiocbp) if (status && ret == OK) { errcode = get_errno(); - fdbg("ERROR: sigqueue #2 failed: %d\n", errcode); + ferr("ERROR: sigqueue #2 failed: %d\n", errcode); ret = ERROR; } diff --git a/fs/aio/aio_write.c b/fs/aio/aio_write.c index e9ed46d815..3d20b2dd93 100644 --- a/fs/aio/aio_write.c +++ b/fs/aio/aio_write.c @@ -125,7 +125,7 @@ static void aio_write_worker(FAR void *arg) if (oflags < 0) { int errcode = get_errno(); - fdbg("ERROR: fcntl failed: %d\n", errcode); + ferr("ERROR: fcntl failed: %d\n", errcode); aiocbp->aio_result = -errcode; goto errout; } @@ -180,7 +180,7 @@ static void aio_write_worker(FAR void *arg) if (nwritten < 0) { int errcode = get_errno(); - fdbg("ERROR: write/pwrite failed: %d\n", errcode); + ferr("ERROR: write/pwrite failed: %d\n", errcode); DEBUGASSERT(errcode > 0); aiocbp->aio_result = -errcode; } diff --git a/fs/binfs/fs_binfs.c b/fs/binfs/fs_binfs.c index 1fed2e6c2a..dd5b1a976f 100644 --- a/fs/binfs/fs_binfs.c +++ b/fs/binfs/fs_binfs.c @@ -146,7 +146,7 @@ static int binfs_open(FAR struct file *filep, FAR const char *relpath, if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - fdbg("ERROR: Only O_RDONLY supported\n"); + ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; } @@ -157,7 +157,7 @@ static int binfs_open(FAR struct file *filep, FAR const char *relpath, index = builtin_isavail(relpath); if (index < 0) { - fdbg("ERROR: Builting %s does not exist\n", relpath); + ferr("ERROR: Builting %s does not exist\n", relpath); return -ENOENT; } diff --git a/fs/driver/fs_blockproxy.c b/fs/driver/fs_blockproxy.c index 197b5534a5..045110ac40 100644 --- a/fs/driver/fs_blockproxy.c +++ b/fs/driver/fs_blockproxy.c @@ -174,7 +174,7 @@ int block_proxy(FAR const char *blkdev, int oflags) chardev = unique_chardev(); if (chardev == NULL) { - fdbg("ERROR: Failed to create temporary device name\n"); + ferr("ERROR: Failed to create temporary device name\n"); return -ENOMEM; } @@ -187,7 +187,7 @@ int block_proxy(FAR const char *blkdev, int oflags) ret = bchdev_register(blkdev, chardev, readonly); if (ret < 0) { - fdbg("ERROR: bchdev_register(%s, %s) failed: %d\n", + ferr("ERROR: bchdev_register(%s, %s) failed: %d\n", blkdev, chardev, ret); goto errout_with_chardev; @@ -200,7 +200,7 @@ int block_proxy(FAR const char *blkdev, int oflags) if (fd < 0) { ret = -errno; - fdbg("ERROR: Failed to open %s: %d\n", chardev, ret); + ferr("ERROR: Failed to open %s: %d\n", chardev, ret); goto errout_with_bchdev; } @@ -213,7 +213,7 @@ int block_proxy(FAR const char *blkdev, int oflags) if (ret < 0) { ret = -errno; - fdbg("ERROR: Failed to unlink %s: %d\n", chardev, ret); + ferr("ERROR: Failed to unlink %s: %d\n", chardev, ret); } /* Free the allocate character driver name and return the open file diff --git a/fs/driver/fs_closeblockdriver.c b/fs/driver/fs_closeblockdriver.c index ea39e99e53..defd3dcb5c 100644 --- a/fs/driver/fs_closeblockdriver.c +++ b/fs/driver/fs_closeblockdriver.c @@ -84,7 +84,7 @@ int close_blockdriver(FAR struct inode *inode) if (!INODE_IS_BLOCK(inode)) { - fdbg("inode is not a block driver\n"); + ferr("inode is not a block driver\n"); ret = -ENOTBLK; goto errout; } diff --git a/fs/driver/fs_findblockdriver.c b/fs/driver/fs_findblockdriver.c index bfbb0ac59e..b2b47e4ecb 100644 --- a/fs/driver/fs_findblockdriver.c +++ b/fs/driver/fs_findblockdriver.c @@ -96,7 +96,7 @@ int find_blockdriver(FAR const char *pathname, int mountflags, FAR struct inode inode = inode_find(pathname, NULL); if (!inode) { - fdbg("Failed to find %s\n", pathname); + ferr("Failed to find %s\n", pathname); ret = -ENOENT; goto errout; } @@ -105,7 +105,7 @@ int find_blockdriver(FAR const char *pathname, int mountflags, FAR struct inode if (!INODE_IS_BLOCK(inode)) { - fdbg("%s is not a block driver\n", pathname); + ferr("%s is not a block driver\n", pathname); ret = -ENOTBLK; goto errout_with_inode; } @@ -115,7 +115,7 @@ int find_blockdriver(FAR const char *pathname, int mountflags, FAR struct inode if (!inode->u.i_bops || !inode->u.i_bops->read || (!inode->u.i_bops->write && (mountflags & MS_RDONLY) == 0)) { - fdbg("%s does not support requested access\n", pathname); + ferr("%s does not support requested access\n", pathname); ret = -EACCES; goto errout_with_inode; } diff --git a/fs/driver/fs_openblockdriver.c b/fs/driver/fs_openblockdriver.c index bfdf3caadc..67a955cf57 100644 --- a/fs/driver/fs_openblockdriver.c +++ b/fs/driver/fs_openblockdriver.c @@ -96,7 +96,7 @@ int open_blockdriver(FAR const char *pathname, int mountflags, ret = find_blockdriver(pathname, mountflags, &inode); if (ret < 0) { - fdbg("Failed to file %s block driver\n", pathname); + ferr("Failed to file %s block driver\n", pathname); goto errout; } @@ -110,7 +110,7 @@ int open_blockdriver(FAR const char *pathname, int mountflags, ret = inode->u.i_bops->open(inode); if (ret < 0) { - fdbg("%s driver open failed\n", pathname); + ferr("%s driver open failed\n", pathname); goto errout_with_inode; } } diff --git a/fs/fat/fs_configfat.c b/fs/fat/fs_configfat.c index f152e45dd1..3064a82f92 100644 --- a/fs/fat/fs_configfat.c +++ b/fs/fat/fs_configfat.c @@ -473,7 +473,7 @@ mkfatfs_tryfat12(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var, if (config->fc_nclusters + 2 > maxnclusters) { - fdbg("Too many clusters for FAT12: %d > %d\n", + ferr("Too many clusters for FAT12: %d > %d\n", config->fc_nclusters, maxnclusters - 2); return -ENFILE; @@ -550,7 +550,7 @@ mkfatfs_tryfat16(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var, if ((config->fc_nclusters + 2 > maxnclusters) || (config->fc_nclusters < FAT_MINCLUST16)) { - fdbg("Too few or too many clusters for FAT16: %d < %d < %d\n", + ferr("Too few or too many clusters for FAT16: %d < %d < %d\n", FAT_MINCLUST16, config->fc_nclusters, maxnclusters - 2); return -ENFILE; @@ -622,7 +622,7 @@ mkfatfs_tryfat32(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var, if ((config->fc_nclusters + 3 > maxnclusters) || (config->fc_nclusters < FAT_MINCLUST32)) { - fdbg("Too few or too many clusters for FAT32: %d < %d < %d\n", + ferr("Too few or too many clusters for FAT32: %d < %d < %d\n", FAT_MINCLUST32, config->fc_nclusters, maxnclusters - 3); return -ENFILE; @@ -696,7 +696,7 @@ mkfatfs_clustersearch(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var) if (fmt->ff_rsvdseccount < 2) { - fdbg("At least 2 reserved sectors needed by FAT32\n"); + ferr("At least 2 reserved sectors needed by FAT32\n"); fatconfig32.fc_rsvdseccount = 2; } else @@ -756,7 +756,7 @@ mkfatfs_clustersearch(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var) if (mkfatfs_tryfat12(fmt, var, &fatconfig12) != 0) { - fdbg("Cannot format FAT12 at %u sectors/cluster\n", + ferr("Cannot format FAT12 at %u sectors/cluster\n", 1 << fmt->ff_clustshift); fatconfig12.fc_nfatsects = 0; @@ -772,7 +772,7 @@ mkfatfs_clustersearch(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var) if (mkfatfs_tryfat16(fmt, var, &fatconfig16) != 0) { - fdbg("Cannot format FAT16 at %u sectors/cluster\n", + ferr("Cannot format FAT16 at %u sectors/cluster\n", 1 << fmt->ff_clustshift); fatconfig16.fc_nfatsects = 0; @@ -828,7 +828,7 @@ mkfatfs_clustersearch(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var) if (mkfatfs_tryfat32(fmt, var, &fatconfig32) != 0) { - fdbg("Cannot format FAT32 at %u sectors/cluster\n", + ferr("Cannot format FAT32 at %u sectors/cluster\n", 1 << fmt->ff_clustshift); fatconfig32.fc_nfatsects = 0; @@ -897,7 +897,7 @@ int mkfatfs_configfatfs(FAR struct fat_format_s *fmt, ret = mkfatfs_clustersearch(fmt, var); if (ret < 0) { - fdbg("ERROR: Failed to set cluster size\n"); + ferr("ERROR: Failed to set cluster size\n"); return ret; } @@ -940,7 +940,7 @@ int mkfatfs_configfatfs(FAR struct fat_format_s *fmt, if (fmt->ff_backupboot <= 1 || fmt->ff_backupboot >= fmt->ff_rsvdseccount) { - fdbg("Invalid backup boot sector: %d\n", fmt->ff_backupboot); + ferr("Invalid backup boot sector: %d\n", fmt->ff_backupboot); fmt->ff_backupboot = 0; } @@ -974,21 +974,21 @@ int mkfatfs_configfatfs(FAR struct fat_format_s *fmt, /* Describe the configured filesystem */ #ifdef CONFIG_DEBUG_FEATURES - fdbg("Sector size: %d bytes\n", var->fv_sectorsize); - fdbg("Number of sectors: %d sectors\n", fmt->ff_nsectors); - fdbg("FAT size: %d bits\n", var->fv_fattype); - fdbg("Number FATs: %d\n", fmt->ff_nfats); - fdbg("Sectors per cluster: %d sectors\n", 1 << fmt->ff_clustshift); - fdbg("FS size: %d sectors\n", var->fv_nfatsects); - fdbg(" %d clusters\n", var->fv_nclusters); + ferr("Sector size: %d bytes\n", var->fv_sectorsize); + ferr("Number of sectors: %d sectors\n", fmt->ff_nsectors); + ferr("FAT size: %d bits\n", var->fv_fattype); + ferr("Number FATs: %d\n", fmt->ff_nfats); + ferr("Sectors per cluster: %d sectors\n", 1 << fmt->ff_clustshift); + ferr("FS size: %d sectors\n", var->fv_nfatsects); + ferr(" %d clusters\n", var->fv_nclusters); if (var->fv_fattype != 32) { - fdbg("Root directory slots: %d\n", fmt->ff_rootdirentries); + ferr("Root directory slots: %d\n", fmt->ff_rootdirentries); } - fdbg("Volume ID: %08x\n", fmt->ff_volumeid); - fdbg("Volume Label: \"%c%c%c%c%c%c%c%c%c%c%c\"\n", + ferr("Volume ID: %08x\n", fmt->ff_volumeid); + ferr("Volume Label: \"%c%c%c%c%c%c%c%c%c%c%c\"\n", fmt->ff_volumelabel[0], fmt->ff_volumelabel[1], fmt->ff_volumelabel[2], fmt->ff_volumelabel[3], fmt->ff_volumelabel[4], fmt->ff_volumelabel[5], fmt->ff_volumelabel[6], fmt->ff_volumelabel[7], fmt->ff_volumelabel[8], diff --git a/fs/fat/fs_fat32.c b/fs/fat/fs_fat32.c index b35a600eec..46ace6fd89 100644 --- a/fs/fat/fs_fat32.c +++ b/fs/fat/fs_fat32.c @@ -624,7 +624,7 @@ fat_read_restart: if (ret == -EFAULT && !force_indirect) { - fdbg("DMA: read alignment error, restarting indirect\n"); + ferr("DMA: read alignment error, restarting indirect\n"); force_indirect = true; goto fat_read_restart; } @@ -884,7 +884,7 @@ fat_write_restart: if (ret == -EFAULT && !force_indirect) { - fdbg("DMA: write alignment error, restarting indirect\n"); + ferr("DMA: write alignment error, restarting indirect\n"); force_indirect = true; goto fat_write_restart; } diff --git a/fs/fat/fs_fat32util.c b/fs/fat/fs_fat32util.c index 8e2bcac59e..1ed62cb1e7 100644 --- a/fs/fat/fs_fat32util.c +++ b/fs/fat/fs_fat32util.c @@ -121,7 +121,7 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs) if (MBR_GETSIGNATURE(fs->fs_buffer) != BOOT_SIGNATURE16 || MBR_GETBYTESPERSEC(fs->fs_buffer) != fs->fs_hwsectorsize) { - fdbg("ERROR: Signature: %04x FS sectorsize: %d HW sectorsize: %d\n", + ferr("ERROR: Signature: %04x FS sectorsize: %d HW sectorsize: %d\n", MBR_GETSIGNATURE(fs->fs_buffer), MBR_GETBYTESPERSEC(fs->fs_buffer), fs->fs_hwsectorsize); @@ -159,7 +159,7 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs) if (!fs->fs_nfatsects || fs->fs_nfatsects >= fs->fs_hwnsectors) { - fdbg("ERROR: fs_nfatsects %d fs_hwnsectors: %d\n", + ferr("ERROR: fs_nfatsects %d fs_hwnsectors: %d\n", fs->fs_nfatsects, fs->fs_hwnsectors); return -EINVAL; @@ -179,7 +179,7 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs) if (!fs->fs_fattotsec || fs->fs_fattotsec > fs->fs_hwnsectors) { - fdbg("ERROR: fs_fattotsec %d fs_hwnsectors: %d\n", + ferr("ERROR: fs_fattotsec %d fs_hwnsectors: %d\n", fs->fs_fattotsec, fs->fs_hwnsectors); return -EINVAL; @@ -190,7 +190,7 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs) fs->fs_fatresvdseccount = MBR_GETRESVDSECCOUNT(fs->fs_buffer); if (fs->fs_fatresvdseccount > fs->fs_hwnsectors) { - fdbg("ERROR: fs_fatresvdseccount %d fs_hwnsectors: %d\n", + ferr("ERROR: fs_fatresvdseccount %d fs_hwnsectors: %d\n", fs->fs_fatresvdseccount, fs->fs_hwnsectors); return -EINVAL; @@ -206,7 +206,7 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs) ndatasectors = fs->fs_fattotsec - fs->fs_fatresvdseccount - ntotalfatsects - rootdirsectors; if (ndatasectors > fs->fs_hwnsectors) { - fdbg("ERROR: ndatasectors %d fs_hwnsectors: %d\n", + ferr("ERROR: ndatasectors %d fs_hwnsectors: %d\n", ndatasectors, fs->fs_hwnsectors); return -EINVAL; @@ -239,7 +239,7 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs) } else { - fdbg("ERROR: notfat32: %d fs_nclusters: %d\n", + ferr("ERROR: notfat32: %d fs_nclusters: %d\n", notfat32, fs->fs_nclusters); return -EINVAL; @@ -594,7 +594,7 @@ int fat_mount(struct fat_mountpt_s *fs, bool writeable) { /* Failed to read the sector */ - fdbg("ERROR: Failed to read sector %ld: %d\n", + ferr("ERROR: Failed to read sector %ld: %d\n", (long)fs->fs_fatbase, ret); continue; } @@ -616,14 +616,14 @@ int fat_mount(struct fat_mountpt_s *fs, bool writeable) ret = fat_hwread(fs, fs->fs_buffer, 0, 1); if (ret < 0) { - fdbg("ERROR: Failed to re-read sector 0: %d\n", ret); + ferr("ERROR: Failed to re-read sector 0: %d\n", ret); goto errout_with_buffer; } } if (i > 3) { - fdbg("No valid MBR\n"); + ferr("No valid MBR\n"); ret = -EINVAL; goto errout_with_buffer; } @@ -644,22 +644,22 @@ int fat_mount(struct fat_mountpt_s *fs, bool writeable) /* We did it! */ - fdbg("FAT%d:\n", fs->fs_type == 0 ? 12 : fs->fs_type == 1 ? 16 : 32); - fdbg("\tHW sector size: %d\n", fs->fs_hwsectorsize); - fdbg("\t sectors: %d\n", fs->fs_hwnsectors); - fdbg("\tFAT reserved: %d\n", fs->fs_fatresvdseccount); - fdbg("\t sectors: %d\n", fs->fs_fattotsec); - fdbg("\t start sector: %d\n", fs->fs_fatbase); - fdbg("\t root sector: %d\n", fs->fs_rootbase); - fdbg("\t root entries: %d\n", fs->fs_rootentcnt); - fdbg("\t data sector: %d\n", fs->fs_database); - fdbg("\t FSINFO sector: %d\n", fs->fs_fsinfo); - fdbg("\t Num FATs: %d\n", fs->fs_fatnumfats); - fdbg("\t FAT sectors: %d\n", fs->fs_nfatsects); - fdbg("\t sectors/cluster: %d\n", fs->fs_fatsecperclus); - fdbg("\t max clusters: %d\n", fs->fs_nclusters); - fdbg("\tFSI free count %d\n", fs->fs_fsifreecount); - fdbg("\t next free %d\n", fs->fs_fsinextfree); + ferr("FAT%d:\n", fs->fs_type == 0 ? 12 : fs->fs_type == 1 ? 16 : 32); + ferr("\tHW sector size: %d\n", fs->fs_hwsectorsize); + ferr("\t sectors: %d\n", fs->fs_hwnsectors); + ferr("\tFAT reserved: %d\n", fs->fs_fatresvdseccount); + ferr("\t sectors: %d\n", fs->fs_fattotsec); + ferr("\t start sector: %d\n", fs->fs_fatbase); + ferr("\t root sector: %d\n", fs->fs_rootbase); + ferr("\t root entries: %d\n", fs->fs_rootentcnt); + ferr("\t data sector: %d\n", fs->fs_database); + ferr("\t FSINFO sector: %d\n", fs->fs_fsinfo); + ferr("\t Num FATs: %d\n", fs->fs_fatnumfats); + ferr("\t FAT sectors: %d\n", fs->fs_nfatsects); + ferr("\t sectors/cluster: %d\n", fs->fs_fatsecperclus); + ferr("\t max clusters: %d\n", fs->fs_nclusters); + ferr("\tFSI free count %d\n", fs->fs_fsifreecount); + ferr("\t next free %d\n", fs->fs_fsinextfree); return OK; diff --git a/fs/fat/fs_mkfatfs.c b/fs/fat/fs_mkfatfs.c index 6e083703c6..75269a602b 100644 --- a/fs/fat/fs_mkfatfs.c +++ b/fs/fat/fs_mkfatfs.c @@ -86,13 +86,13 @@ static inline int mkfatfs_getgeometry(FAR struct fat_format_s *fmt, ret = DEV_GEOMETRY(geometry); if (ret < 0) { - fdbg("ERROR: geometry() returned %d\n", ret); + ferr("ERROR: geometry() returned %d\n", ret); return ret; } if (!geometry.geo_available || !geometry.geo_writeenabled) { - fdbg("ERROR: Media is not available\n", ret); + ferr("ERROR: Media is not available\n", ret); return -ENODEV; } @@ -104,7 +104,7 @@ static inline int mkfatfs_getgeometry(FAR struct fat_format_s *fmt, { if (fmt->ff_nsectors > geometry.geo_nsectors) { - fdbg("ERROR: User maxblocks (%d) exceeds blocks on device (%d)\n", + ferr("ERROR: User maxblocks (%d) exceeds blocks on device (%d)\n", fmt->ff_nsectors, geometry.geo_nsectors); return -EINVAL; @@ -139,7 +139,7 @@ static inline int mkfatfs_getgeometry(FAR struct fat_format_s *fmt, break; default: - fdbg("ERROR: Unsupported sector size: %d\n", var->fv_sectorsize); + ferr("ERROR: Unsupported sector size: %d\n", var->fv_sectorsize); return -EPERM; } @@ -196,14 +196,14 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt) #ifdef CONFIG_DEBUG_FEATURES if (!pathname) { - fdbg("ERROR: No block driver path\n"); + ferr("ERROR: No block driver path\n"); ret = -EINVAL; goto errout; } if (fmt->ff_nfats < 1 || fmt->ff_nfats > 4) { - fdbg("ERROR: Invalid number of fats: %d\n", fmt->ff_nfats); + ferr("ERROR: Invalid number of fats: %d\n", fmt->ff_nfats); ret = -EINVAL; goto errout; } @@ -211,7 +211,7 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt) if (fmt->ff_fattype != 0 && fmt->ff_fattype != 12 && fmt->ff_fattype != 16 && fmt->ff_fattype != 32) { - fdbg("ERROR: Invalid FAT size: %d\n", fmt->ff_fattype); + ferr("ERROR: Invalid FAT size: %d\n", fmt->ff_fattype); ret = -EINVAL; goto errout; } @@ -231,7 +231,7 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt) #ifdef CONFIG_DEBUG_FEATURES if (fmt->ff_clustshift > 7 && fmt->ff_clustshift != 0xff) { - fdbg("ERROR: Invalid cluster shift value: %d\n", fmt->ff_clustshift); + ferr("ERROR: Invalid cluster shift value: %d\n", fmt->ff_clustshift); ret = -EINVAL; goto errout; @@ -240,7 +240,7 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt) if (fmt->ff_rootdirentries != 0 && (fmt->ff_rootdirentries < 16 || fmt->ff_rootdirentries > 32767)) { - fdbg("ERROR: Invalid number of root dir entries: %d\n", + ferr("ERROR: Invalid number of root dir entries: %d\n", fmt->ff_rootdirentries); ret = -EINVAL; @@ -250,7 +250,7 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt) if (fmt->ff_rsvdseccount != 0 && (fmt->ff_rsvdseccount < 1 || fmt->ff_rsvdseccount > 32767)) { - fdbg("ERROR: Invalid number of reserved sectors: %d\n", + ferr("ERROR: Invalid number of reserved sectors: %d\n", fmt->ff_rsvdseccount); ret = -EINVAL; @@ -263,7 +263,7 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt) ret = open_blockdriver(pathname, 0, &var.fv_inode); if (ret < 0) { - fdbg("ERROR: Failed to open %s\n", pathname); + ferr("ERROR: Failed to open %s\n", pathname); goto errout; } @@ -271,7 +271,7 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt) if (!var.fv_inode->u.i_bops->write || !var.fv_inode->u.i_bops->geometry) { - fdbg("ERROR: %s does not support write or geometry methods\n", + ferr("ERROR: %s does not support write or geometry methods\n", pathname); ret = -EACCES; @@ -306,7 +306,7 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt) if (!var.fv_sect) { - fdbg("ERROR: Failed to allocate working buffers\n"); + ferr("ERROR: Failed to allocate working buffers\n"); goto errout_with_driver; } diff --git a/fs/mmap/fs_mmap.c b/fs/mmap/fs_mmap.c index fd23f7647b..222a2591b2 100644 --- a/fs/mmap/fs_mmap.c +++ b/fs/mmap/fs_mmap.c @@ -135,14 +135,14 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags, if (prot == PROT_NONE || (flags & (MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS | MAP_DENYWRITE)) != 0) { - fdbg("Unsupported options, prot=%x flags=%04x\n", prot, flags); + ferr("Unsupported options, prot=%x flags=%04x\n", prot, flags); set_errno(ENOSYS); return MAP_FAILED; } if (length == 0 || (flags & MAP_SHARED) == 0) { - fdbg("Invalid options, lengt=%d flags=%04x\n", length, flags); + ferr("Invalid options, lengt=%d flags=%04x\n", length, flags); set_errno(EINVAL); return MAP_FAILED; } @@ -163,7 +163,7 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags, #ifdef CONFIG_FS_RAMMAP return rammap(fd, length, offset); #else - fdbg("ioctl(FIOC_MMAP) failed: %d\n", get_errno()); + ferr("ioctl(FIOC_MMAP) failed: %d\n", get_errno()); return MAP_FAILED; #endif } diff --git a/fs/mmap/fs_munmap.c b/fs/mmap/fs_munmap.c index f15f34847a..cf53957085 100644 --- a/fs/mmap/fs_munmap.c +++ b/fs/mmap/fs_munmap.c @@ -143,7 +143,7 @@ int munmap(FAR void *start, size_t length) if (!curr) { - fdbg("Region not found\n"); + ferr("Region not found\n"); errcode = EINVAL; goto errout_with_semaphore; } @@ -158,7 +158,7 @@ int munmap(FAR void *start, size_t length) offset = start - curr->addr; if (offset + length < curr->length) { - fdbg("Cannot umap without unmapping to the end\n"); + ferr("Cannot umap without unmapping to the end\n"); errcode = ENOSYS; goto errout_with_semaphore; } diff --git a/fs/mmap/fs_rammap.c b/fs/mmap/fs_rammap.c index 39ff5a24b1..22ccd7aeea 100644 --- a/fs/mmap/fs_rammap.c +++ b/fs/mmap/fs_rammap.c @@ -142,7 +142,7 @@ FAR void *rammap(int fd, size_t length, off_t offset) alloc = (FAR uint8_t *)kumm_malloc(sizeof(struct fs_rammap_s) + length); if (!alloc) { - fdbg("Region allocation failed, length: %d\n", (int)length); + ferr("Region allocation failed, length: %d\n", (int)length); errcode = ENOMEM; goto errout; } @@ -164,7 +164,7 @@ FAR void *rammap(int fd, size_t length, off_t offset) * the correct response. */ - fdbg("Seek to position %d failed\n", (int)offset); + ferr("Seek to position %d failed\n", (int)offset); errcode = EINVAL; goto errout_with_region; } @@ -186,11 +186,11 @@ FAR void *rammap(int fd, size_t length, off_t offset) { /* All other read errors are bad. errno is already set. * (but maybe should be forced to EINVAL?). NOTE that if - * FS DEBUG is enabled, then the following fdbg() macro will + * FS DEBUG is enabled, then the following ferr() macro will * destroy the errno value. */ - fdbg("Read failed: offset=%d errno=%d\n", (int)offset, errcode); + ferr("Read failed: offset=%d errno=%d\n", (int)offset, errcode); #ifdef CONFIG_DEBUG_FS goto errout_with_region; #else diff --git a/fs/mount/fs_automount.c b/fs/mount/fs_automount.c index 8f2c337c3d..689e58051a 100644 --- a/fs/mount/fs_automount.c +++ b/fs/mount/fs_automount.c @@ -204,13 +204,13 @@ static void automount_mount(FAR struct automounter_state_s *priv) * try to unmount again because the mount might be stale. */ - fdbg("WARNING: Mountpoint %s already exists\n", lower->mountpoint); + ferr("WARNING: Mountpoint %s already exists\n", lower->mountpoint); ret = automount_unmount(priv); if (ret < 0) { /* We failed to unmount (again?). Complain and abort. */ - fdbg("ERROR: automount_unmount failed: %d\n", ret); + ferr("ERROR: automount_unmount failed: %d\n", ret); return; } @@ -232,7 +232,7 @@ static void automount_mount(FAR struct automounter_state_s *priv) int errcode = get_errno(); DEBUGASSERT(errcode > 0); - fdbg("ERROR: Mount failed: %d\n", errcode); + ferr("ERROR: Mount failed: %d\n", errcode); UNUSED(errcode); return; } @@ -243,7 +243,7 @@ static void automount_mount(FAR struct automounter_state_s *priv) break; default: - fdbg("ERROR: automount_findinode failed: %d\n", ret); + ferr("ERROR: automount_findinode failed: %d\n", ret); break; } } @@ -306,7 +306,7 @@ static int automount_unmount(FAR struct automounter_state_s *priv) errcode = get_errno(); DEBUGASSERT(errcode > 0); - fdbg("ERROR: wd_start failed: %d\n", errcode); + ferr("ERROR: wd_start failed: %d\n", errcode); return -ret; } } @@ -332,7 +332,7 @@ static int automount_unmount(FAR struct automounter_state_s *priv) return OK; default: - fdbg("ERROR: automount_findinode failed: %d\n", ret); + ferr("ERROR: automount_findinode failed: %d\n", ret); return ret; } } @@ -382,7 +382,7 @@ static void automount_timeout(int argc, uint32_t arg1, ...) { /* NOTE: Currently, work_queue only returns success */ - fdbg("ERROR: Failed to schedule work: %d\n", ret); + ferr("ERROR: Failed to schedule work: %d\n", ret); } } @@ -475,7 +475,7 @@ static int automount_interrupt(FAR const struct automount_lower_s *lower, { /* NOTE: Currently, work_cancel only returns success */ - fdbg("ERROR: Failed to cancel work: %d\n", ret); + ferr("ERROR: Failed to cancel work: %d\n", ret); } /* Set the media insertion/removal state */ @@ -496,7 +496,7 @@ static int automount_interrupt(FAR const struct automount_lower_s *lower, { /* NOTE: Currently, work_queue only returns success */ - fdbg("ERROR: Failed to schedule work: %d\n", ret); + ferr("ERROR: Failed to schedule work: %d\n", ret); } else { @@ -542,7 +542,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower) if (!priv) { - fdbg("ERROR: Failed to allocate state structure\n"); + ferr("ERROR: Failed to allocate state structure\n"); return NULL; } @@ -555,7 +555,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower) priv->wdog = wd_create(); if (!priv->wdog) { - fdbg("ERROR: Failed to create a timer\n"); + ferr("ERROR: Failed to create a timer\n"); automount_uninitialize(priv); return NULL; } @@ -574,7 +574,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower) { /* NOTE: Currently, work_queue only returns success */ - fdbg("ERROR: Failed to schedule work: %d\n", ret); + ferr("ERROR: Failed to schedule work: %d\n", ret); } /* Attach and enable automounter interrupts */ @@ -582,7 +582,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower) ret = AUTOMOUNT_ATTACH(lower, automount_interrupt, priv); if (ret < 0) { - fdbg("ERROR: Failed to attach automount interrupt: %d\n", ret); + ferr("ERROR: Failed to attach automount interrupt: %d\n", ret); automount_uninitialize(priv); return NULL; } diff --git a/fs/mount/fs_mount.c b/fs/mount/fs_mount.c index f3ab72bc93..04e7bc3a9e 100644 --- a/fs/mount/fs_mount.c +++ b/fs/mount/fs_mount.c @@ -256,7 +256,7 @@ int mount(FAR const char *source, FAR const char *target, ret = find_blockdriver(source, mountflags, &blkdrvr_inode); if (ret < 0) { - fdbg("ERROR: Failed to find block driver %s\n", source); + ferr("ERROR: Failed to find block driver %s\n", source); errcode = -ret; goto errout; } @@ -270,7 +270,7 @@ int mount(FAR const char *source, FAR const char *target, else #endif /* NONBDFS_SUPPORT */ { - fdbg("ERROR: Failed to find file system %s\n", filesystemtype); + ferr("ERROR: Failed to find file system %s\n", filesystemtype); errcode = ENODEV; goto errout; } @@ -289,7 +289,7 @@ int mount(FAR const char *source, FAR const char *target, if (INODE_IS_SPECIAL(mountpt_inode)) { - fdbg("ERROR: target %s exists and is a special nodes\n", target); + ferr("ERROR: target %s exists and is a special nodes\n", target); errcode = -ENOTDIR; goto errout_with_semaphore; } @@ -321,7 +321,7 @@ int mount(FAR const char *source, FAR const char *target, * -ENOMEM - Failed to allocate in-memory resources for the operation */ - fdbg("ERROR: Failed to reserve inode for target %s\n", target); + ferr("ERROR: Failed to reserve inode for target %s\n", target); errcode = -ret; goto errout_with_semaphore; } @@ -336,7 +336,7 @@ int mount(FAR const char *source, FAR const char *target, { /* The filesystem does not support the bind operation ??? */ - fdbg("ERROR: Filesystem does not support bind\n"); + ferr("ERROR: Filesystem does not support bind\n"); errcode = EINVAL; goto errout_with_mountpt; } @@ -366,7 +366,7 @@ int mount(FAR const char *source, FAR const char *target, * error. */ - fdbg("ERROR: Bind method failed: %d\n", ret); + ferr("ERROR: Bind method failed: %d\n", ret); #ifdef BDFS_SUPPORT #ifdef NONBDFS_SUPPORT if (blkdrvr_inode) @@ -441,7 +441,7 @@ errout: return ERROR; #else - fdbg("ERROR: No filesystems enabled\n"); + ferr("ERROR: No filesystems enabled\n"); set_errno(ENOSYS); return ERROR; #endif /* BDFS_SUPPORT || NONBDFS_SUPPORT */ diff --git a/fs/nfs/nfs_util.c b/fs/nfs/nfs_util.c index f811e01480..7fa0944026 100644 --- a/fs/nfs/nfs_util.c +++ b/fs/nfs/nfs_util.c @@ -103,7 +103,7 @@ static inline int nfs_pathsegment(FAR const char **path, FAR char *buffer, } else if (nbytes >= NAME_MAX) { - fdbg("File name segment is too long: %d\n", *path); + ferr("File name segment is too long: %d\n", *path); return EFBIG; } else @@ -205,7 +205,7 @@ tryagain: request, reqlen, response, resplen); if (error != 0) { - fdbg("ERROR: rpcclnt_request failed: %d\n", error); + ferr("ERROR: rpcclnt_request failed: %d\n", error); return error; } @@ -237,7 +237,7 @@ tryagain: goto tryagain; } - fdbg("ERROR: NFS error %d from server\n", error); + ferr("ERROR: NFS error %d from server\n", error); return error; } @@ -277,7 +277,7 @@ int nfs_lookup(struct nfsmount *nmp, FAR const char *filename, namelen = strlen(filename); if (namelen > NAME_MAX) { - fdbg("Length of the string is too big: %d\n", namelen); + ferr("Length of the string is too big: %d\n", namelen); return E2BIG; } @@ -312,7 +312,7 @@ int nfs_lookup(struct nfsmount *nmp, FAR const char *filename, if (error) { - fdbg("ERROR: nfs_request failed: %d\n", error); + ferr("ERROR: nfs_request failed: %d\n", error); return error; } @@ -329,7 +329,7 @@ int nfs_lookup(struct nfsmount *nmp, FAR const char *filename, value = fxdr_unsigned(uint32_t, value); if (value > NFSX_V3FHMAX) { - fdbg("ERROR: Bad file handle length: %d\n", value); + ferr("ERROR: Bad file handle length: %d\n", value); return EIO; } @@ -427,7 +427,7 @@ int nfs_findnode(struct nfsmount *nmp, FAR const char *relpath, { /* The filename segment contains is too long. */ - fdbg("nfs_pathsegment of \"%s\" failed after \"%s\": %d\n", + ferr("nfs_pathsegment of \"%s\" failed after \"%s\": %d\n", relpath, buffer, error); return error; } @@ -437,7 +437,7 @@ int nfs_findnode(struct nfsmount *nmp, FAR const char *relpath, error = nfs_lookup(nmp, buffer, fhandle, obj_attributes, dir_attributes); if (error != OK) { - fdbg("nfs_lookup of \"%s\" failed at \"%s\": %d\n", + ferr("nfs_lookup of \"%s\" failed at \"%s\": %d\n", relpath, buffer, error); return error; } @@ -466,7 +466,7 @@ int nfs_findnode(struct nfsmount *nmp, FAR const char *relpath, { /* Ooops.. we found something else */ - fdbg("ERROR: Intermediate segment \"%s\" of \'%s\" is not a directory\n", + ferr("ERROR: Intermediate segment \"%s\" of \'%s\" is not a directory\n", buffer, path); return ENOTDIR; } @@ -521,7 +521,7 @@ int nfs_finddir(struct nfsmount *nmp, FAR const char *relpath, { /* The filename segment contains is too long. */ - fdbg("nfs_pathsegment of \"%s\" failed after \"%s\": %d\n", + ferr("nfs_pathsegment of \"%s\" failed after \"%s\": %d\n", relpath, filename, error); return error; } @@ -545,7 +545,7 @@ int nfs_finddir(struct nfsmount *nmp, FAR const char *relpath, error = nfs_lookup(nmp, filename, fhandle, attributes, NULL); if (error != OK) { - fdbg("nfs_lookup of \"%s\" failed at \"%s\": %d\n", + ferr("nfs_lookup of \"%s\" failed at \"%s\": %d\n", relpath, filename, error); return error; } @@ -557,7 +557,7 @@ int nfs_finddir(struct nfsmount *nmp, FAR const char *relpath, { /* Ooops.. we found something else */ - fdbg("ERROR: Intermediate segment \"%s\" of \'%s\" is not a directory\n", + ferr("ERROR: Intermediate segment \"%s\" of \'%s\" is not a directory\n", filename, path); return ENOTDIR; } diff --git a/fs/nfs/nfs_vfsops.c b/fs/nfs/nfs_vfsops.c index fb23c5a2fa..aacc003c50 100644 --- a/fs/nfs/nfs_vfsops.c +++ b/fs/nfs/nfs_vfsops.c @@ -218,7 +218,7 @@ static int nfs_filecreate(FAR struct nfsmount *nmp, struct nfsnode *np, error = nfs_finddir(nmp, relpath, &fhandle, &fattr, filename); if (error != OK) { - fdbg("ERROR: nfs_finddir returned: %d\n", error); + ferr("ERROR: nfs_finddir returned: %d\n", error); return error; } @@ -340,7 +340,7 @@ static int nfs_filecreate(FAR struct nfsmount *nmp, struct nfsnode *np, tmp = *ptr++; /* handle_follows */ if (!tmp) { - fdbg("ERROR: no file handle follows\n"); + ferr("ERROR: no file handle follows\n"); return EINVAL; } @@ -357,7 +357,7 @@ static int nfs_filecreate(FAR struct nfsmount *nmp, struct nfsnode *np, tmp = *ptr; /* handle_follows */ if (!tmp) { - fdbg("WARNING: no file attributes\n"); + ferr("WARNING: no file attributes\n"); } else { @@ -427,7 +427,7 @@ static int nfs_filetruncate(FAR struct nfsmount *nmp, struct nfsnode *np) (FAR void *)nmp->nm_iobuffer, nmp->nm_buflen); if (error != OK) { - fdbg("ERROR: nfs_request failed: %d\n", error); + ferr("ERROR: nfs_request failed: %d\n", error); return error; } @@ -462,7 +462,7 @@ static int nfs_fileopen(FAR struct nfsmount *nmp, struct nfsnode *np, error = nfs_findnode(nmp, relpath, &fhandle, &fattr, NULL); if (error != OK) { - fdbg("ERROR: nfs_findnode returned: %d\n", error); + ferr("ERROR: nfs_findnode returned: %d\n", error); return error; } @@ -473,7 +473,7 @@ static int nfs_fileopen(FAR struct nfsmount *nmp, struct nfsnode *np, { /* Exit with EISDIR if we attempt to open a directory */ - fdbg("ERROR: Path is a directory\n"); + ferr("ERROR: Path is a directory\n"); return EISDIR; } @@ -489,7 +489,7 @@ static int nfs_fileopen(FAR struct nfsmount *nmp, struct nfsnode *np, tmp = fxdr_unsigned(uint32_t, fattr.fa_mode); if ((tmp & (NFSMODE_IWOTH | NFSMODE_IWGRP | NFSMODE_IWUSR)) == 0) { - fdbg("ERROR: File is read-only: %08x\n", tmp); + ferr("ERROR: File is read-only: %08x\n", tmp); return EACCES; } } @@ -500,7 +500,7 @@ static int nfs_fileopen(FAR struct nfsmount *nmp, struct nfsnode *np, { /* Already exists -- can't create it exclusively */ - fdbg("ERROR: File exists\n"); + ferr("ERROR: File exists\n"); return EEXIST; } @@ -567,7 +567,7 @@ static int nfs_open(FAR struct file *filep, FAR const char *relpath, np = (struct nfsnode *)kmm_zalloc(sizeof(struct nfsnode)); if (!np) { - fdbg("ERROR: Failed to allocate private data\n"); + ferr("ERROR: Failed to allocate private data\n"); return -ENOMEM; } @@ -577,7 +577,7 @@ static int nfs_open(FAR struct file *filep, FAR const char *relpath, error = nfs_checkmount(nmp); if (error != OK) { - fdbg("ERROR: nfs_checkmount failed: %d\n", error); + ferr("ERROR: nfs_checkmount failed: %d\n", error); goto errout_with_semaphore; } @@ -594,7 +594,7 @@ static int nfs_open(FAR struct file *filep, FAR const char *relpath, if (error != ENOENT) { - fdbg("ERROR: nfs_findnode failed: %d\n", error); + ferr("ERROR: nfs_findnode failed: %d\n", error); goto errout_with_semaphore; } @@ -609,7 +609,7 @@ static int nfs_open(FAR struct file *filep, FAR const char *relpath, * to create it. */ - fdbg("ERROR: File does not exist\n"); + ferr("ERROR: File does not exist\n"); error = ENOENT; goto errout_with_semaphore; } @@ -619,7 +619,7 @@ static int nfs_open(FAR struct file *filep, FAR const char *relpath, error = nfs_filecreate(nmp, np, relpath, mode); if (error != OK) { - fdbg("ERROR: nfs_filecreate failed: %d\n", error); + ferr("ERROR: nfs_filecreate failed: %d\n", error); goto errout_with_semaphore; } } @@ -790,7 +790,7 @@ static ssize_t nfs_read(FAR struct file *filep, char *buffer, size_t buflen) error = nfs_checkmount(nmp); if (error != OK) { - fdbg("nfs_checkmount failed: %d\n", error); + ferr("nfs_checkmount failed: %d\n", error); goto errout_with_semaphore; } @@ -859,7 +859,7 @@ static ssize_t nfs_read(FAR struct file *filep, char *buffer, size_t buflen) (FAR void *)nmp->nm_iobuffer, nmp->nm_buflen); if (error) { - fdbg("ERROR: nfs_request failed: %d\n", error); + ferr("ERROR: nfs_request failed: %d\n", error); goto errout_with_semaphore; } @@ -966,7 +966,7 @@ static ssize_t nfs_write(FAR struct file *filep, const char *buffer, error = nfs_checkmount(nmp); if (error != OK) { - fdbg("nfs_checkmount failed: %d\n", error); + ferr("nfs_checkmount failed: %d\n", error); goto errout_with_semaphore; } @@ -1043,7 +1043,7 @@ static ssize_t nfs_write(FAR struct file *filep, const char *buffer, (FAR void *)&nmp->nm_msgbuffer.write, sizeof(struct rpc_reply_write)); if (error) { - fdbg("ERROR: nfs_request failed: %d\n", error); + ferr("ERROR: nfs_request failed: %d\n", error); goto errout_with_semaphore; } @@ -1146,7 +1146,7 @@ static int nfs_dup(FAR const struct file *oldp, FAR struct file *newp) error = nfs_checkmount(nmp); if (error != OK) { - fdbg("ERROR: nfs_checkmount failed: %d\n", error); + ferr("ERROR: nfs_checkmount failed: %d\n", error); nfs_semgive(nmp); return -error; } @@ -1213,7 +1213,7 @@ static int nfs_opendir(struct inode *mountpt, const char *relpath, error = nfs_checkmount(nmp); if (error != OK) { - fdbg("ERROR: nfs_checkmount failed: %d\n", error); + ferr("ERROR: nfs_checkmount failed: %d\n", error); goto errout_with_semaphore; } @@ -1222,7 +1222,7 @@ static int nfs_opendir(struct inode *mountpt, const char *relpath, error = nfs_findnode(nmp, relpath, &fhandle, &obj_attributes, NULL); if (error != OK) { - fdbg("ERROR: nfs_findnode failed: %d\n", error); + ferr("ERROR: nfs_findnode failed: %d\n", error); goto errout_with_semaphore; } @@ -1231,7 +1231,7 @@ static int nfs_opendir(struct inode *mountpt, const char *relpath, objtype = fxdr_unsigned(uint32_t, obj_attributes.fa_type); if (objtype != NFDIR) { - fdbg("ERROR: Not a directory, type=%d\n", objtype); + ferr("ERROR: Not a directory, type=%d\n", objtype); error = ENOTDIR; goto errout_with_semaphore; } @@ -1289,7 +1289,7 @@ static int nfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir) error = nfs_checkmount(nmp); if (error != OK) { - fdbg("ERROR: nfs_checkmount failed: %d\n", error); + ferr("ERROR: nfs_checkmount failed: %d\n", error); goto errout_with_semaphore; } @@ -1333,7 +1333,7 @@ static int nfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir) (FAR void *)nmp->nm_iobuffer, nmp->nm_buflen); if (error != OK) { - fdbg("ERROR: nfs_request failed: %d\n", error); + ferr("ERROR: nfs_request failed: %d\n", error); goto errout_with_semaphore; } @@ -1449,7 +1449,7 @@ static int nfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir) error = nfs_lookup(nmp, dir->fd_dir.d_name, &fhandle, &obj_attributes, NULL); if (error != OK) { - fdbg("nfs_lookup failed: %d\n", error); + ferr("nfs_lookup failed: %d\n", error); goto errout_with_semaphore; } @@ -1574,7 +1574,7 @@ static void nfs_decode_args(FAR struct nfs_mount_parameters *nprmt, } else { - fdbg("ERROR: Only SOCK_DRAM is supported\n"); + ferr("ERROR: Only SOCK_DRAM is supported\n"); maxio = NFS_MAXDATA; } @@ -1726,7 +1726,7 @@ static int nfs_bind(FAR struct inode *blkdriver, FAR const void *data, nmp = (FAR struct nfsmount *)kmm_zalloc(SIZEOF_nfsmount(buflen)); if (!nmp) { - fdbg("ERROR: Failed to allocate mountpoint structure\n"); + ferr("ERROR: Failed to allocate mountpoint structure\n"); return ENOMEM; } @@ -1776,7 +1776,7 @@ static int nfs_bind(FAR struct inode *blkdriver, FAR const void *data, rpc = (struct rpcclnt *)kmm_zalloc(sizeof(struct rpcclnt)); if (!rpc) { - fdbg("ERROR: Failed to allocate rpc structure\n"); + ferr("ERROR: Failed to allocate rpc structure\n"); return ENOMEM; } @@ -1794,7 +1794,7 @@ static int nfs_bind(FAR struct inode *blkdriver, FAR const void *data, error = rpcclnt_connect(nmp->nm_rpcclnt); if (error != OK) { - fdbg("ERROR: nfs_connect failed: %d\n", error); + ferr("ERROR: nfs_connect failed: %d\n", error); goto bad; } } @@ -1813,7 +1813,7 @@ static int nfs_bind(FAR struct inode *blkdriver, FAR const void *data, (FAR void *)&resok, sizeof(struct rpc_reply_getattr)); if (error) { - fdbg("ERROR: nfs_request failed: %d\n", error); + ferr("ERROR: nfs_request failed: %d\n", error); goto bad; } @@ -1887,7 +1887,7 @@ static int nfs_unbind(FAR void *handle, FAR struct inode **blkdriver, if (nmp->nm_head != NULL) { - fdbg("ERROR; There are open files: %p\n", nmp->nm_head); + ferr("ERROR; There are open files: %p\n", nmp->nm_head); /* This implementation currently only supports unmounting if there are * no open file references. @@ -1902,7 +1902,7 @@ static int nfs_unbind(FAR void *handle, FAR struct inode **blkdriver, error = rpcclnt_umount(nmp->nm_rpcclnt); if (error) { - fdbg("ERROR: rpcclnt_umount failed: %d\n", error); + ferr("ERROR: rpcclnt_umount failed: %d\n", error); } /* Disconnect from the server */ @@ -2046,7 +2046,7 @@ static int nfs_statfs(FAR struct inode *mountpt, FAR struct statfs *sbp) error = nfs_checkmount(nmp); if (error != OK) { - fdbg("ERROR: nfs_checkmount failed: %d\n", error); + ferr("ERROR: nfs_checkmount failed: %d\n", error); goto errout_with_semaphore; } @@ -2124,7 +2124,7 @@ static int nfs_remove(struct inode *mountpt, const char *relpath) error = nfs_checkmount(nmp); if (error != OK) { - fdbg("ERROR: nfs_checkmount failed: %d\n", error); + ferr("ERROR: nfs_checkmount failed: %d\n", error); goto errout_with_semaphore; } @@ -2133,7 +2133,7 @@ static int nfs_remove(struct inode *mountpt, const char *relpath) error = nfs_finddir(nmp, relpath, &fhandle, &fattr, filename); if (error != OK) { - fdbg("ERROR: nfs_finddir returned: %d\n", error); + ferr("ERROR: nfs_finddir returned: %d\n", error); goto errout_with_semaphore; } @@ -2210,7 +2210,7 @@ static int nfs_mkdir(struct inode *mountpt, const char *relpath, mode_t mode) error = nfs_checkmount(nmp); if (error != OK) { - fdbg("ERROR: nfs_checkmount: %d\n", error); + ferr("ERROR: nfs_checkmount: %d\n", error); goto errout_with_semaphore; } @@ -2219,7 +2219,7 @@ static int nfs_mkdir(struct inode *mountpt, const char *relpath, mode_t mode) error = nfs_finddir(nmp, relpath, &fhandle, &fattr, dirname); if (error != OK) { - fdbg("ERROR: nfs_finddir returned: %d\n", error); + ferr("ERROR: nfs_finddir returned: %d\n", error); return error; } @@ -2292,7 +2292,7 @@ static int nfs_mkdir(struct inode *mountpt, const char *relpath, mode_t mode) (FAR void *)&nmp->nm_iobuffer, nmp->nm_buflen); if (error) { - fdbg("ERROR: nfs_request failed: %d\n", error); + ferr("ERROR: nfs_request failed: %d\n", error); } errout_with_semaphore: @@ -2336,7 +2336,7 @@ static int nfs_rmdir(struct inode *mountpt, const char *relpath) error = nfs_checkmount(nmp); if (error != OK) { - fdbg("ERROR: nfs_checkmount failed: %d\n", error); + ferr("ERROR: nfs_checkmount failed: %d\n", error); goto errout_with_semaphore; } @@ -2345,7 +2345,7 @@ static int nfs_rmdir(struct inode *mountpt, const char *relpath) error = nfs_finddir(nmp, relpath, &fhandle, &fattr, dirname); if (error != OK) { - fdbg("ERROR: nfs_finddir returned: %d\n", error); + ferr("ERROR: nfs_finddir returned: %d\n", error); return error; } @@ -2424,7 +2424,7 @@ static int nfs_rename(struct inode *mountpt, const char *oldrelpath, error = nfs_checkmount(nmp); if (error != OK) { - fdbg("ERROR: nfs_checkmount returned: %d\n", error); + ferr("ERROR: nfs_checkmount returned: %d\n", error); goto errout_with_semaphore; } @@ -2433,7 +2433,7 @@ static int nfs_rename(struct inode *mountpt, const char *oldrelpath, error = nfs_finddir(nmp, oldrelpath, &from_handle, &fattr, from_name); if (error != OK) { - fdbg("ERROR: nfs_finddir returned: %d\n", error); + ferr("ERROR: nfs_finddir returned: %d\n", error); return error; } @@ -2442,7 +2442,7 @@ static int nfs_rename(struct inode *mountpt, const char *oldrelpath, error = nfs_finddir(nmp, newrelpath, &to_handle, &fattr, to_name); if (error != OK) { - fdbg("ERROR: nfs_finddir returned: %d\n", error); + ferr("ERROR: nfs_finddir returned: %d\n", error); return error; } @@ -2538,7 +2538,7 @@ static int nfs_stat(struct inode *mountpt, const char *relpath, error = nfs_checkmount(nmp); if (error != OK) { - fdbg("ERROR: nfs_checkmount failed: %d\n", error); + ferr("ERROR: nfs_checkmount failed: %d\n", error); goto errout_with_semaphore; } @@ -2547,7 +2547,7 @@ static int nfs_stat(struct inode *mountpt, const char *relpath, error = nfs_findnode(nmp, relpath, &fhandle, &obj_attributes, NULL); if (error != OK) { - fdbg("ERROR: nfs_findnode failed: %d\n", error); + ferr("ERROR: nfs_findnode failed: %d\n", error); goto errout_with_semaphore; } diff --git a/fs/nfs/rpc_clnt.c b/fs/nfs/rpc_clnt.c index 302f468fbc..af163f034b 100644 --- a/fs/nfs/rpc_clnt.c +++ b/fs/nfs/rpc_clnt.c @@ -177,7 +177,7 @@ static int rpcclnt_send(FAR struct rpcclnt *rpc, int procid, int prog, /* psock_sendto failed */ error = get_errno(); - fdbg("ERROR: psock_sendto failed: %d\n", error); + ferr("ERROR: psock_sendto failed: %d\n", error); } return error; @@ -204,7 +204,7 @@ static int rpcclnt_receive(FAR struct rpcclnt *rpc, FAR struct sockaddr *aname, if (nbytes < 0) { error = get_errno(); - fdbg("ERROR: psock_recvfrom failed: %d\n", error); + ferr("ERROR: psock_recvfrom failed: %d\n", error); } return error; @@ -228,7 +228,7 @@ static int rpcclnt_reply(FAR struct rpcclnt *rpc, int procid, int prog, error = rpcclnt_receive(rpc, rpc->rc_name, procid, prog, reply, resplen); if (error != 0) { - fdbg("ERROR: rpcclnt_receive returned: %d\n", error); + ferr("ERROR: rpcclnt_receive returned: %d\n", error); /* If we failed because of a timeout, then try sending the CALL * message again. @@ -249,7 +249,7 @@ static int rpcclnt_reply(FAR struct rpcclnt *rpc, int procid, int prog, if (replyheader->rp_direction != rpc_reply) { - fdbg("ERROR: Different RPC REPLY returned\n"); + ferr("ERROR: Different RPC REPLY returned\n"); rpc_statistics(rpcinvalid); error = EPROTO; } @@ -396,7 +396,7 @@ int rpcclnt_connect(struct rpcclnt *rpc) so = (struct socket *)kmm_zalloc(sizeof(struct socket)); if (!so) { - fdbg("ERROR: Failed to allocate socket structure\n"); + ferr("ERROR: Failed to allocate socket structure\n"); return ENOMEM; } @@ -404,7 +404,7 @@ int rpcclnt_connect(struct rpcclnt *rpc) if (error < 0) { errval = get_errno(); - fdbg("ERROR: psock_socket failed: %d", errval); + ferr("ERROR: psock_socket failed: %d", errval); return error; } @@ -423,7 +423,7 @@ int rpcclnt_connect(struct rpcclnt *rpc) if (error < 0) { errval = get_errno(); - fdbg("ERROR: psock_setsockopt failed: %d\n", errval); + ferr("ERROR: psock_setsockopt failed: %d\n", errval); goto bad; } @@ -445,14 +445,14 @@ int rpcclnt_connect(struct rpcclnt *rpc) if (error < 0) { errval = get_errno(); - fdbg("ERROR: psock_bind failed: %d\n", errval); + ferr("ERROR: psock_bind failed: %d\n", errval); } } while (errval == EADDRINUSE && tport > 1024 / 2); if (error) { - fdbg("ERROR: psock_bind failed: %d\n", errval); + ferr("ERROR: psock_bind failed: %d\n", errval); goto bad; } @@ -465,7 +465,7 @@ int rpcclnt_connect(struct rpcclnt *rpc) if (error < 0) { errval = get_errno(); - fdbg("ERROR: psock_connect to PMAP port failed: %d", errval); + ferr("ERROR: psock_connect to PMAP port failed: %d", errval); goto bad; } @@ -483,7 +483,7 @@ int rpcclnt_connect(struct rpcclnt *rpc) (FAR void *)&response.rdata, sizeof(struct rpc_reply_pmap)); if (error != 0) { - fdbg("ERROR: rpcclnt_request failed: %d\n", error); + ferr("ERROR: rpcclnt_request failed: %d\n", error); goto bad; } @@ -494,7 +494,7 @@ int rpcclnt_connect(struct rpcclnt *rpc) if (error < 0) { errval = get_errno(); - fdbg("ERROR: psock_connect MOUNTD port failed: %d\n", errval); + ferr("ERROR: psock_connect MOUNTD port failed: %d\n", errval); goto bad; } @@ -508,14 +508,14 @@ int rpcclnt_connect(struct rpcclnt *rpc) (FAR void *)&response.mdata, sizeof(struct rpc_reply_mount)); if (error != 0) { - fdbg("ERROR: rpcclnt_request failed: %d\n", error); + ferr("ERROR: rpcclnt_request failed: %d\n", error); goto bad; } error = fxdr_unsigned(uint32_t, response.mdata.mount.status); if (error != 0) { - fdbg("ERROR: Bad mount status: %d\n", error); + ferr("ERROR: Bad mount status: %d\n", error); goto bad; } @@ -531,7 +531,7 @@ int rpcclnt_connect(struct rpcclnt *rpc) if (error < 0) { errval = get_errno(); - fdbg("ERROR: psock_connect PMAP port failed: %d\n", errval); + ferr("ERROR: psock_connect PMAP port failed: %d\n", errval); goto bad; } @@ -545,7 +545,7 @@ int rpcclnt_connect(struct rpcclnt *rpc) (FAR void *)&response.rdata, sizeof(struct rpc_reply_pmap)); if (error != 0) { - fdbg("ERROR: rpcclnt_request failed: %d\n", error); + ferr("ERROR: rpcclnt_request failed: %d\n", error); goto bad; } @@ -554,7 +554,7 @@ int rpcclnt_connect(struct rpcclnt *rpc) error = psock_connect(rpc->rc_so, saddr, sizeof(*saddr)); if (error) { - fdbg("psock_connect NFS port returns %d\n", error); + ferr("psock_connect NFS port returns %d\n", error); goto bad; } @@ -622,7 +622,7 @@ int rpcclnt_umount(struct rpcclnt *rpc) if (ret < 0) { error = get_errno(); - fdbg("ERROR: psock_connect failed [port=%d]: %d\n", + ferr("ERROR: psock_connect failed [port=%d]: %d\n", ntohs(sa->sin_port), error); goto bad; } @@ -637,7 +637,7 @@ int rpcclnt_umount(struct rpcclnt *rpc) (FAR void *)&response.rdata, sizeof(struct rpc_reply_pmap)); if (error != 0) { - fdbg("ERROR: rpcclnt_request failed: %d\n", error); + ferr("ERROR: rpcclnt_request failed: %d\n", error); goto bad; } @@ -647,7 +647,7 @@ int rpcclnt_umount(struct rpcclnt *rpc) if (ret < 0) { error = get_errno(); - fdbg("ERROR: psock_connect failed [port=%d]: %d\n", + ferr("ERROR: psock_connect failed [port=%d]: %d\n", ntohs(sa->sin_port), error); goto bad; } @@ -662,7 +662,7 @@ int rpcclnt_umount(struct rpcclnt *rpc) (FAR void *)&response.mdata, sizeof(struct rpc_reply_umount)); if (error != 0) { - fdbg("ERROR: rpcclnt_request failed: %d\n", error); + ferr("ERROR: rpcclnt_request failed: %d\n", error); goto bad; } @@ -751,7 +751,7 @@ int rpcclnt_request(FAR struct rpcclnt *rpc, int procnum, int prog, if (error != OK) { - fdbg("ERROR: RPC failed: %d\n", error); + ferr("ERROR: RPC failed: %d\n", error); return error; } @@ -766,11 +766,11 @@ int rpcclnt_request(FAR struct rpcclnt *rpc, int procnum, int prog, switch (tmp) { case RPC_MISMATCH: - fdbg("RPC_MSGDENIED: RPC_MISMATCH error\n"); + ferr("RPC_MSGDENIED: RPC_MISMATCH error\n"); return EOPNOTSUPP; case RPC_AUTHERR: - fdbg("RPC_MSGDENIED: RPC_AUTHERR error\n"); + ferr("RPC_MSGDENIED: RPC_AUTHERR error\n"); return EACCES; default: @@ -789,12 +789,12 @@ int rpcclnt_request(FAR struct rpcclnt *rpc, int procnum, int prog, } else if (tmp == RPC_PROGMISMATCH) { - fdbg("RPC_MSGACCEPTED: RPC_PROGMISMATCH error\n"); + ferr("RPC_MSGACCEPTED: RPC_PROGMISMATCH error\n"); return EOPNOTSUPP; } else if (tmp > 5) { - fdbg("ERROR: Other RPC type: %d\n", tmp); + ferr("ERROR: Other RPC type: %d\n", tmp); return EOPNOTSUPP; } diff --git a/fs/nxffs/nxffs_block.c b/fs/nxffs/nxffs_block.c index 490f302537..c1cad2afe4 100644 --- a/fs/nxffs/nxffs_block.c +++ b/fs/nxffs/nxffs_block.c @@ -89,7 +89,7 @@ int nxffs_verifyblock(FAR struct nxffs_volume_s *volume, off_t block) { /* Perhaps we are at the end of the media */ - fdbg("ERROR: Failed to read data into cache: %d\n", ret); + ferr("ERROR: Failed to read data into cache: %d\n", ret); return -EIO; } @@ -169,6 +169,6 @@ int nxffs_validblock(struct nxffs_volume_s *volume, off_t *block) * valid blocks left in the volume. */ - fdbg("ERROR: No valid block found\n"); + ferr("ERROR: No valid block found\n"); return -ENOSPC; } diff --git a/fs/nxffs/nxffs_blockstats.c b/fs/nxffs/nxffs_blockstats.c index 797cae2d4c..8ba53dec12 100644 --- a/fs/nxffs/nxffs_blockstats.c +++ b/fs/nxffs/nxffs_blockstats.c @@ -94,7 +94,7 @@ int nxffs_blockstats(FAR struct nxffs_volume_s *volume, ret = MTD_BREAD(volume->mtd, ioblock, volume->blkper, volume->pack); if (ret < volume->blkper) { - fdbg("ERROR: Failed to read erase block %d: %d\n", + ferr("ERROR: Failed to read erase block %d: %d\n", ioblock / volume->blkper, ret); return ret; } @@ -147,11 +147,11 @@ int nxffs_blockstats(FAR struct nxffs_volume_s *volume, } } - fdbg("Number blocks: %d\n", stats->nblocks); - fdbg(" Good blocks: %d\n", stats->ngood); - fdbg(" Bad blocks: %d\n", stats->nbad); - fdbg(" Unformatted blocks: %d\n", stats->nunformat); - fdbg(" Corrupt blocks: %d\n", stats->ncorrupt); + ferr("Number blocks: %d\n", stats->nblocks); + ferr(" Good blocks: %d\n", stats->ngood); + ferr(" Bad blocks: %d\n", stats->nbad); + ferr(" Unformatted blocks: %d\n", stats->nunformat); + ferr(" Corrupt blocks: %d\n", stats->ncorrupt); #else for (ioblock = 0; ioblock < volume->nblocks; ioblock++) @@ -175,7 +175,7 @@ int nxffs_blockstats(FAR struct nxffs_volume_s *volume, * of unreadable blocks. */ - fdbg("ERROR: Failed to read block %d: %d\n", ioblock, ret); + ferr("ERROR: Failed to read block %d: %d\n", ioblock, ret); /* Increment the count of un-readable blocks */ @@ -221,12 +221,12 @@ int nxffs_blockstats(FAR struct nxffs_volume_s *volume, } } - fdbg("Number blocks: %d\n", stats->nblocks); - fdbg(" Good blocks: %d\n", stats->ngood); - fdbg(" Bad blocks: %d\n", stats->nbad); - fdbg(" Unformatted blocks: %d\n", stats->nunformat); - fdbg(" Corrupt blocks: %d\n", stats->ncorrupt); - fdbg(" Unreadable blocks: %d\n", stats->nbadread); + ferr("Number blocks: %d\n", stats->nblocks); + ferr(" Good blocks: %d\n", stats->ngood); + ferr(" Bad blocks: %d\n", stats->nbad); + ferr(" Unformatted blocks: %d\n", stats->nunformat); + ferr(" Corrupt blocks: %d\n", stats->ncorrupt); + ferr(" Unreadable blocks: %d\n", stats->nbadread); #endif return OK; diff --git a/fs/nxffs/nxffs_cache.c b/fs/nxffs/nxffs_cache.c index 32c9756a05..6a5c4c028f 100644 --- a/fs/nxffs/nxffs_cache.c +++ b/fs/nxffs/nxffs_cache.c @@ -98,7 +98,7 @@ int nxffs_rdcache(FAR struct nxffs_volume_s *volume, off_t block) nxfrd = MTD_BREAD(volume->mtd, block, 1, volume->cache); if (nxfrd != 1) { - fdbg("ERROR: Read block %d failed: %d\n", block, nxfrd); + ferr("ERROR: Read block %d failed: %d\n", block, nxfrd); return -EIO; } @@ -133,7 +133,7 @@ int nxffs_wrcache(FAR struct nxffs_volume_s *volume) nxfrd = MTD_BWRITE(volume->mtd, volume->cblock, 1, volume->cache); if (nxfrd != 1) { - fdbg("ERROR: Write block %d failed: %d\n", volume->cblock, nxfrd); + ferr("ERROR: Write block %d failed: %d\n", volume->cblock, nxfrd); return -EIO; } @@ -249,7 +249,7 @@ int nxffs_getc(FAR struct nxffs_volume_s *volume, uint16_t reserve) #ifndef CONFIG_NXFFS_NAND /* Read errors are fatal */ - fdbg("ERROR: Failed to read valid data into cache: %d\n", ret); + ferr("ERROR: Failed to read valid data into cache: %d\n", ret); return ret; #else /* A read error occurred. This probably means that we are @@ -258,7 +258,7 @@ int nxffs_getc(FAR struct nxffs_volume_s *volume, uint16_t reserve) * block. */ - fdbg("ERROR: Failed to read valid data into cache: %d\n", ret); + ferr("ERROR: Failed to read valid data into cache: %d\n", ret); #endif } } diff --git a/fs/nxffs/nxffs_dump.c b/fs/nxffs/nxffs_dump.c index 1bfba3177e..a76c503e27 100644 --- a/fs/nxffs/nxffs_dump.c +++ b/fs/nxffs/nxffs_dump.c @@ -432,7 +432,7 @@ int nxffs_dump(FAR struct mtd_dev_s *mtd, bool verbose) ret = MTD_IOCTL(mtd, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&blkinfo.geo)); if (ret < 0) { - fdbg("ERROR: MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", -ret); + ferr("ERROR: MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", -ret); return ret; } @@ -445,7 +445,7 @@ int nxffs_dump(FAR struct mtd_dev_s *mtd, bool verbose) blkinfo.buffer = (FAR uint8_t *)kmm_malloc(blkinfo.geo.blocksize); if (!blkinfo.buffer) { - fdbg("ERROR: Failed to allocate block cache\n"); + ferr("ERROR: Failed to allocate block cache\n"); return -ENOMEM; } @@ -467,7 +467,7 @@ int nxffs_dump(FAR struct mtd_dev_s *mtd, bool verbose) #ifndef CONFIG_NXFFS_NAND /* Read errors are fatal */ - fdbg("ERROR: Failed to read block %d\n", blkinfo.block); + ferr("ERROR: Failed to read block %d\n", blkinfo.block); kmm_free(blkinfo.buffer); return ret; #else diff --git a/fs/nxffs/nxffs_initialize.c b/fs/nxffs/nxffs_initialize.c index 6a5aa49e91..217f0963f9 100644 --- a/fs/nxffs/nxffs_initialize.c +++ b/fs/nxffs/nxffs_initialize.c @@ -190,7 +190,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd) ret = MTD_IOCTL(mtd, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&volume->geo)); if (ret < 0) { - fdbg("ERROR: MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", -ret); + ferr("ERROR: MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", -ret); goto errout_with_volume; } @@ -199,7 +199,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd) volume->cache = (FAR uint8_t *)kmm_malloc(volume->geo.blocksize); if (!volume->cache) { - fdbg("ERROR: Failed to allocate an erase block buffer\n"); + ferr("ERROR: Failed to allocate an erase block buffer\n"); ret = -ENOMEM; goto errout_with_volume; } @@ -212,7 +212,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd) volume->pack = (FAR uint8_t *)kmm_malloc(volume->geo.erasesize); if (!volume->pack) { - fdbg("ERROR: Failed to allocate an I/O block buffer\n"); + ferr("ERROR: Failed to allocate an I/O block buffer\n"); ret = -ENOMEM; goto errout_with_cache; } @@ -231,7 +231,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd) ret = nxffs_blockstats(volume, &stats); if (ret < 0) { - fdbg("ERROR: Failed to collect block statistics: %d\n", -ret); + ferr("ERROR: Failed to collect block statistics: %d\n", -ret); goto errout_with_buffer; } @@ -247,7 +247,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd) ret = nxffs_reformat(volume); if (ret < 0) { - fdbg("ERROR: Failed to reformat the volume: %d\n", -ret); + ferr("ERROR: Failed to reformat the volume: %d\n", -ret); goto errout_with_buffer; } @@ -257,7 +257,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd) ret = nxffs_blockstats(volume, &stats); if (ret < 0) { - fdbg("ERROR: Failed to collect block statistics: %d\n", -ret); + ferr("ERROR: Failed to collect block statistics: %d\n", -ret); goto errout_with_buffer; } #endif @@ -274,11 +274,11 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd) /* We may need to format the volume. Try that before giving up. */ - fdbg("WARNING: Failed to calculate file system limits: %d\n", -ret); + ferr("WARNING: Failed to calculate file system limits: %d\n", -ret); ret = nxffs_reformat(volume); if (ret < 0) { - fdbg("ERROR: Failed to reformat the volume: %d\n", -ret); + ferr("ERROR: Failed to reformat the volume: %d\n", -ret); goto errout_with_buffer; } @@ -288,7 +288,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd) ret = nxffs_blockstats(volume, &stats); if (ret < 0) { - fdbg("ERROR: Failed to collect block statistics: %d\n", -ret); + ferr("ERROR: Failed to collect block statistics: %d\n", -ret); goto errout_with_buffer; } #endif @@ -303,7 +303,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd) /* Now give up */ - fdbg("ERROR: Failed to calculate file system limits: %d\n", -ret); + ferr("ERROR: Failed to calculate file system limits: %d\n", -ret); errout_with_buffer: kmm_free(volume->pack); @@ -356,7 +356,7 @@ int nxffs_limits(FAR struct nxffs_volume_s *volume) ret = nxffs_validblock(volume, &block); if (ret < 0) { - fdbg("ERROR: Failed to find a valid block: %d\n", -ret); + ferr("ERROR: Failed to find a valid block: %d\n", -ret); return ret; } @@ -374,7 +374,7 @@ int nxffs_limits(FAR struct nxffs_volume_s *volume) if (ret != -ENOENT) { - fdbg("ERROR: nxffs_nextentry failed: %d\n", -ret); + ferr("ERROR: nxffs_nextentry failed: %d\n", -ret); return ret; } @@ -447,7 +447,7 @@ int nxffs_limits(FAR struct nxffs_volume_s *volume) /* No? Then it is some other failure that we do not know how to handle */ - fdbg("ERROR: nxffs_getc failed: %d\n", -ch); + ferr("ERROR: nxffs_getc failed: %d\n", -ch); return ch; } diff --git a/fs/nxffs/nxffs_inode.c b/fs/nxffs/nxffs_inode.c index 02d609832d..2240c18313 100644 --- a/fs/nxffs/nxffs_inode.c +++ b/fs/nxffs/nxffs_inode.c @@ -125,7 +125,7 @@ static int nxffs_rdentry(FAR struct nxffs_volume_s *volume, off_t offset, entry->name = (FAR char *)kmm_malloc(namlen + 1); if (!entry->name) { - fdbg("ERROR: Failed to allocate name, namlen: %d\n", namlen); + ferr("ERROR: Failed to allocate name, namlen: %d\n", namlen); ret = -ENOMEM; goto errout_no_offset; } @@ -141,7 +141,7 @@ static int nxffs_rdentry(FAR struct nxffs_volume_s *volume, off_t offset, ret = nxffs_rdcache(volume, volume->ioblock); if (ret < 0) { - fdbg("ERROR: nxffsx_rdcache failed: %d\n", -ret); + ferr("ERROR: nxffsx_rdcache failed: %d\n", -ret); goto errout_with_name; } @@ -155,7 +155,7 @@ static int nxffs_rdentry(FAR struct nxffs_volume_s *volume, off_t offset, crc = crc32part((FAR const uint8_t *)entry->name, namlen, crc); if (crc != ecrc) { - fdbg("ERROR: CRC entry: %08x CRC calculated: %08x\n", ecrc, crc); + ferr("ERROR: CRC entry: %08x CRC calculated: %08x\n", ecrc, crc); ret = -EIO; goto errout_with_name; } @@ -271,7 +271,7 @@ int nxffs_nextentry(FAR struct nxffs_volume_s *volume, off_t offset, ch = nxffs_getc(volume, SIZEOF_NXFFS_INODE_HDR - nmagic); if (ch < 0) { - fdbg("ERROR: nxffs_getc failed: %d\n", -ch); + ferr("ERROR: nxffs_getc failed: %d\n", -ch); return ch; } diff --git a/fs/nxffs/nxffs_ioctl.c b/fs/nxffs/nxffs_ioctl.c index 7d6219eaab..bbe6bbd745 100644 --- a/fs/nxffs/nxffs_ioctl.c +++ b/fs/nxffs/nxffs_ioctl.c @@ -88,7 +88,7 @@ int nxffs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) if (ret != OK) { ret = -get_errno(); - fdbg("ERROR: sem_wait failed: %d\n", ret); + ferr("ERROR: sem_wait failed: %d\n", ret); goto errout; } @@ -102,7 +102,7 @@ int nxffs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) if (volume->ofiles) { - fdbg("ERROR: Open files\n"); + ferr("ERROR: Open files\n"); ret = -EBUSY; goto errout_with_semaphore; } diff --git a/fs/nxffs/nxffs_open.c b/fs/nxffs/nxffs_open.c index 64db270426..8807e53bc5 100644 --- a/fs/nxffs/nxffs_open.c +++ b/fs/nxffs/nxffs_open.c @@ -345,7 +345,7 @@ static inline int nxffs_wrname(FAR struct nxffs_volume_s *volume, ret = nxffs_rdcache(volume, volume->ioblock); if (ret < 0) { - fdbg("ERROR: Failed to read inode name block %d: %d\n", + ferr("ERROR: Failed to read inode name block %d: %d\n", volume->ioblock, -ret); return ret; } @@ -356,7 +356,7 @@ static inline int nxffs_wrname(FAR struct nxffs_volume_s *volume, ret = nxffs_wrcache(volume); if (ret < 0) { - fdbg("ERROR: Failed to write inode header block %d: %d\n", + ferr("ERROR: Failed to write inode header block %d: %d\n", volume->ioblock, -ret); } @@ -391,7 +391,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume, ret = sem_wait(&volume->wrsem); if (ret != OK) { - fdbg("ERROR: sem_wait failed: %d\n", ret); + ferr("ERROR: sem_wait failed: %d\n", ret); ret = -get_errno(); goto errout; } @@ -404,7 +404,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume, ret = sem_wait(&volume->exclsem); if (ret != OK) { - fdbg("ERROR: sem_wait failed: %d\n", ret); + ferr("ERROR: sem_wait failed: %d\n", ret); ret = -get_errno(); goto errout_with_wrsem; } @@ -429,7 +429,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume, * Limitation: Files cannot be open both for reading and writing. */ - fdbg("ERROR: File is open for reading\n"); + ferr("ERROR: File is open for reading\n"); ret = -ENOSYS; goto errout_with_exclsem; } @@ -440,7 +440,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume, else if ((oflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) { - fdbg("ERROR: File exists, can't create O_EXCL\n"); + ferr("ERROR: File exists, can't create O_EXCL\n"); ret = -EEXIST; goto errout_with_exclsem; } @@ -466,7 +466,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume, else { - fdbg("ERROR: File %s exists and we were not asked to truncate it\n"); + ferr("ERROR: File %s exists and we were not asked to truncate it\n"); ret = -ENOSYS; goto errout_with_exclsem; } @@ -478,7 +478,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume, if ((oflags & O_CREAT) == 0) { - fdbg("ERROR: Not asked to create the file\n"); + ferr("ERROR: Not asked to create the file\n"); ret = -ENOENT; goto errout_with_exclsem; } @@ -488,7 +488,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume, namlen = strlen(name); if (namlen > CONFIG_NXFFS_MAXNAMLEN) { - fdbg("ERROR: Name is too long: %d\n", namlen); + ferr("ERROR: Name is too long: %d\n", namlen); ret = -EINVAL; goto errout_with_exclsem; } @@ -562,7 +562,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume, if (ret != -ENOSPC || packed) { - fdbg("ERROR: Failed to find inode header memory: %d\n", -ret); + ferr("ERROR: Failed to find inode header memory: %d\n", -ret); goto errout_with_name; } @@ -573,7 +573,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume, ret = nxffs_pack(volume); if (ret < 0) { - fdbg("ERROR: Failed to pack the volume: %d\n", -ret); + ferr("ERROR: Failed to pack the volume: %d\n", -ret); goto errout_with_name; } @@ -609,7 +609,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume, ret = nxffs_wrname(volume, &wrfile->ofile.entry, namlen); if (ret < 0) { - fdbg("ERROR: Failed to write the inode name: %d\n", -ret); + ferr("ERROR: Failed to write the inode name: %d\n", -ret); goto errout_with_name; } @@ -628,7 +628,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume, if (ret != -ENOSPC || packed) { - fdbg("ERROR: Failed to find inode name memory: %d\n", -ret); + ferr("ERROR: Failed to find inode name memory: %d\n", -ret); goto errout_with_name; } @@ -639,7 +639,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume, ret = nxffs_pack(volume); if (ret < 0) { - fdbg("ERROR: Failed to pack the volume: %d\n", -ret); + ferr("ERROR: Failed to pack the volume: %d\n", -ret); goto errout_with_name; } @@ -702,7 +702,7 @@ static inline int nxffs_rdopen(FAR struct nxffs_volume_s *volume, ret = sem_wait(&volume->exclsem); if (ret != OK) { - fdbg("ERROR: sem_wait failed: %d\n", ret); + ferr("ERROR: sem_wait failed: %d\n", ret); ret = -get_errno(); goto errout; } @@ -718,7 +718,7 @@ static inline int nxffs_rdopen(FAR struct nxffs_volume_s *volume, if ((ofile->oflags & O_WROK) != 0) { - fdbg("ERROR: File is open for writing\n"); + ferr("ERROR: File is open for writing\n"); ret = -ENOSYS; goto errout_with_exclsem; } @@ -741,7 +741,7 @@ static inline int nxffs_rdopen(FAR struct nxffs_volume_s *volume, ofile = (FAR struct nxffs_ofile_s *)kmm_zalloc(sizeof(struct nxffs_ofile_s)); if (!ofile) { - fdbg("ERROR: ofile allocation failed\n"); + ferr("ERROR: ofile allocation failed\n"); ret = -ENOMEM; goto errout_with_exclsem; } @@ -817,7 +817,7 @@ static inline void nxffs_remofile(FAR struct nxffs_volume_s *volume, } else { - fdbg("ERROR: Open inode %p not found\n", ofile); + ferr("ERROR: Open inode %p not found\n", ofile); } } @@ -878,7 +878,7 @@ static inline int nxffs_wrclose(FAR struct nxffs_volume_s *volume, ret = nxffs_wrblkhdr(volume, wrfile); if (ret < 0) { - fdbg("ERROR: Failed to write the final block of the file: %d\n", -ret); + ferr("ERROR: Failed to write the final block of the file: %d\n", -ret); goto errout; } } @@ -897,7 +897,7 @@ static inline int nxffs_wrclose(FAR struct nxffs_volume_s *volume, ret = nxffs_rminode(volume, wrfile->ofile.entry.name); if (ret < 0) { - fdbg("ERROR: nxffs_rminode failed: %d\n", -ret); + ferr("ERROR: nxffs_rminode failed: %d\n", -ret); goto errout; } } @@ -1028,7 +1028,7 @@ int nxffs_open(FAR struct file *filep, FAR const char *relpath, { case 0: default: - fdbg("ERROR: One of O_WRONLY/O_RDONLY must be provided\n"); + ferr("ERROR: One of O_WRONLY/O_RDONLY must be provided\n"); return -EINVAL; case O_WROK: @@ -1040,7 +1040,7 @@ int nxffs_open(FAR struct file *filep, FAR const char *relpath, break; case O_WROK | O_RDOK: - fdbg("ERROR: O_RDWR is not supported\n"); + ferr("ERROR: O_RDWR is not supported\n"); return -ENOSYS; } @@ -1149,7 +1149,7 @@ int nxffs_close(FAR struct file *filep) if (ret != OK) { ret = -get_errno(); - fdbg("ERROR: sem_wait failed: %d\n", ret); + ferr("ERROR: sem_wait failed: %d\n", ret); goto errout; } @@ -1230,7 +1230,7 @@ int nxffs_wrinode(FAR struct nxffs_volume_s *volume, ret = nxffs_rdcache(volume, volume->ioblock); if (ret < 0) { - fdbg("ERROR: Failed to read inode header block %d: %d\n", + ferr("ERROR: Failed to read inode header block %d: %d\n", volume->ioblock, -ret); goto errout; } @@ -1269,7 +1269,7 @@ int nxffs_wrinode(FAR struct nxffs_volume_s *volume, ret = nxffs_wrcache(volume); if (ret < 0) { - fdbg("ERROR: Failed to write inode header block %d: %d\n", + ferr("ERROR: Failed to write inode header block %d: %d\n", volume->ioblock, -ret); } diff --git a/fs/nxffs/nxffs_pack.c b/fs/nxffs/nxffs_pack.c index 0e816b359d..134ee430a6 100644 --- a/fs/nxffs/nxffs_pack.c +++ b/fs/nxffs/nxffs_pack.c @@ -331,7 +331,7 @@ static inline int nxffs_startpos(FAR struct nxffs_volume_s *volume, ret = nxffs_nextblock(volume, offset, &blkentry); if (ret < 0) { - fdbg("ERROR: Failed to find next data block: %d\n", -ret); + ferr("ERROR: Failed to find next data block: %d\n", -ret); return ret; } @@ -421,7 +421,7 @@ static int nxffs_srcsetup(FAR struct nxffs_volume_s *volume, int ret = nxffs_rdblkhdr(volume, offset, &pack->src.blklen); if (ret < 0) { - fdbg("ERROR: Failed to verify the data block header: %d\n", -ret); + ferr("ERROR: Failed to verify the data block header: %d\n", -ret); } return ret; @@ -706,7 +706,7 @@ static int nxffs_wrinodehdr(FAR struct nxffs_volume_s *volume, ret = nxffs_updateinode(volume, &pack->dest.entry); if (ret < 0) { - fdbg("ERROR: Failed to update inode info: %s\n", -ret); + ferr("ERROR: Failed to update inode info: %s\n", -ret); } } @@ -849,7 +849,7 @@ static int nxffs_endsrcblock(FAR struct nxffs_volume_s *volume, ret = nxffs_nextblock(volume, offset, &blkentry); if (ret < 0) { - fdbg("ERROR: Failed to find next data block: %d\n", -ret); + ferr("ERROR: Failed to find next data block: %d\n", -ret); return ret; } @@ -893,7 +893,7 @@ static inline int nxffs_packblock(FAR struct nxffs_volume_s *volume, ret = nxffs_srcsetup(volume, pack, pack->src.entry.doffset); if (ret < 0) { - fdbg("ERROR: Failed to configure the src stream: %d\n", -ret); + ferr("ERROR: Failed to configure the src stream: %d\n", -ret); return ret; } } @@ -919,7 +919,7 @@ static inline int nxffs_packblock(FAR struct nxffs_volume_s *volume, } else { - fdbg("ERROR: Failed to configure the dest stream: %d\n", -ret); + ferr("ERROR: Failed to configure the dest stream: %d\n", -ret); return ret; } } @@ -1011,7 +1011,7 @@ static inline int nxffs_packblock(FAR struct nxffs_volume_s *volume, } else { - fdbg("ERROR: Failed to configure the dest stream: %d\n", -ret); + ferr("ERROR: Failed to configure the dest stream: %d\n", -ret); return ret; } } @@ -1146,7 +1146,7 @@ static inline int nxffs_packwriter(FAR struct nxffs_volume_s *volume, ret = nxffs_srcsetup(volume, pack, pack->src.entry.doffset); if (ret < 0) { - fdbg("ERROR: Failed to configure the src stream: %d\n", -ret); + ferr("ERROR: Failed to configure the src stream: %d\n", -ret); return ret; } } @@ -1172,7 +1172,7 @@ static inline int nxffs_packwriter(FAR struct nxffs_volume_s *volume, } else { - fdbg("ERROR: Failed to configure the dest stream: %d\n", -ret); + ferr("ERROR: Failed to configure the dest stream: %d\n", -ret); return ret; } } @@ -1380,7 +1380,7 @@ int nxffs_pack(FAR struct nxffs_volume_s *volume) } else { - fdbg("ERROR: Failed to find a packing position: %d\n", -ret); + ferr("ERROR: Failed to find a packing position: %d\n", -ret); return ret; } } @@ -1418,7 +1418,7 @@ start_pack: ret = MTD_BREAD(volume->mtd, pack.block0, volume->blkper, volume->pack); if (ret < 0) { - fdbg("ERROR: Failed to read erase block %d: %d\n", eblock, -ret); + ferr("ERROR: Failed to read erase block %d: %d\n", eblock, -ret); goto errout_with_pack; } @@ -1446,7 +1446,7 @@ start_pack: { /* Force a the block to be an NXFFS bad block */ - fdbg("ERROR: Failed to read block %d: %d\n", block, ret); + ferr("ERROR: Failed to read block %d: %d\n", block, ret); nxffs_blkinit(volume, pack.iobuffer, BLOCK_STATE_BAD); } } @@ -1514,7 +1514,7 @@ start_pack: { /* Otherwise, something really bad happened */ - fdbg("ERROR: Failed to pack into block %d: %d\n", + ferr("ERROR: Failed to pack into block %d: %d\n", block, ret); goto errout_with_pack; } @@ -1546,7 +1546,7 @@ start_pack: { /* Otherwise, something really bad happened */ - fdbg("ERROR: Failed to pack into block %d: %d\n", + ferr("ERROR: Failed to pack into block %d: %d\n", block, ret); goto errout_with_pack; } @@ -1580,7 +1580,7 @@ start_pack: ret = MTD_ERASE(volume->mtd, eblock, 1); if (ret < 0) { - fdbg("ERROR: Failed to erase block %d [%d]: %d\n", + ferr("ERROR: Failed to erase block %d [%d]: %d\n", eblock, pack.block0, -ret); goto errout_with_pack; } @@ -1590,7 +1590,7 @@ start_pack: ret = MTD_BWRITE(volume->mtd, pack.block0, volume->blkper, volume->pack); if (ret < 0) { - fdbg("ERROR: Failed to write erase block %d [%d]: %d\n", + ferr("ERROR: Failed to write erase block %d [%d]: %d\n", eblock, pack.block0, -ret); goto errout_with_pack; } diff --git a/fs/nxffs/nxffs_read.c b/fs/nxffs/nxffs_read.c index 36ba8bd055..4a08a7998b 100644 --- a/fs/nxffs/nxffs_read.c +++ b/fs/nxffs/nxffs_read.c @@ -106,7 +106,7 @@ static ssize_t nxffs_rdseek(FAR struct nxffs_volume_s *volume, ret = nxffs_nextblock(volume, offset, blkentry); if (ret < 0) { - fdbg("ERROR: nxffs_nextblock failed: %d\n", -ret); + ferr("ERROR: nxffs_nextblock failed: %d\n", -ret); return ret; } @@ -173,7 +173,7 @@ ssize_t nxffs_read(FAR struct file *filep, FAR char *buffer, size_t buflen) if (ret != OK) { ret = -get_errno(); - fdbg("ERROR: sem_wait failed: %d\n", ret); + ferr("ERROR: sem_wait failed: %d\n", ret); goto errout; } @@ -181,7 +181,7 @@ ssize_t nxffs_read(FAR struct file *filep, FAR char *buffer, size_t buflen) if ((ofile->oflags & O_RDOK) == 0) { - fdbg("ERROR: File not open for read access\n"); + ferr("ERROR: File not open for read access\n"); ret = -EACCES; goto errout_with_semaphore; } @@ -205,7 +205,7 @@ ssize_t nxffs_read(FAR struct file *filep, FAR char *buffer, size_t buflen) ret = nxffs_rdseek(volume, &ofile->entry, filep->f_pos, &blkentry); if (ret < 0) { - fdbg("ERROR: nxffs_rdseek failed: %d\n", -ret); + ferr("ERROR: nxffs_rdseek failed: %d\n", -ret); ret = -EACCES; goto errout_with_semaphore; } @@ -289,7 +289,7 @@ int nxffs_nextblock(FAR struct nxffs_volume_s *volume, off_t offset, ch = nxffs_getc(volume, SIZEOF_NXFFS_DATA_HDR - nmagic); if (ch < 0) { - fdbg("ERROR: nxffs_getc failed: %d\n", -ch); + ferr("ERROR: nxffs_getc failed: %d\n", -ch); return ch; } @@ -412,7 +412,7 @@ int nxffs_rdblkhdr(FAR struct nxffs_volume_s *volume, off_t offset, ret = nxffs_rdcache(volume, volume->ioblock); if (ret < 0) { - fdbg("ERROR: Failed to read data into cache: %d\n", ret); + ferr("ERROR: Failed to read data into cache: %d\n", ret); return ret; } @@ -433,7 +433,7 @@ int nxffs_rdblkhdr(FAR struct nxffs_volume_s *volume, off_t offset, if ((uint32_t)doffset + (uint32_t)dlen > (uint32_t)volume->geo.blocksize) { - fdbg("ERROR: Data length=%d is unreasonable at offset=%d\n", dlen, doffset); + ferr("ERROR: Data length=%d is unreasonable at offset=%d\n", dlen, doffset); return -EIO; } @@ -447,7 +447,7 @@ int nxffs_rdblkhdr(FAR struct nxffs_volume_s *volume, off_t offset, if (crc != ecrc) { - fdbg("ERROR: CRC failure\n"); + ferr("ERROR: CRC failure\n"); return -EIO; } diff --git a/fs/nxffs/nxffs_reformat.c b/fs/nxffs/nxffs_reformat.c index cf2639a047..8c3f73222c 100644 --- a/fs/nxffs/nxffs_reformat.c +++ b/fs/nxffs/nxffs_reformat.c @@ -96,7 +96,7 @@ static int nxffs_format(FAR struct nxffs_volume_s *volume) ret = MTD_ERASE(volume->mtd, eblock, 1); if (ret < 0) { - fdbg("ERROR: Erase block %d failed: %d\n", eblock, ret); + ferr("ERROR: Erase block %d failed: %d\n", eblock, ret); return ret; } @@ -106,7 +106,7 @@ static int nxffs_format(FAR struct nxffs_volume_s *volume) nxfrd = MTD_BWRITE(volume->mtd, lblock, volume->blkper, volume->pack); if (nxfrd != volume->blkper) { - fdbg("ERROR: Write erase block %d failed: %d\n", lblock, nxfrd); + ferr("ERROR: Write erase block %d failed: %d\n", lblock, nxfrd); return -EIO; } } @@ -157,7 +157,7 @@ static int nxffs_badblocks(FAR struct nxffs_volume_s *volume) nxfrd = MTD_BREAD(volume->mtd, lblock, volume->blkper, volume->pack); if (nxfrd != volume->blkper) { - fdbg("ERROR: Read erase block %d failed: %d\n", lblock, nxfrd); + ferr("ERROR: Read erase block %d failed: %d\n", lblock, nxfrd); return -EIO; } #endif @@ -195,7 +195,7 @@ static int nxffs_badblocks(FAR struct nxffs_volume_s *volume) * read a block with uncorrectable bit errors. */ - fdbg("ERROR: Failed to read block %d: %d\n", + ferr("ERROR: Failed to read block %d: %d\n", block, (int)nxfrd); good = false; @@ -244,7 +244,7 @@ static int nxffs_badblocks(FAR struct nxffs_volume_s *volume) nxfrd = MTD_BWRITE(volume->mtd, lblock, volume->blkper, volume->pack); if (nxfrd != volume->blkper) { - fdbg("ERROR: Write erase block %d failed: %d\n", lblock, nxfrd); + ferr("ERROR: Write erase block %d failed: %d\n", lblock, nxfrd); return -EIO; } } @@ -283,7 +283,7 @@ int nxffs_reformat(FAR struct nxffs_volume_s *volume) ret = nxffs_format(volume); if (ret < 0) { - fdbg("ERROR: Failed to reformat the volume: %d\n", -ret); + ferr("ERROR: Failed to reformat the volume: %d\n", -ret); return ret; } @@ -292,7 +292,7 @@ int nxffs_reformat(FAR struct nxffs_volume_s *volume) ret = nxffs_badblocks(volume); if (ret < 0) { - fdbg("ERROR: Bad block check failed: %d\n", -ret); + ferr("ERROR: Bad block check failed: %d\n", -ret); } return ret; diff --git a/fs/nxffs/nxffs_stat.c b/fs/nxffs/nxffs_stat.c index f47c55dbb8..bbbd2a82a7 100644 --- a/fs/nxffs/nxffs_stat.c +++ b/fs/nxffs/nxffs_stat.c @@ -145,7 +145,7 @@ int nxffs_stat(FAR struct inode *mountpt, FAR const char *relpath, ret = nxffs_findinode(volume, relpath, &entry); if (ret < 0) { - fdbg("ERROR: Inode '%s' not found: %d\n", -ret); + ferr("ERROR: Inode '%s' not found: %d\n", -ret); goto errout_with_semaphore; } diff --git a/fs/nxffs/nxffs_unlink.c b/fs/nxffs/nxffs_unlink.c index 9c9dbd4bdc..2ca09dc970 100644 --- a/fs/nxffs/nxffs_unlink.c +++ b/fs/nxffs/nxffs_unlink.c @@ -86,7 +86,7 @@ int nxffs_rminode(FAR struct nxffs_volume_s *volume, FAR const char *name) { /* We can't remove the inode if it is open */ - fdbg("ERROR: Inode '%s' is open\n", name); + ferr("ERROR: Inode '%s' is open\n", name); ret = -EBUSY; goto errout; } @@ -96,7 +96,7 @@ int nxffs_rminode(FAR struct nxffs_volume_s *volume, FAR const char *name) ret = nxffs_findinode(volume, name, &entry); if (ret < 0) { - fdbg("ERROR: Inode '%s' not found\n", name); + ferr("ERROR: Inode '%s' not found\n", name); goto errout; } @@ -111,7 +111,7 @@ int nxffs_rminode(FAR struct nxffs_volume_s *volume, FAR const char *name) ret = nxffs_rdcache(volume, volume->ioblock); if (ret < 0) { - fdbg("ERROR: Failed to read block %d into cache: %d\n", + ferr("ERROR: Failed to read block %d into cache: %d\n", volume->ioblock, ret); goto errout_with_entry; } @@ -126,7 +126,7 @@ int nxffs_rminode(FAR struct nxffs_volume_s *volume, FAR const char *name) ret = nxffs_wrcache(volume); if (ret < 0) { - fdbg("ERROR: Failed to write block %d: %d\n", + ferr("ERROR: Failed to write block %d: %d\n", volume->ioblock, ret); } diff --git a/fs/nxffs/nxffs_write.c b/fs/nxffs/nxffs_write.c index f07f43da14..1ce11f4286 100644 --- a/fs/nxffs/nxffs_write.c +++ b/fs/nxffs/nxffs_write.c @@ -239,7 +239,7 @@ static inline int nxffs_wralloc(FAR struct nxffs_volume_s *volume, if (ret != -ENOSPC || packed) { - fdbg("ERROR: Failed to find inode header memory: %d\n", -ret); + ferr("ERROR: Failed to find inode header memory: %d\n", -ret); return -ENOSPC; } @@ -250,7 +250,7 @@ static inline int nxffs_wralloc(FAR struct nxffs_volume_s *volume, ret = nxffs_pack(volume); if (ret < 0) { - fdbg("ERROR: Failed to pack the volume: %d\n", -ret); + ferr("ERROR: Failed to pack the volume: %d\n", -ret); return ret; } @@ -309,7 +309,7 @@ static inline int nxffs_reverify(FAR struct nxffs_volume_s *volume, if (crc != wrfile->crc) { - fdbg("ERROR: CRC failure\n"); + ferr("ERROR: CRC failure\n"); return -EIO; } } @@ -389,7 +389,7 @@ static inline ssize_t nxffs_wrappend(FAR struct nxffs_volume_s *volume, ret = nxffs_wrcache(volume); if (ret < 0) { - fdbg("ERROR: nxffs_wrcache failed: %d\n", -ret); + ferr("ERROR: nxffs_wrcache failed: %d\n", -ret); return ret; } } @@ -404,7 +404,7 @@ static inline ssize_t nxffs_wrappend(FAR struct nxffs_volume_s *volume, ret = nxffs_wrblkhdr(volume, wrfile); if (ret < 0) { - fdbg("ERROR: nxffs_wrblkdhr failed: %d\n", -ret); + ferr("ERROR: nxffs_wrblkdhr failed: %d\n", -ret); return ret; } } @@ -459,7 +459,7 @@ ssize_t nxffs_write(FAR struct file *filep, FAR const char *buffer, size_t bufle if (ret != OK) { ret = -get_errno(); - fdbg("ERROR: sem_wait failed: %d\n", ret); + ferr("ERROR: sem_wait failed: %d\n", ret); goto errout; } @@ -467,7 +467,7 @@ ssize_t nxffs_write(FAR struct file *filep, FAR const char *buffer, size_t bufle if ((wrfile->ofile.oflags & O_WROK) == 0) { - fdbg("ERROR: File not open for write access\n"); + ferr("ERROR: File not open for write access\n"); ret = -EACCES; goto errout_with_semaphore; } @@ -490,7 +490,7 @@ ssize_t nxffs_write(FAR struct file *filep, FAR const char *buffer, size_t bufle ret = nxffs_wralloc(volume, wrfile, remaining); if (ret < 0) { - fdbg("ERROR: Failed to allocate a data block: %d\n", -ret); + ferr("ERROR: Failed to allocate a data block: %d\n", -ret); goto errout_with_semaphore; } } @@ -504,7 +504,7 @@ ssize_t nxffs_write(FAR struct file *filep, FAR const char *buffer, size_t bufle ret = nxffs_reverify(volume, wrfile); if (ret < 0) { - fdbg("ERROR: Failed to verify FLASH data block: %d\n", -ret); + ferr("ERROR: Failed to verify FLASH data block: %d\n", -ret); goto errout_with_semaphore; } @@ -515,7 +515,7 @@ ssize_t nxffs_write(FAR struct file *filep, FAR const char *buffer, size_t bufle nwritten = nxffs_wrappend(volume, wrfile, &buffer[total], remaining); if (nwritten < 0) { - fdbg("ERROR: Failed to append to FLASH to a data block: %d\n", -ret); + ferr("ERROR: Failed to append to FLASH to a data block: %d\n", -ret); goto errout_with_semaphore; } @@ -607,7 +607,7 @@ int nxffs_wrreserve(FAR struct nxffs_volume_s *volume, size_t size) { /* Return -ENOSPC to indicate that the volume is full */ - fdbg("ERROR: No space in last block\n"); + ferr("ERROR: No space in last block\n"); return -ENOSPC; } @@ -619,7 +619,7 @@ int nxffs_wrreserve(FAR struct nxffs_volume_s *volume, size_t size) ret = nxffs_validblock(volume, &volume->ioblock); if (ret < 0) { - fdbg("ERROR: No more valid blocks\n"); + ferr("ERROR: No more valid blocks\n"); return ret; } @@ -695,7 +695,7 @@ int nxffs_wrverify(FAR struct nxffs_volume_s *volume, size_t size) * the block has uncorrectable bit errors. */ - fdbg("ERROR: Failed to read block %d: %d\n", + ferr("ERROR: Failed to read block %d: %d\n", volume->ioblock, -ret); } @@ -754,7 +754,7 @@ int nxffs_wrverify(FAR struct nxffs_volume_s *volume, size_t size) ret = nxffs_validblock(volume, &volume->ioblock); if (ret < 0) { - fdbg("ERROR: No more valid blocks\n"); + ferr("ERROR: No more valid blocks\n"); return ret; } @@ -766,7 +766,7 @@ int nxffs_wrverify(FAR struct nxffs_volume_s *volume, size_t size) * the object. */ - fdbg("ERROR: Not enough memory left to hold the file header\n"); + ferr("ERROR: Not enough memory left to hold the file header\n"); return -ENOSPC; } @@ -812,7 +812,7 @@ int nxffs_wrblkhdr(FAR struct nxffs_volume_s *volume, ret = nxffs_wrcache(volume); if (ret < 0) { - fdbg("ERROR: nxffs_wrcache failed: %d\n", -ret); + ferr("ERROR: nxffs_wrcache failed: %d\n", -ret); goto errout; } diff --git a/fs/procfs/fs_procfs.c b/fs/procfs/fs_procfs.c index 6b0ee4e3c0..b350809c97 100644 --- a/fs/procfs/fs_procfs.c +++ b/fs/procfs/fs_procfs.c @@ -496,7 +496,7 @@ static int procfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, if (!level0) { - fdbg("ERROR: Failed to allocate the level0 directory structure\n"); + ferr("ERROR: Failed to allocate the level0 directory structure\n"); return -ENOMEM; } @@ -575,7 +575,7 @@ static int procfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, if (!level1) { - fdbg("ERROR: Failed to allocate the level0 directory structure\n"); + ferr("ERROR: Failed to allocate the level0 directory structure\n"); return -ENOMEM; } @@ -757,7 +757,7 @@ static int procfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir) if (!tcb) { - fdbg("ERROR: PID %d is no longer valid\n", (int)pid); + ferr("ERROR: PID %d is no longer valid\n", (int)pid); return -ENOENT; } diff --git a/fs/procfs/fs_procfscpuload.c b/fs/procfs/fs_procfscpuload.c index 02d216e409..593c0c5281 100644 --- a/fs/procfs/fs_procfscpuload.c +++ b/fs/procfs/fs_procfscpuload.c @@ -148,7 +148,7 @@ static int cpuload_open(FAR struct file *filep, FAR const char *relpath, if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - fdbg("ERROR: Only O_RDONLY supported\n"); + ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; } @@ -156,7 +156,7 @@ static int cpuload_open(FAR struct file *filep, FAR const char *relpath, if (strcmp(relpath, "cpuload") != 0) { - fdbg("ERROR: relpath is '%s'\n", relpath); + ferr("ERROR: relpath is '%s'\n", relpath); return -ENOENT; } @@ -165,7 +165,7 @@ static int cpuload_open(FAR struct file *filep, FAR const char *relpath, attr = (FAR struct cpuload_file_s *)kmm_zalloc(sizeof(struct cpuload_file_s)); if (!attr) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -300,7 +300,7 @@ static int cpuload_dup(FAR const struct file *oldp, FAR struct file *newp) newattr = (FAR struct cpuload_file_s *)kmm_malloc(sizeof(struct cpuload_file_s)); if (!newattr) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -327,7 +327,7 @@ static int cpuload_stat(const char *relpath, struct stat *buf) if (strcmp(relpath, "cpuload") != 0) { - fdbg("ERROR: relpath is '%s'\n", relpath); + ferr("ERROR: relpath is '%s'\n", relpath); return -ENOENT; } diff --git a/fs/procfs/fs_procfskmm.c b/fs/procfs/fs_procfskmm.c index 4589de4a88..ab0c6779ec 100644 --- a/fs/procfs/fs_procfskmm.c +++ b/fs/procfs/fs_procfskmm.c @@ -147,7 +147,7 @@ static int kmm_open(FAR struct file *filep, FAR const char *relpath, if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - fdbg("ERROR: Only O_RDONLY supported\n"); + ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; } @@ -155,7 +155,7 @@ static int kmm_open(FAR struct file *filep, FAR const char *relpath, if (strcmp(relpath, "kmm") != 0) { - fdbg("ERROR: relpath is '%s'\n", relpath); + ferr("ERROR: relpath is '%s'\n", relpath); return -ENOENT; } @@ -164,7 +164,7 @@ static int kmm_open(FAR struct file *filep, FAR const char *relpath, procfile = (FAR struct kmm_file_s *)kmm_zalloc(sizeof(struct kmm_file_s)); if (!procfile) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -279,7 +279,7 @@ static int kmm_dup(FAR const struct file *oldp, FAR struct file *newp) newattr = (FAR struct kmm_file_s *)kmm_malloc(sizeof(struct kmm_file_s)); if (!newattr) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -306,7 +306,7 @@ static int kmm_stat(FAR const char *relpath, FAR struct stat *buf) if (strcmp(relpath, "kmm") != 0) { - fdbg("ERROR: relpath is '%s'\n", relpath); + ferr("ERROR: relpath is '%s'\n", relpath); return -ENOENT; } diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c index d7cb3f8813..79abd759ef 100644 --- a/fs/procfs/fs_procfsproc.c +++ b/fs/procfs/fs_procfsproc.c @@ -1023,7 +1023,7 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath, if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - fdbg("ERROR: Only O_RDONLY supported\n"); + ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; } @@ -1034,7 +1034,7 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath, if (!ptr || *ptr != '/') { - fdbg("ERROR: Invalid path \"%s\"\n", relpath); + ferr("ERROR: Invalid path \"%s\"\n", relpath); return -ENOENT; } @@ -1048,7 +1048,7 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath, if (tmp >= 32768) { - fdbg("ERROR: Invalid PID %ld\n", tmp); + ferr("ERROR: Invalid PID %ld\n", tmp); return -ENOENT; } @@ -1062,7 +1062,7 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath, if (!tcb) { - fdbg("ERROR: PID %d is no longer valid\n", (int)pid); + ferr("ERROR: PID %d is no longer valid\n", (int)pid); return -ENOENT; } @@ -1073,7 +1073,7 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath, node = proc_findnode(ptr); if (!node) { - fdbg("ERROR: Invalid path \"%s\"\n", relpath); + ferr("ERROR: Invalid path \"%s\"\n", relpath); return -ENOENT; } @@ -1081,7 +1081,7 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath, if (!DIRENT_ISFILE(node->dtype)) { - fdbg("ERROR: Path \"%s\" is not a regular file\n", relpath); + ferr("ERROR: Path \"%s\" is not a regular file\n", relpath); return -EISDIR; } @@ -1090,7 +1090,7 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath, procfile = (FAR struct proc_file_s *)kmm_zalloc(sizeof(struct proc_file_s)); if (!procfile) { - fdbg("ERROR: Failed to allocate file container\n"); + ferr("ERROR: Failed to allocate file container\n"); return -ENOMEM; } @@ -1151,7 +1151,7 @@ static ssize_t proc_read(FAR struct file *filep, FAR char *buffer, if (!tcb) { - fdbg("ERROR: PID %d is not valid\n", (int)procfile->pid); + ferr("ERROR: PID %d is not valid\n", (int)procfile->pid); leave_critical_section(flags); return -ENODEV; } @@ -1227,7 +1227,7 @@ static int proc_dup(FAR const struct file *oldp, FAR struct file *newp) newfile = (FAR struct proc_file_s *)kmm_malloc(sizeof(struct proc_file_s)); if (!newfile) { - fdbg("ERROR: Failed to allocate file container\n"); + ferr("ERROR: Failed to allocate file container\n"); return -ENOMEM; } @@ -1277,7 +1277,7 @@ static int proc_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) { /* strtoul failed or there is something in the path after the pid */ - fdbg("ERROR: Invalid path \"%s\"\n", relpath); + ferr("ERROR: Invalid path \"%s\"\n", relpath); return -ENOENT; } @@ -1287,7 +1287,7 @@ static int proc_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) if (tmp >= 32768) { - fdbg("ERROR: Invalid PID %ld\n", tmp); + ferr("ERROR: Invalid PID %ld\n", tmp); return -ENOENT; } @@ -1301,7 +1301,7 @@ static int proc_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) if (!tcb) { - fdbg("ERROR: PID %d is not valid\n", (int)pid); + ferr("ERROR: PID %d is not valid\n", (int)pid); return -ENOENT; } @@ -1313,7 +1313,7 @@ static int proc_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) procdir = (FAR struct proc_dir_s *)kmm_zalloc(sizeof(struct proc_dir_s)); if (!procdir) { - fdbg("ERROR: Failed to allocate the directory structure\n"); + ferr("ERROR: Failed to allocate the directory structure\n"); return -ENOMEM; } @@ -1329,7 +1329,7 @@ static int proc_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) node = proc_findnode(ptr); if (!node) { - fdbg("ERROR: Invalid path \"%s\"\n", relpath); + ferr("ERROR: Invalid path \"%s\"\n", relpath); kmm_free(procdir); return -ENOENT; } @@ -1338,7 +1338,7 @@ static int proc_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) if (!DIRENT_ISDIRECTORY(node->dtype)) { - fdbg("ERROR: Path \"%s\" is not a directory\n", relpath); + ferr("ERROR: Path \"%s\" is not a directory\n", relpath); kmm_free(procdir); return -ENOTDIR; } @@ -1433,7 +1433,7 @@ static int proc_readdir(struct fs_dirent_s *dir) if (!tcb) { - fdbg("ERROR: PID %d is no longer valid\n", (int)pid); + ferr("ERROR: PID %d is no longer valid\n", (int)pid); return -ENOENT; } @@ -1519,7 +1519,7 @@ static int proc_stat(const char *relpath, struct stat *buf) if (!ptr) { - fdbg("ERROR: Invalid path \"%s\"\n", relpath); + ferr("ERROR: Invalid path \"%s\"\n", relpath); return -ENOENT; } @@ -1529,7 +1529,7 @@ static int proc_stat(const char *relpath, struct stat *buf) if (tmp >= 32768) { - fdbg("ERROR: Invalid PID %ld\n", tmp); + ferr("ERROR: Invalid PID %ld\n", tmp); return -ENOENT; } @@ -1543,7 +1543,7 @@ static int proc_stat(const char *relpath, struct stat *buf) if (!tcb) { - fdbg("ERROR: PID %d is no longer valid\n", (int)pid); + ferr("ERROR: PID %d is no longer valid\n", (int)pid); return -ENOENT; } @@ -1562,7 +1562,7 @@ static int proc_stat(const char *relpath, struct stat *buf) { /* We are required to return -ENOENT all all invalid paths */ - fdbg("ERROR: Bad delimiter '%c' in relpath '%s'\n", *ptr, relpath); + ferr("ERROR: Bad delimiter '%c' in relpath '%s'\n", *ptr, relpath); return -ENOENT; } else @@ -1580,7 +1580,7 @@ static int proc_stat(const char *relpath, struct stat *buf) node = proc_findnode(ptr); if (!node) { - fdbg("ERROR: Invalid path \"%s\"\n", relpath); + ferr("ERROR: Invalid path \"%s\"\n", relpath); return -ENOENT; } diff --git a/fs/procfs/fs_procfsuptime.c b/fs/procfs/fs_procfsuptime.c index 75d7510ed1..9a9f8de8ba 100644 --- a/fs/procfs/fs_procfsuptime.c +++ b/fs/procfs/fs_procfsuptime.c @@ -150,7 +150,7 @@ static int uptime_open(FAR struct file *filep, FAR const char *relpath, if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - fdbg("ERROR: Only O_RDONLY supported\n"); + ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; } @@ -158,7 +158,7 @@ static int uptime_open(FAR struct file *filep, FAR const char *relpath, if (strcmp(relpath, "uptime") != 0) { - fdbg("ERROR: relpath is '%s'\n", relpath); + ferr("ERROR: relpath is '%s'\n", relpath); return -ENOENT; } @@ -167,7 +167,7 @@ static int uptime_open(FAR struct file *filep, FAR const char *relpath, attr = (FAR struct uptime_file_s *)kmm_zalloc(sizeof(struct uptime_file_s)); if (!attr) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -313,7 +313,7 @@ static int uptime_dup(FAR const struct file *oldp, FAR struct file *newp) newattr = (FAR struct uptime_file_s *)kmm_malloc(sizeof(struct uptime_file_s)); if (!newattr) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -340,7 +340,7 @@ static int uptime_stat(FAR const char *relpath, FAR struct stat *buf) if (strcmp(relpath, "uptime") != 0) { - fdbg("ERROR: relpath is '%s'\n", relpath); + ferr("ERROR: relpath is '%s'\n", relpath); return -ENOENT; } diff --git a/fs/procfs/fs_skeleton.c b/fs/procfs/fs_skeleton.c index 55216e8cef..0a884e03be 100644 --- a/fs/procfs/fs_skeleton.c +++ b/fs/procfs/fs_skeleton.c @@ -174,7 +174,7 @@ static int skel_open(FAR struct file *filep, FAR const char *relpath, if (((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) && (skel_procfsoperations.write == NULL)) { - fdbg("ERROR: Only O_RDONLY supported\n"); + ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; } @@ -183,7 +183,7 @@ static int skel_open(FAR struct file *filep, FAR const char *relpath, priv = (FAR struct skel_file_s *)kmm_zalloc(sizeof(struct skel_file_s)); if (!priv) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -274,7 +274,7 @@ static int skel_dup(FAR const struct file *oldp, FAR struct file *newp) newpriv = (FAR struct skel_file_s *)kmm_zalloc(sizeof(struct skel_file_s)); if (!newpriv) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -312,7 +312,7 @@ static int skel_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) if (!level1) { - fdbg("ERROR: Failed to allocate the level1 directory structure\n"); + ferr("ERROR: Failed to allocate the level1 directory structure\n"); return -ENOMEM; } diff --git a/fs/romfs/fs_romfs.c b/fs/romfs/fs_romfs.c index e48c6e71e2..b90b87101b 100644 --- a/fs/romfs/fs_romfs.c +++ b/fs/romfs/fs_romfs.c @@ -169,7 +169,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("romfs_checkmount failed: %d\n", ret); + ferr("romfs_checkmount failed: %d\n", ret); goto errout_with_semaphore; } @@ -179,7 +179,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) { - fdbg("Only O_RDONLY supported\n"); + ferr("Only O_RDONLY supported\n"); ret = -EACCES; goto errout_with_semaphore; } @@ -193,7 +193,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, ret = romfs_finddirentry(rm, &dirinfo, relpath); if (ret < 0) { - fdbg("Failed to find directory directory entry for '%s': %d\n", + ferr("Failed to find directory directory entry for '%s': %d\n", relpath, ret); goto errout_with_semaphore; } @@ -207,7 +207,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, /* It is a directory */ ret = -EISDIR; - fdbg("'%s' is a directory\n", relpath); + ferr("'%s' is a directory\n", relpath); goto errout_with_semaphore; } @@ -222,7 +222,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, rf = (FAR struct romfs_file_s *)kmm_zalloc(sizeof(struct romfs_file_s)); if (!rf) { - fdbg("Failed to allocate private data\n", ret); + ferr("Failed to allocate private data\n", ret); ret = -ENOMEM; goto errout_with_semaphore; } @@ -239,7 +239,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, &rf->rf_startoffset); if (ret < 0) { - fdbg("Failed to locate start of file data: %d\n", ret); + ferr("Failed to locate start of file data: %d\n", ret); goto errout_with_semaphore; } @@ -248,7 +248,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, ret = romfs_fileconfigure(rm, rf); if (ret < 0) { - fdbg("Failed configure buffering: %d\n", ret); + ferr("Failed configure buffering: %d\n", ret); goto errout_with_semaphore; } @@ -359,7 +359,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer, ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("romfs_checkmount failed: %d\n", ret); + ferr("romfs_checkmount failed: %d\n", ret); goto errout_with_semaphore; } @@ -408,7 +408,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer, ret = romfs_hwread(rm, userbuffer, sector, nsectors); if (ret < 0) { - fdbg("romfs_hwread failed: %d\n", ret); + ferr("romfs_hwread failed: %d\n", ret); goto errout_with_semaphore; } @@ -426,7 +426,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer, ret = romfs_filecacheread(rm, rf, sector); if (ret < 0) { - fdbg("romfs_filecacheread failed: %d\n", ret); + ferr("romfs_filecacheread failed: %d\n", ret); goto errout_with_semaphore; } @@ -511,7 +511,7 @@ static off_t romfs_seek(FAR struct file *filep, off_t offset, int whence) break; default: - fdbg("Whence is invalid: %d\n", whence); + ferr("Whence is invalid: %d\n", whence); return -EINVAL; } @@ -521,7 +521,7 @@ static off_t romfs_seek(FAR struct file *filep, off_t offset, int whence) ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("romfs_checkmount failed: %d\n", ret); + ferr("romfs_checkmount failed: %d\n", ret); goto errout_with_semaphore; } @@ -582,7 +582,7 @@ static int romfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) return OK; } - fdbg("Invalid cmd: %d \n", cmd); + ferr("Invalid cmd: %d \n", cmd); return -ENOTTY; } @@ -618,7 +618,7 @@ static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp) ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("romfs_checkmount failed: %d\n", ret); + ferr("romfs_checkmount failed: %d\n", ret); goto errout_with_semaphore; } @@ -633,7 +633,7 @@ static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp) newrf = (FAR struct romfs_file_s *)kmm_malloc(sizeof(struct romfs_file_s)); if (!newrf) { - fdbg("Failed to allocate private data\n", ret); + ferr("Failed to allocate private data\n", ret); ret = -ENOMEM; goto errout_with_semaphore; } @@ -649,7 +649,7 @@ static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp) if (ret < 0) { kmm_free(newrf); - fdbg("Failed configure buffering: %d\n", ret); + ferr("Failed configure buffering: %d\n", ret); goto errout_with_semaphore; } @@ -707,7 +707,7 @@ static int romfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("romfs_checkmount failed: %d\n", ret); + ferr("romfs_checkmount failed: %d\n", ret); goto errout_with_semaphore; } @@ -716,7 +716,7 @@ static int romfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, ret = romfs_finddirentry(rm, &dirinfo, relpath); if (ret < 0) { - fdbg("Failed to find directory '%s': %d\n", relpath, ret); + ferr("Failed to find directory '%s': %d\n", relpath, ret); goto errout_with_semaphore; } @@ -726,7 +726,7 @@ static int romfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, { /* The entry is not a directory */ - fdbg("'%s' is not a directory: %d\n", relpath); + ferr("'%s' is not a directory: %d\n", relpath); ret = -ENOTDIR; goto errout_with_semaphore; } @@ -775,7 +775,7 @@ static int romfs_readdir(FAR struct inode *mountpt, ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("romfs_checkmount failed: %d\n", ret); + ferr("romfs_checkmount failed: %d\n", ret); goto errout_with_semaphore; } @@ -791,7 +791,7 @@ static int romfs_readdir(FAR struct inode *mountpt, * special error -ENOENT */ - fdbg("End of directory\n"); + ferr("End of directory\n"); ret = -ENOENT; goto errout_with_semaphore; } @@ -802,7 +802,7 @@ static int romfs_readdir(FAR struct inode *mountpt, &next, &info, &size); if (ret < 0) { - fdbg("romfs_parsedirentry failed: %d\n", ret); + ferr("romfs_parsedirentry failed: %d\n", ret); goto errout_with_semaphore; } @@ -811,7 +811,7 @@ static int romfs_readdir(FAR struct inode *mountpt, ret = romfs_parsefilename(rm, dir->u.romfs.fr_curroffset, dir->fd_dir.d_name); if (ret < 0) { - fdbg("romfs_parsefilename failed: %d\n", ret); + ferr("romfs_parsefilename failed: %d\n", ret); goto errout_with_semaphore; } @@ -897,14 +897,14 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data, if (!blkdriver || !blkdriver->u.i_bops) { - fdbg("No block driver/ops\n"); + ferr("No block driver/ops\n"); return -ENODEV; } if (blkdriver->u.i_bops->open && blkdriver->u.i_bops->open(blkdriver) != OK) { - fdbg("No open method\n"); + ferr("No open method\n"); return -ENODEV; } @@ -913,7 +913,7 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data, rm = (FAR struct romfs_mountpt_s *)kmm_zalloc(sizeof(struct romfs_mountpt_s)); if (!rm) { - fdbg("Failed to allocate mountpoint structure\n"); + ferr("Failed to allocate mountpoint structure\n"); return -ENOMEM; } @@ -930,7 +930,7 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data, ret = romfs_hwconfigure(rm); if (ret < 0) { - fdbg("romfs_hwconfigure failed: %d\n", ret); + ferr("romfs_hwconfigure failed: %d\n", ret); goto errout_with_sem; } @@ -941,7 +941,7 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data, ret = romfs_fsconfigure(rm); if (ret < 0) { - fdbg("romfs_fsconfigure failed: %d\n", ret); + ferr("romfs_fsconfigure failed: %d\n", ret); goto errout_with_buffer; } @@ -993,7 +993,7 @@ static int romfs_unbind(FAR void *handle, FAR struct inode **blkdriver, { /* We cannot unmount now.. there are open files */ - fdbg("There are open files\n"); + ferr("There are open files\n"); /* This implementation currently only supports unmounting if there are * no open file references. @@ -1072,7 +1072,7 @@ static int romfs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf) ret = romfs_checkmount(rm); if (ret < 0) { - fdbg("romfs_checkmount failed: %d\n", ret); + ferr("romfs_checkmount failed: %d\n", ret); goto errout_with_semaphore; } @@ -1130,7 +1130,7 @@ static int romfs_stat(FAR struct inode *mountpt, FAR const char *relpath, ret = romfs_checkmount(rm); if (ret != OK) { - fdbg("romfs_checkmount failed: %d\n", ret); + ferr("romfs_checkmount failed: %d\n", ret); goto errout_with_semaphore; } diff --git a/fs/romfs/fs_romfsutil.c b/fs/romfs/fs_romfsutil.c index 045bed977f..b39f3e866f 100644 --- a/fs/romfs/fs_romfsutil.c +++ b/fs/romfs/fs_romfsutil.c @@ -467,7 +467,7 @@ int romfs_filecacheread(struct romfs_mountpt_s *rm, struct romfs_file_s *rf, ret = romfs_hwread(rm, rf->rf_buffer, sector, 1); if (ret < 0) { - fdbg("romfs_hwread failed: %d\n", ret); + ferr("romfs_hwread failed: %d\n", ret); return ret; } } diff --git a/fs/smartfs/smartfs_procfs.c b/fs/smartfs/smartfs_procfs.c index d8fe9995c3..915ebfd559 100644 --- a/fs/smartfs/smartfs_procfs.c +++ b/fs/smartfs/smartfs_procfs.c @@ -359,7 +359,7 @@ static int smartfs_open(FAR struct file *filep, FAR const char *relpath, if (((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) && (smartfs_procfsoperations.write == NULL)) { - fdbg("ERROR: Only O_RDONLY supported\n"); + ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; } @@ -368,7 +368,7 @@ static int smartfs_open(FAR struct file *filep, FAR const char *relpath, priv = (FAR struct smartfs_file_s *)kmm_malloc(sizeof(struct smartfs_file_s)); if (!priv) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -518,7 +518,7 @@ static int smartfs_dup(FAR const struct file *oldp, FAR struct file *newp) newpriv = (FAR struct smartfs_file_s *)kmm_malloc(sizeof(struct smartfs_file_s)); if (!newpriv) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -557,7 +557,7 @@ static int smartfs_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir) if (!level1) { - fdbg("ERROR: Failed to allocate the level1 directory structure\n"); + ferr("ERROR: Failed to allocate the level1 directory structure\n"); return -ENOMEM; } diff --git a/fs/smartfs/smartfs_smart.c b/fs/smartfs/smartfs_smart.c index d7c7694be5..eeae9d6ccf 100644 --- a/fs/smartfs/smartfs_smart.c +++ b/fs/smartfs/smartfs_smart.c @@ -505,7 +505,7 @@ static ssize_t smartfs_read(FAR struct file *filep, char *buffer, size_t buflen) ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d reading sector %d data\n", ret, sf->currsector); + ferr("Error %d reading sector %d data\n", ret, sf->currsector); goto errout_with_semaphore; } @@ -614,7 +614,7 @@ static int smartfs_sync_internal(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d writing used bytes for sector %d\n", ret, sf->currsector); + ferr("Error %d writing used bytes for sector %d\n", ret, sf->currsector); goto errout; } @@ -639,7 +639,7 @@ static int smartfs_sync_internal(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d reading sector %d data\n", ret, sf->currsector); + ferr("Error %d reading sector %d data\n", ret, sf->currsector); goto errout; } @@ -661,7 +661,7 @@ static int smartfs_sync_internal(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d writing used bytes for sector %d\n", ret, sf->currsector); + ferr("Error %d writing used bytes for sector %d\n", ret, sf->currsector); goto errout; } @@ -766,7 +766,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer, ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d writing sector %d data\n", ret, sf->currsector); + ferr("Error %d writing sector %d data\n", ret, sf->currsector); goto errout_with_semaphore; } @@ -793,7 +793,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer, ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d reading sector %d header\n", ret, sf->currsector); + ferr("Error %d reading sector %d header\n", ret, sf->currsector); goto errout_with_semaphore; } @@ -841,7 +841,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer, ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d writing sector %d data\n", ret, sf->currsector); + ferr("Error %d writing sector %d data\n", ret, sf->currsector); goto errout_with_semaphore; } } @@ -867,7 +867,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer, ret = FS_IOCTL(fs, BIOC_ALLOCSECT, 0xFFFF); if (ret < 0) { - fdbg("Error %d allocating new sector\n", ret); + ferr("Error %d allocating new sector\n", ret); goto errout_with_semaphore; } @@ -892,7 +892,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer, { /* Error allocating logical sector! */ - fdbg("Error - duplicate logical sector %d\n", sf->currsector); + ferr("Error - duplicate logical sector %d\n", sf->currsector); } sf->bflags = SMARTFS_BFLAG_DIRTY; @@ -922,7 +922,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer, ret = FS_IOCTL(fs, BIOC_ALLOCSECT, 0xFFFF); if (ret < 0) { - fdbg("Error %d allocating new sector\n", ret); + ferr("Error %d allocating new sector\n", ret); goto errout_with_semaphore; } @@ -937,7 +937,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer, ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d writing next sector\n", ret); + ferr("Error %d writing next sector\n", ret); goto errout_with_semaphore; } @@ -949,7 +949,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer, { /* Error allocating logical sector! */ - fdbg("Error - duplicate logical sector %d\n", sf->currsector); + ferr("Error - duplicate logical sector %d\n", sf->currsector); } sf->currsector = SMARTFS_NEXTSECTOR(header); @@ -1078,7 +1078,7 @@ static off_t smartfs_seek_internal(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d reading sector %d header\n", ret, sf->currsector); + ferr("Error %d reading sector %d header\n", ret, sf->currsector); goto errout; } @@ -1103,7 +1103,7 @@ static off_t smartfs_seek_internal(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d reading sector %d header\n", ret, sf->currsector); + ferr("Error %d reading sector %d header\n", ret, sf->currsector); goto errout; } } @@ -1933,7 +1933,7 @@ int smartfs_rename(struct inode *mountpt, const char *oldrelpath, ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d reading sector %d data\n", ret, oldentry.dsector); + ferr("Error %d reading sector %d data\n", ret, oldentry.dsector); goto errout_with_semaphore; } @@ -2005,7 +2005,7 @@ int smartfs_rename(struct inode *mountpt, const char *oldrelpath, ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d reading sector %d data\n", ret, oldentry.dsector); + ferr("Error %d reading sector %d data\n", ret, oldentry.dsector); goto errout_with_semaphore; } @@ -2024,7 +2024,7 @@ int smartfs_rename(struct inode *mountpt, const char *oldrelpath, ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d writing flag bytes for sector %d\n", ret, readwrite.logsector); + ferr("Error %d writing flag bytes for sector %d\n", ret, readwrite.logsector); goto errout_with_semaphore; } } diff --git a/fs/smartfs/smartfs_utils.c b/fs/smartfs/smartfs_utils.c index 4970c51d8f..6c8373e79f 100644 --- a/fs/smartfs/smartfs_utils.c +++ b/fs/smartfs/smartfs_utils.c @@ -231,7 +231,7 @@ int smartfs_mount(struct smartfs_mountpt_s *fs, bool writeable) ret = FS_IOCTL(fs, BIOC_GETFORMAT, (unsigned long) &fs->fs_llformat); if (ret != OK) { - fdbg("Error getting device low level format: %d\n", ret); + ferr("Error getting device low level format: %d\n", ret); goto errout; } @@ -239,7 +239,7 @@ int smartfs_mount(struct smartfs_mountpt_s *fs, bool writeable) if (!(fs->fs_llformat.flags & SMART_FMT_ISFORMATTED)) { - fdbg("No low-level format found\n"); + ferr("No low-level format found\n"); ret = -ENODEV; goto errout; } @@ -311,16 +311,16 @@ int smartfs_mount(struct smartfs_mountpt_s *fs, bool writeable) fs->fs_mounted = TRUE; - fdbg("SMARTFS:\n"); - fdbg("\t Sector size: %d\n", fs->fs_llformat.sectorsize); - fdbg("\t Bytes/sector %d\n", fs->fs_llformat.availbytes); - fdbg("\t Num sectors: %d\n", fs->fs_llformat.nsectors); - fdbg("\t Free sectors: %d\n", fs->fs_llformat.nfreesectors); - fdbg("\t Max filename: %d\n", CONFIG_SMARTFS_MAXNAMLEN); + ferr("SMARTFS:\n"); + ferr("\t Sector size: %d\n", fs->fs_llformat.sectorsize); + ferr("\t Bytes/sector %d\n", fs->fs_llformat.availbytes); + ferr("\t Num sectors: %d\n", fs->fs_llformat.nsectors); + ferr("\t Free sectors: %d\n", fs->fs_llformat.nfreesectors); + ferr("\t Max filename: %d\n", CONFIG_SMARTFS_MAXNAMLEN); #ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS - fdbg("\t RootDirEntries: %d\n", fs->fs_llformat.nrootdirentries); + ferr("\t RootDirEntries: %d\n", fs->fs_llformat.nrootdirentries); #endif - fdbg("\t RootDirSector: %d\n", fs->fs_rootsector); + ferr("\t RootDirSector: %d\n", fs->fs_rootsector); errout: return ret; @@ -698,7 +698,7 @@ int smartfs_finddirentry(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error in sector chain at %d!\n", dirsector); + ferr("Error in sector chain at %d!\n", dirsector); break; } @@ -937,7 +937,7 @@ int smartfs_createentry(FAR struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error chaining sector %d\n", nextsector); + ferr("Error chaining sector %d\n", nextsector); goto errout; } } @@ -1014,7 +1014,7 @@ int smartfs_createentry(FAR struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error %d setting new sector type for sector %d\n", + ferr("Error %d setting new sector type for sector %d\n", ret, nextsector); goto errout; } @@ -1129,7 +1129,7 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error reading sector %d\n", nextsector); + ferr("Error reading sector %d\n", nextsector); break; } @@ -1148,7 +1148,7 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error reading directory info at sector %d\n", entry->dsector); + ferr("Error reading directory info at sector %d\n", entry->dsector); goto errout; } @@ -1177,7 +1177,7 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error marking entry inactive at sector %d\n", entry->dsector); + ferr("Error marking entry inactive at sector %d\n", entry->dsector); goto errout; } @@ -1242,7 +1242,7 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error reading sector %d\n", nextsector); + ferr("Error reading sector %d\n", nextsector); break; } @@ -1259,7 +1259,7 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error unchaining sector (%d)\n", nextsector); + ferr("Error unchaining sector (%d)\n", nextsector); goto errout; } @@ -1268,7 +1268,7 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_FREESECT, (unsigned long) entry->dsector); if (ret < 0) { - fdbg("Error freeing sector %d\n", entry->dsector); + ferr("Error freeing sector %d\n", entry->dsector); goto errout; } @@ -1327,7 +1327,7 @@ int smartfs_countdirentries(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error reading sector %d\n", nextsector); + ferr("Error reading sector %d\n", nextsector); break; } @@ -1336,7 +1336,7 @@ int smartfs_countdirentries(struct smartfs_mountpt_s *fs, header = (struct smartfs_chain_header_s *) fs->fs_rwbuffer; if (header->type != SMARTFS_SECTOR_TYPE_DIR) { - fdbg("Sector %d is not a DIR sector!\n", nextsector); + ferr("Sector %d is not a DIR sector!\n", nextsector); goto errout; } @@ -1411,7 +1411,7 @@ int smartfs_truncatefile(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error reading sector %d header\n", nextsector); + ferr("Error reading sector %d header\n", nextsector); goto errout; } @@ -1447,7 +1447,7 @@ int smartfs_truncatefile(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); if (ret < 0) { - fdbg("Error blanking 1st sector (%d) of file\n", nextsector); + ferr("Error blanking 1st sector (%d) of file\n", nextsector); goto errout; } @@ -1463,7 +1463,7 @@ int smartfs_truncatefile(struct smartfs_mountpt_s *fs, ret = FS_IOCTL(fs, BIOC_FREESECT, (unsigned long) nextsector); if (ret < 0) { - fdbg("Error freeing sector %d\n", nextsector); + ferr("Error freeing sector %d\n", nextsector); goto errout; } } diff --git a/fs/tmpfs/fs_tmpfs.c b/fs/tmpfs/fs_tmpfs.c index 8bcaffec64..a44ddb11ff 100644 --- a/fs/tmpfs/fs_tmpfs.c +++ b/fs/tmpfs/fs_tmpfs.c @@ -1727,7 +1727,7 @@ static int tmpfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) return OK; } - fdbg("Invalid cmd: %d\n", cmd); + ferr("Invalid cmd: %d\n", cmd); return -ENOTTY; } diff --git a/fs/unionfs/fs_unionfs.c b/fs/unionfs/fs_unionfs.c index a61e94acb0..30d70c806d 100644 --- a/fs/unionfs/fs_unionfs.c +++ b/fs/unionfs/fs_unionfs.c @@ -2512,7 +2512,7 @@ int unionfs_mount(FAR const char *fspath1, FAR const char *prefix1, ui = (FAR struct unionfs_inode_s *)kmm_zalloc(sizeof(struct unionfs_inode_s)); if (!ui) { - fdbg("ERROR: Failed to allocated union FS state structure\n"); + ferr("ERROR: Failed to allocated union FS state structure\n"); return -ENOMEM; } @@ -2523,14 +2523,14 @@ int unionfs_mount(FAR const char *fspath1, FAR const char *prefix1, ret = unionfs_getmount(fspath1, &ui->ui_fs[0].um_node); if (ret < 0) { - fdbg("ERROR: unionfs_getmount(fspath1) failed: %d\n", ret); + ferr("ERROR: unionfs_getmount(fspath1) failed: %d\n", ret); goto errout_with_uinode; } ret = unionfs_getmount(fspath2, &ui->ui_fs[1].um_node); if (ret < 0) { - fdbg("ERROR: unionfs_getmount(fspath2) failed: %d\n", ret); + ferr("ERROR: unionfs_getmount(fspath2) failed: %d\n", ret); goto errout_with_fs1; } @@ -2541,7 +2541,7 @@ int unionfs_mount(FAR const char *fspath1, FAR const char *prefix1, ui->ui_fs[0].um_prefix = strdup(prefix1); if (ui->ui_fs[0].um_prefix == NULL) { - fdbg("ERROR: strdup(prefix1) failed\n"); + ferr("ERROR: strdup(prefix1) failed\n"); ret = -ENOMEM; goto errout_with_fs2; } @@ -2552,7 +2552,7 @@ int unionfs_mount(FAR const char *fspath1, FAR const char *prefix1, ui->ui_fs[1].um_prefix = strdup(prefix2); if (ui->ui_fs[1].um_prefix == NULL) { - fdbg("ERROR: strdup(prefix2) failed\n"); + ferr("ERROR: strdup(prefix2) failed\n"); ret = -ENOMEM; goto errout_with_prefix1; } @@ -2580,7 +2580,7 @@ int unionfs_mount(FAR const char *fspath1, FAR const char *prefix1, * -ENOMEM - Failed to allocate in-memory resources for the operation */ - fdbg("ERROR: Failed to reserve inode\n"); + ferr("ERROR: Failed to reserve inode\n"); goto errout_with_semaphore; } diff --git a/fs/vfs/fs_epoll.c b/fs/vfs/fs_epoll.c index 590959b2b7..bc0502e111 100644 --- a/fs/vfs/fs_epoll.c +++ b/fs/vfs/fs_epoll.c @@ -190,12 +190,12 @@ int epoll_wait(int epfd, FAR struct epoll_event *evs, int maxevents, { if (rc < 0) { - fdbg("%08x poll fail: %d for %d, %d msecs\n", + ferr("%08x poll fail: %d for %d, %d msecs\n", epfd, rc, eph->occupied, timeout); for (i = 0; i < eph->occupied; i++) { - fdbg("%02d: fd=%d\n", i, eph->evs[i].data.fd); + ferr("%02d: fd=%d\n", i, eph->evs[i].data.fd); } } diff --git a/graphics/nxbe/nxbe_bitmap.c b/graphics/nxbe/nxbe_bitmap.c index 5c94d0b04d..94069fa124 100644 --- a/graphics/nxbe/nxbe_bitmap.c +++ b/graphics/nxbe/nxbe_bitmap.c @@ -138,7 +138,7 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de if (dest->pt1.x < origin->x || dest->pt1.y < origin->y) { - gdbg("Bad dest start position\n"); + gerr("Bad dest start position\n"); return; } @@ -149,7 +149,7 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de deststride = (((dest->pt2.x - origin->x + 1) * wnd->be->plane[0].pinfo.bpp + 7) >> 3); if (deststride > stride) { - gdbg("Bad dest width\n"); + gerr("Bad dest width\n"); return; } diff --git a/graphics/nxbe/nxbe_clipper.c b/graphics/nxbe/nxbe_clipper.c index 0ded5b5c70..652b6e61c0 100644 --- a/graphics/nxbe/nxbe_clipper.c +++ b/graphics/nxbe/nxbe_clipper.c @@ -115,7 +115,7 @@ static inline void nxbe_pushrectangle(FAR struct nxbe_clipstack_s *stack, sizeof(struct nxbe_cliprect_s) * mxrects); if (!newstack) { - gdbg("Failed to reallocate stack\n"); + gerr("Failed to reallocate stack\n"); return; } diff --git a/graphics/nxbe/nxbe_configure.c b/graphics/nxbe/nxbe_configure.c index f3aae2433d..4fd38552f3 100644 --- a/graphics/nxbe/nxbe_configure.c +++ b/graphics/nxbe/nxbe_configure.c @@ -89,7 +89,7 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be) ret = dev->getvideoinfo(dev, &be->vinfo); if (ret < 0) { - gdbg("Failed to get vinfo\n"); + gerr("Failed to get vinfo\n"); return ret; } @@ -102,13 +102,13 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be) #ifdef CONFIG_DEBUG_FEATURES if (be->vinfo.nplanes > CONFIG_NX_NPLANES) { - gdbg("NX configured for only %d planes, controller wants %d\n", + gerr("NX configured for only %d planes, controller wants %d\n", CONFIG_NX_NPLANES, be->vinfo.nplanes); return -E2BIG; } else if (be->vinfo.nplanes < CONFIG_NX_NPLANES) { - gdbg("NX configured for %d planes, controller only needs %d\n", + gerr("NX configured for %d planes, controller only needs %d\n", CONFIG_NX_NPLANES, be->vinfo.nplanes); } #endif @@ -120,7 +120,7 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be) ret = dev->getplaneinfo(dev, i, &be->plane[i].pinfo); if (ret < 0) { - gdbg("Failed to get pinfo[%d]\n", i); + gerr("Failed to get pinfo[%d]\n", i); return ret; } @@ -216,7 +216,7 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be) else #endif { - gdbg("Unsupported pinfo[%d] BPP: %d\n", i, be->plane[i].pinfo.bpp); + gerr("Unsupported pinfo[%d] BPP: %d\n", i, be->plane[i].pinfo.bpp); return -ENOSYS; } } diff --git a/graphics/nxmu/nx_start.c b/graphics/nxmu/nx_start.c index 18e1aeae3f..3c3e6446d9 100644 --- a/graphics/nxmu/nx_start.c +++ b/graphics/nxmu/nx_start.c @@ -84,7 +84,7 @@ int nx_server(int argc, char *argv[]) dev = board_graphics_setup(CONFIG_NXSTART_DEVNO); if (!dev) { - gdbg("ERROR: board_graphics_setup failed, devno=%d\n", CONFIG_NXSTART_DEVNO); + gerr("ERROR: board_graphics_setup failed, devno=%d\n", CONFIG_NXSTART_DEVNO); return EXIT_FAILURE; } @@ -94,7 +94,7 @@ int nx_server(int argc, char *argv[]) ret = board_lcd_initialize(); if (ret < 0) { - gdbg("ERROR: board_lcd_initialize failed: %d\n", ret); + gerr("ERROR: board_lcd_initialize failed: %d\n", ret); return EXIT_FAILURE; } @@ -103,7 +103,7 @@ int nx_server(int argc, char *argv[]) dev = board_lcd_getdev(CONFIG_NXSTART_DEVNO); if (!dev) { - gdbg("ERROR: board_lcd_getdev failed, devno=%d\n", CONFIG_NXSTART_DEVNO); + gerr("ERROR: board_lcd_getdev failed, devno=%d\n", CONFIG_NXSTART_DEVNO); return EXIT_FAILURE; } @@ -119,14 +119,14 @@ int nx_server(int argc, char *argv[]) ret = up_fbinitialize(0); if (ret < 0) { - gdbg("ERROR: up_fbinitialize failed: %d\n", ret); + gerr("ERROR: up_fbinitialize failed: %d\n", ret); return EXIT_FAILURE; } dev = up_fbgetvplane(0, CONFIG_NXSTART_VPLANE); if (!dev) { - gdbg("ERROR: up_fbgetvplane failed, vplane=%d\n", CONFIG_NXSTART_VPLANE); + gerr("ERROR: up_fbgetvplane failed, vplane=%d\n", CONFIG_NXSTART_VPLANE); return EXIT_FAILURE; } @@ -182,7 +182,7 @@ int nx_start(void) int errcode = errno; DEBUGASSERT(errcode > 0); - gdbg("ERROR: Failed to create nx_server kernel thread: %d\n", errcode); + gerr("ERROR: Failed to create nx_server kernel thread: %d\n", errcode); return -errcode; } diff --git a/graphics/nxmu/nxmu_reportposition.c b/graphics/nxmu/nxmu_reportposition.c index cbc5651f9f..5e7584464c 100644 --- a/graphics/nxmu/nxmu_reportposition.c +++ b/graphics/nxmu/nxmu_reportposition.c @@ -103,6 +103,6 @@ void nxfe_reportposition(FAR struct nxbe_window_s *wnd) ret = nxmu_sendclientwindow(wnd, &outmsg, sizeof(struct nxclimsg_newposition_s)); if (ret < 0) { - gdbg("nxmu_sendclient failed: %d\n", errno); + gerr("nxmu_sendclient failed: %d\n", errno); } } diff --git a/graphics/nxmu/nxmu_sendclient.c b/graphics/nxmu/nxmu_sendclient.c index 66a992e526..511b5814a1 100644 --- a/graphics/nxmu/nxmu_sendclient.c +++ b/graphics/nxmu/nxmu_sendclient.c @@ -105,7 +105,7 @@ int nxmu_sendclient(FAR struct nxfe_conn_s *conn, FAR const void *msg, ret = mq_send(conn->swrmq, msg, msglen, NX_CLIMSG_PRIO); if (ret < 0) { - gdbg("mq_send failed: %d\n", errno); + gerr("mq_send failed: %d\n", errno); } return ret; diff --git a/graphics/nxmu/nxmu_server.c b/graphics/nxmu/nxmu_server.c index 680e4cde16..28b37518b9 100644 --- a/graphics/nxmu/nxmu_server.c +++ b/graphics/nxmu/nxmu_server.c @@ -87,7 +87,7 @@ static inline void nxmu_disconnect(FAR struct nxfe_conn_s *conn) ret = nxmu_sendclient(conn, &outmsg, sizeof(struct nxclimsg_disconnected_s)); if (ret < 0) { - gdbg("nxmu_sendclient failed: %d\n", errno); + gerr("nxmu_sendclient failed: %d\n", errno); } /* Close the outgoing client message queue */ @@ -114,7 +114,7 @@ static inline void nxmu_connect(FAR struct nxfe_conn_s *conn) conn->swrmq = mq_open(mqname, O_WRONLY); if (conn->swrmq == (mqd_t)-1) { - gdbg("mq_open(%s) failed: %d\n", mqname, errno); + gerr("mq_open(%s) failed: %d\n", mqname, errno); outmsg.msgid = NX_CLIMSG_DISCONNECTED; } @@ -124,7 +124,7 @@ static inline void nxmu_connect(FAR struct nxfe_conn_s *conn) ret = nxmu_sendclient(conn, &outmsg, sizeof(struct nxclimsg_connected_s)); if (ret < 0) { - gdbg("nxmu_sendclient failed: %d\n", errno); + gerr("nxmu_sendclient failed: %d\n", errno); } } @@ -166,7 +166,7 @@ static inline void nxmu_blocked(FAR struct nxbe_window_s *wnd, FAR void *arg) ret = nxmu_sendclient(wnd->conn, &outmsg, sizeof(struct nxclimsg_blocked_s)); if (ret < 0) { - gdbg("nxmu_sendclient failed: %d\n", errno); + gerr("nxmu_sendclient failed: %d\n", errno); } } @@ -187,7 +187,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev, ret = nxbe_configure(dev, &fe->be); if (ret < 0) { - gdbg("nxbe_configure failed: %d\n", -ret); + gerr("nxbe_configure failed: %d\n", -ret); errno = -ret; return ERROR; } @@ -196,7 +196,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev, ret = nxbe_colormap(dev); if (ret < 0) { - gdbg("nxbe_colormap failed: %d\n", -ret); + gerr("nxbe_colormap failed: %d\n", -ret); errno = -ret; return ERROR; } @@ -217,7 +217,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev, fe->conn.crdmq = mq_open(mqname, O_RDONLY | O_CREAT, 0666, &attr); if (fe->conn.crdmq == (mqd_t)-1) { - gdbg("mq_open(%s) failed: %d\n", mqname, errno); + gerr("mq_open(%s) failed: %d\n", mqname, errno); return ERROR; /* mq_open sets errno */ } @@ -233,7 +233,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev, fe->conn.swrmq = mq_open(mqname, O_WRONLY); if (fe->conn.swrmq == (mqd_t)-1) { - gdbg("mq_open(%s) failed: %d\n", mqname, errno); + gerr("mq_open(%s) failed: %d\n", mqname, errno); mq_close(fe->conn.crdmq); return ERROR; /* mq_open sets errno */ } @@ -334,7 +334,7 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev) { if (errno != EINTR) { - gdbg("mq_receive failed: %d\n", errno); + gerr("mq_receive failed: %d\n", errno); goto errout; /* mq_receive sets errno */ } continue; @@ -545,7 +545,7 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev) case NX_CLIMSG_CONNECTED: /* Shouldn't happen */ case NX_CLIMSG_DISCONNECTED: default: - gdbg("Unrecognized command: %d\n", msg->msgid); + gerr("Unrecognized command: %d\n", msg->msgid); break; } } diff --git a/graphics/nxsu/nx_open.c b/graphics/nxsu/nx_open.c index a89340d37e..202e011ee8 100644 --- a/graphics/nxsu/nx_open.c +++ b/graphics/nxsu/nx_open.c @@ -120,7 +120,7 @@ static inline int nxsu_setup(FAR NX_DRIVERTYPE *dev, ret = nxbe_configure(dev, &fe->be); if (ret < 0) { - gdbg("nxbe_configure failed: %d\n", -ret); + gerr("nxbe_configure failed: %d\n", -ret); errno = -ret; return ERROR; } @@ -129,7 +129,7 @@ static inline int nxsu_setup(FAR NX_DRIVERTYPE *dev, ret = nxbe_colormap(dev); if (ret < 0) { - gdbg("nxbe_colormap failed: %d\n", -ret); + gerr("nxbe_colormap failed: %d\n", -ret); errno = -ret; return ERROR; } diff --git a/graphics/nxterm/nxterm_driver.c b/graphics/nxterm/nxterm_driver.c index 77cb7b0377..975fae2763 100644 --- a/graphics/nxterm/nxterm_driver.c +++ b/graphics/nxterm/nxterm_driver.c @@ -128,7 +128,7 @@ static int nxterm_open(FAR struct file *filep) #ifndef CONFIG_NXTERM_NXKBDIN if ((filep->f_oflags & O_RDOK) != 0) { - gdbg("ERROR: Attempted open with read access\n"); + gerr("ERROR: Attempted open with read access\n"); return -EACCES; } #endif diff --git a/graphics/nxterm/nxterm_font.c b/graphics/nxterm/nxterm_font.c index fec6d5a443..7c8035aebb 100644 --- a/graphics/nxterm/nxterm_font.c +++ b/graphics/nxterm/nxterm_font.c @@ -318,7 +318,7 @@ nxterm_renderglyph(FAR struct nxterm_state_s *priv, { /* Actually, the RENDERER never returns a failure */ - gdbg("nxterm_renderglyph: RENDERER failed\n"); + gerr("nxterm_renderglyph: RENDERER failed\n"); nxterm_freeglyph(glyph); glyph = NULL; } diff --git a/graphics/nxterm/nxterm_kbdin.c b/graphics/nxterm/nxterm_kbdin.c index f23b5ac16f..b81763e6ab 100644 --- a/graphics/nxterm/nxterm_kbdin.c +++ b/graphics/nxterm/nxterm_kbdin.c @@ -118,7 +118,7 @@ ssize_t nxterm_read(FAR struct file *filep, FAR char *buffer, size_t len) ret = nxterm_semwait(priv); if (ret < 0) { - gdbg("ERROR: nxterm_semwait failed\n"); + gerr("ERROR: nxterm_semwait failed\n"); return ret; } @@ -191,7 +191,7 @@ ssize_t nxterm_read(FAR struct file *filep, FAR char *buffer, size_t len) int errval = errno; - gdbg("ERROR: nxterm_semwait failed\n"); + gerr("ERROR: nxterm_semwait failed\n"); /* Were we awakened by a signal? Did we read anything before * we received the signal? @@ -277,7 +277,7 @@ int nxterm_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) ret = nxterm_semwait(priv); if (ret < 0) { - gdbg("ERROR: nxterm_semwait failed\n"); + gerr("ERROR: nxterm_semwait failed\n"); return ret; } @@ -305,7 +305,7 @@ int nxterm_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) if (i >= CONFIG_NXTERM_NPOLLWAITERS) { - gdbg("ERROR: Too many poll waiters\n"); + gerr("ERROR: Too many poll waiters\n"); fds->priv = NULL; ret = -EBUSY; @@ -340,7 +340,7 @@ int nxterm_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) #ifdef CONFIG_DEBUG_FEATURES if (!slot) { - gdbg("ERROR: No slot\n"); + gerr("ERROR: No slot\n"); ret = -EIO; goto errout; @@ -405,7 +405,7 @@ void nxterm_kbdin(NXTERM handle, FAR const uint8_t *buffer, uint8_t buflen) ret = nxterm_semwait(priv); if (ret < 0) { - gdbg("ERROR: nxterm_semwait failed\n"); + gerr("ERROR: nxterm_semwait failed\n"); return; } @@ -440,7 +440,7 @@ void nxterm_kbdin(NXTERM handle, FAR const uint8_t *buffer, uint8_t buflen) { /* Yes... Return an indication that nothing was saved in the buffer. */ - gdbg("ERROR: Keyboard data overrun\n"); + gerr("ERROR: Keyboard data overrun\n"); break; } diff --git a/graphics/nxterm/nxterm_redraw.c b/graphics/nxterm/nxterm_redraw.c index b1af8b95cb..8130dfae68 100644 --- a/graphics/nxterm/nxterm_redraw.c +++ b/graphics/nxterm/nxterm_redraw.c @@ -137,7 +137,7 @@ void nxterm_redraw(NXTERM handle, FAR const struct nxgl_rect_s *rect, bool more) ret = priv->ops->fill(priv, rect, priv->wndo.wcolor); if (ret < 0) { - gdbg("fill failed: %d\n", errno); + gerr("fill failed: %d\n", errno); } /* Then redraw each character on the display (Only the characters within diff --git a/graphics/nxterm/nxterm_register.c b/graphics/nxterm/nxterm_register.c index a88d038055..797e60f49a 100644 --- a/graphics/nxterm/nxterm_register.c +++ b/graphics/nxterm/nxterm_register.c @@ -87,7 +87,7 @@ FAR struct nxterm_state_s * priv = (FAR struct nxterm_state_s *)kmm_zalloc(sizeof(struct nxterm_state_s)); if (!priv) { - gdbg("Failed to allocate the NX driver structure\n"); + gerr("Failed to allocate the NX driver structure\n"); return NULL; } @@ -112,7 +112,7 @@ FAR struct nxterm_state_s * priv->font = nxf_getfonthandle(wndo->fontid); if (!priv->font) { - gdbg("Failed to get font ID %d: %d\n", wndo->fontid, errno); + gerr("Failed to get font ID %d: %d\n", wndo->fontid, errno); goto errout; } @@ -150,7 +150,7 @@ FAR struct nxterm_state_s * ret = register_driver(devname, &g_nxterm_drvrops, 0666, priv); if (ret < 0) { - gdbg("Failed to register %s\n", devname); + gerr("Failed to register %s\n", devname); } return (NXTERM)priv; diff --git a/graphics/nxterm/nxterm_scroll.c b/graphics/nxterm/nxterm_scroll.c index 38e9f5cb6b..ff648c7421 100644 --- a/graphics/nxterm/nxterm_scroll.c +++ b/graphics/nxterm/nxterm_scroll.c @@ -118,7 +118,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv, ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor); if (ret < 0) { - gdbg("Fill failed: %d\n", errno); + gerr("Fill failed: %d\n", errno); } /* Fill each character that might lie within in the bounding box */ @@ -141,7 +141,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv, ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor); if (ret < 0) { - gdbg("Fill failed: %d\n", errno); + gerr("Fill failed: %d\n", errno); } } #else @@ -177,7 +177,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv, ret = priv->ops->move(priv, &rect, &offset); if (ret < 0) { - gdbg("Move failed: %d\n", errno); + gerr("Move failed: %d\n", errno); } /* Finally, clear the vacated bottom part of the display */ @@ -187,7 +187,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv, ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor); if (ret < 0) { - gdbg("Fill failed: %d\n", errno); + gerr("Fill failed: %d\n", errno); } } #endif diff --git a/graphics/vnc/server/vnc_fbdev.c b/graphics/vnc/server/vnc_fbdev.c index 3c4fe08133..13e81330c9 100644 --- a/graphics/vnc/server/vnc_fbdev.c +++ b/graphics/vnc/server/vnc_fbdev.c @@ -176,7 +176,7 @@ static int up_getvideoinfo(FAR struct fb_vtable_s *vtable, if (session == NULL || session->state != VNCSERVER_RUNNING) { - gdbg("ERROR: session is not connected\n"); + gerr("ERROR: session is not connected\n"); return -ENOTCONN; } @@ -193,7 +193,7 @@ static int up_getvideoinfo(FAR struct fb_vtable_s *vtable, return OK; } - gdbg("ERROR: Invalid arguments\n"); + gerr("ERROR: Invalid arguments\n"); return -EINVAL; } @@ -217,7 +217,7 @@ static int up_getplaneinfo(FAR struct fb_vtable_s *vtable, int planeno, if (session == NULL || session->state != VNCSERVER_RUNNING) { - gdbg("ERROR: session is not connected\n"); + gerr("ERROR: session is not connected\n"); return -ENOTCONN; } @@ -237,7 +237,7 @@ static int up_getplaneinfo(FAR struct fb_vtable_s *vtable, int planeno, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } @@ -264,7 +264,7 @@ static int up_getcmap(FAR struct fb_vtable_s *vtable, if (session == NULL || session->state != VNCSERVER_RUNNING) { - gdbg("ERROR: session is not connected\n"); + gerr("ERROR: session is not connected\n"); return -ENOTCONN; } @@ -274,7 +274,7 @@ static int up_getcmap(FAR struct fb_vtable_s *vtable, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } #endif @@ -301,7 +301,7 @@ static int up_putcmap(FAR struct fb_vtable_s *vtable, FAR const struct fb_cmap_s if (session == NULL || session->state != VNCSERVER_RUNNING) { - gdbg("ERROR: session is not connected\n"); + gerr("ERROR: session is not connected\n"); return -ENOTCONN; } @@ -311,7 +311,7 @@ static int up_putcmap(FAR struct fb_vtable_s *vtable, FAR const struct fb_cmap_s return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } #endif @@ -339,7 +339,7 @@ static int up_getcursor(FAR struct fb_vtable_s *vtable, if (session == NULL || session->state != VNCSERVER_RUNNING) { - gdbg("ERROR: session is not connected\n"); + gerr("ERROR: session is not connected\n"); return -ENOTCONN; } @@ -347,7 +347,7 @@ static int up_getcursor(FAR struct fb_vtable_s *vtable, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } #endif @@ -375,7 +375,7 @@ static int up_setcursor(FAR struct fb_vtable_s *vtable, if (session == NULL || session->state != VNCSERVER_RUNNING) { - gdbg("ERROR: session is not connected\n"); + gerr("ERROR: session is not connected\n"); return -ENOTCONN; } @@ -400,7 +400,7 @@ static int up_setcursor(FAR struct fb_vtable_s *vtable, return OK; } - gdbg("Returning EINVAL\n"); + gerr("Returning EINVAL\n"); return -EINVAL; } #endif @@ -456,7 +456,7 @@ static int vnc_start_server(int display) (main_t)vnc_server, argv); if (pid < 0) { - gdbg("ERROR: Failed to start the VNC server: %d\n", (int)pid); + gerr("ERROR: Failed to start the VNC server: %d\n", (int)pid); return (int)pid; } @@ -588,7 +588,7 @@ static inline int vnc_wait_connect(int display) if (result < 0) { DEBUGASSERT(g_vnc_sessions[display] == NULL); - gdbg("ERROR: VNC server startup failed: %d\n", result); + gerr("ERROR: VNC server startup failed: %d\n", result); } else { @@ -884,7 +884,7 @@ void nx_notify_rectangle(FAR NX_PLANEINFOTYPE *pinfo, ret = vnc_update_rectangle(session, rect, true); if (ret < 0) { - gdbg("ERROR: vnc_update_rectangle failed: %d\n", ret); + gerr("ERROR: vnc_update_rectangle failed: %d\n", ret); } } } diff --git a/graphics/vnc/server/vnc_negotiate.c b/graphics/vnc/server/vnc_negotiate.c index 3e6eae0f58..3a28cb3350 100644 --- a/graphics/vnc/server/vnc_negotiate.c +++ b/graphics/vnc/server/vnc_negotiate.c @@ -132,7 +132,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (ret < 0) { errcode = get_errno(); - gdbg("ERROR: Failed to set receive timeout: %d\n", errcode); + gerr("ERROR: Failed to set receive timeout: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } @@ -147,7 +147,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (nsent < 0) { errcode = get_errno(); - gdbg("ERROR: Send ProtocolVersion failed: %d\n", errcode); + gerr("ERROR: Send ProtocolVersion failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } @@ -162,13 +162,13 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (nrecvd < 0) { errcode = get_errno(); - gdbg("ERROR: Receive protocol confirmation failed: %d\n", errcode); + gerr("ERROR: Receive protocol confirmation failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } else if (nrecvd == 0) { - gdbg("Connection closed\n"); + gerr("Connection closed\n"); return -ECONNABORTED; } @@ -190,7 +190,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (nsent < 0) { errcode = get_errno(); - gdbg("ERROR: Send Security failed: %d\n", errcode); + gerr("ERROR: Send Security failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } @@ -213,7 +213,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (nsent < 0) { errcode = get_errno(); - gdbg("ERROR: Send SupportedSecurityTypes failed: %d\n", errcode); + gerr("ERROR: Send SupportedSecurityTypes failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } @@ -234,13 +234,13 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (nrecvd < 0) { errcode = get_errno(); - gdbg("ERROR: Receive SecurityType failed: %d\n", errcode); + gerr("ERROR: Receive SecurityType failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } else if (nrecvd == 0) { - gdbg("Connection closed\n"); + gerr("Connection closed\n"); return -ECONNABORTED; } @@ -252,7 +252,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (sectype->type != RFB_SECTYPE_NONE) { - gdbg("ERROR: Received unsupported SecurityType: %d\n", sectype->type); + gerr("ERROR: Received unsupported SecurityType: %d\n", sectype->type); /* REVISIT: Should send the reason string here */ @@ -263,7 +263,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (nsent < 0) { errcode = get_errno(); - gdbg("ERROR: Send SecurityResult failed: %d\n", errcode); + gerr("ERROR: Send SecurityResult failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } @@ -282,7 +282,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (nsent < 0) { errcode = get_errno(); - gdbg("ERROR: Send failure reason failed: %d\n", errcode); + gerr("ERROR: Send failure reason failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } @@ -298,7 +298,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (nsent < 0) { errcode = get_errno(); - gdbg("ERROR: Send SecurityResult failed: %d\n", errcode); + gerr("ERROR: Send SecurityResult failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } @@ -323,13 +323,13 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (nrecvd < 0) { errcode = get_errno(); - gdbg("ERROR: Receive ClientInit failed: %d\n", errcode); + gerr("ERROR: Receive ClientInit failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } else if (nrecvd == 0) { - gdbg("Connection closed\n"); + gerr("Connection closed\n"); return -ECONNABORTED; } @@ -379,7 +379,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (nsent < 0) { errcode = get_errno(); - gdbg("ERROR: Send ServerInit failed: %d\n", errcode); + gerr("ERROR: Send ServerInit failed: %d\n", errcode); return -errcode; } @@ -398,25 +398,25 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (nrecvd < 0) { errcode = get_errno(); - gdbg("ERROR: Receive SetPixelFormat failed: %d\n", errcode); + gerr("ERROR: Receive SetPixelFormat failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } else if (nrecvd == 0) { - gdbg("Connection closed\n"); + gerr("Connection closed\n"); return -ECONNABORTED; } else if (nrecvd != sizeof(struct rfb_setpixelformat_s)) { /* Must not be a SetPixelFormat message? */ - gdbg("ERROR: SetFormat wrong size: %d\n", (int)nrecvd); + gerr("ERROR: SetFormat wrong size: %d\n", (int)nrecvd); return -EPROTO; } else if (setformat->msgtype != RFB_SETPIXELFMT_MSG) { - gdbg("ERROR: Not a SetPixelFormat message: %d\n", + gerr("ERROR: Not a SetPixelFormat message: %d\n", (int)setformat->msgtype); return -EPROTO; } @@ -430,7 +430,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) { /* We do not support this pixel format */ - gdbg("ERROR: PixelFormat not supported\n"); + gerr("ERROR: PixelFormat not supported\n"); return ret; } @@ -445,13 +445,13 @@ int vnc_negotiate(FAR struct vnc_session_s *session) if (nrecvd < 0) { errcode = get_errno(); - gdbg("ERROR: Receive SetEncodings failed: %d\n", errcode); + gerr("ERROR: Receive SetEncodings failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } else if (nrecvd == 0) { - gdbg("Connection closed\n"); + gerr("Connection closed\n"); return -ECONNABORTED; } @@ -464,7 +464,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) ret = vnc_client_encodings(session, encodings); if (ret < 0) { - gdbg("ERROR: vnc_set_encodings failed: %d\n", ret); + gerr("ERROR: vnc_set_encodings failed: %d\n", ret); return ret; } } @@ -496,7 +496,7 @@ int vnc_client_pixelformat(FAR struct vnc_session_s *session, { /* At present, we support only TrueColor formats */ - gdbg("ERROR: No support for palette colors\n"); + gerr("ERROR: No support for palette colors\n"); return -ENOSYS; } @@ -545,7 +545,7 @@ int vnc_client_pixelformat(FAR struct vnc_session_s *session, { /* We do not support any other conversions */ - gdbg("ERROR: No support for this BPP=%d and depth=%d\n", + gerr("ERROR: No support for this BPP=%d and depth=%d\n", pixelfmt->bpp, pixelfmt->depth); return -ENOSYS; } diff --git a/graphics/vnc/server/vnc_raw.c b/graphics/vnc/server/vnc_raw.c index b3decfd8a3..8e58cfc1d3 100644 --- a/graphics/vnc/server/vnc_raw.c +++ b/graphics/vnc/server/vnc_raw.c @@ -345,7 +345,7 @@ int vnc_raw(FAR struct vnc_session_s *session, FAR struct nxgl_rect_s *rect) break; default: - gdbg("ERROR: Unrecognized color format: %d\n", session->colorfmt); + gerr("ERROR: Unrecognized color format: %d\n", session->colorfmt); return -EINVAL; } @@ -483,7 +483,7 @@ int vnc_raw(FAR struct vnc_session_s *session, FAR struct nxgl_rect_s *rect) if (nsent < 0) { int errcode = get_errno(); - gdbg("ERROR: Send FrameBufferUpdate failed: %d\n", + gerr("ERROR: Send FrameBufferUpdate failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; diff --git a/graphics/vnc/server/vnc_receiver.c b/graphics/vnc/server/vnc_receiver.c index a3cc473ba9..530f5c0ab3 100644 --- a/graphics/vnc/server/vnc_receiver.c +++ b/graphics/vnc/server/vnc_receiver.c @@ -105,7 +105,7 @@ int vnc_read_remainder(FAR struct vnc_session_s *session, size_t msglen, if (nrecvd < 0) { errcode = get_errno(); - gdbg("ERROR: Receive message failed: %d\n", errcode); + gerr("ERROR: Receive message failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } @@ -156,7 +156,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) if (ret < 0) { errcode = get_errno(); - gdbg("ERROR: Failed to disable receive timeout: %d\n", errcode); + gerr("ERROR: Failed to disable receive timeout: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } @@ -175,7 +175,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) if (nrecvd < 0) { errcode = get_errno(); - gdbg("ERROR: Receive byte failed: %d\n", errcode); + gerr("ERROR: Receive byte failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } @@ -186,7 +186,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) else if (nrecvd == 0) { - gdbg("Connection closed\n", errcode); + gerr("Connection closed\n", errcode); return OK; } @@ -209,7 +209,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) 1); if (ret < 0) { - gdbg("ERROR: Failed to read SetPixelFormat message: %d\n", + gerr("ERROR: Failed to read SetPixelFormat message: %d\n", ret); } else @@ -223,7 +223,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) /* We do not support this pixel format */ /* REVISIT: We are going to be putting garbage on the RFB */ - gdbg("ERROR: PixelFormat not supported\n"); + gerr("ERROR: PixelFormat not supported\n"); } } } @@ -245,7 +245,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) 1); if (ret < 0) { - gdbg("ERROR: Failed to read SetEncodings message: %d\n", + gerr("ERROR: Failed to read SetEncodings message: %d\n", ret); } else @@ -260,7 +260,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) SIZEOF_RFB_SERVERINIT_S(0)); if (ret < 0) { - gdbg("ERROR: Failed to read encodings: %d\n", + gerr("ERROR: Failed to read encodings: %d\n", ret); } else @@ -270,7 +270,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) ret = vnc_client_encodings(session, encodings); if (ret < 0) { - gdbg("ERROR: vnc_set_encodings failed: %d\n", ret); + gerr("ERROR: vnc_set_encodings failed: %d\n", ret); } } } @@ -291,7 +291,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) 1); if (ret < 0) { - gdbg("ERROR: Failed to read FramebufferUpdateRequest message: %d\n", + gerr("ERROR: Failed to read FramebufferUpdateRequest message: %d\n", ret); } else @@ -308,7 +308,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) ret = vnc_update_rectangle(session, &rect, false); if (ret < 0) { - gdbg("ERROR: Failed to queue update: %d\n", ret); + gerr("ERROR: Failed to queue update: %d\n", ret); } } } @@ -327,7 +327,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) 1); if (ret < 0) { - gdbg("ERROR: Failed to read KeyEvent message: %d\n", + gerr("ERROR: Failed to read KeyEvent message: %d\n", ret); } else @@ -356,7 +356,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) 1); if (ret < 0) { - gdbg("ERROR: Failed to read PointerEvent message: %d\n", + gerr("ERROR: Failed to read PointerEvent message: %d\n", ret); } #ifdef CONFIG_NX_XYINPUT @@ -412,7 +412,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) 1); if (ret < 0) { - gdbg("ERROR: Failed to read ClientCutText message: %d\n", + gerr("ERROR: Failed to read ClientCutText message: %d\n", ret); } else @@ -426,7 +426,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) SIZEOF_RFB_CLIENTCUTTEXT_S(0)); if (ret < 0) { - gdbg("ERROR: Failed to read text: %d\n", + gerr("ERROR: Failed to read text: %d\n", ret); } else @@ -438,7 +438,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) break; default: - gdbg("ERROR: Unsynchronized, msgtype=%d\n", session->inbuf[0]); + gerr("ERROR: Unsynchronized, msgtype=%d\n", session->inbuf[0]); return -EPROTO; } } diff --git a/graphics/vnc/server/vnc_rre.c b/graphics/vnc/server/vnc_rre.c index 0be90029c6..cc0d3c9317 100644 --- a/graphics/vnc/server/vnc_rre.c +++ b/graphics/vnc/server/vnc_rre.c @@ -276,7 +276,7 @@ int vnc_rre(FAR struct vnc_session_s *session, FAR struct nxgl_rect_s *rect) break; default: - gdbg("ERROR: Unrecognized color format: %d\n", + gerr("ERROR: Unrecognized color format: %d\n", session->colorfmt); return -EINVAL; } @@ -296,7 +296,7 @@ int vnc_rre(FAR struct vnc_session_s *session, FAR struct nxgl_rect_s *rect) if (nsent < 0) { int errcode = get_errno(); - gdbg("ERROR: Send RRE FrameBufferUpdate failed: %d\n", + gerr("ERROR: Send RRE FrameBufferUpdate failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; diff --git a/graphics/vnc/server/vnc_server.c b/graphics/vnc/server/vnc_server.c index fd795398c3..7c4aa84ad3 100644 --- a/graphics/vnc/server/vnc_server.c +++ b/graphics/vnc/server/vnc_server.c @@ -248,7 +248,7 @@ int vnc_server(int argc, FAR char *argv[]) if (argc != 2) { - gdbg("ERROR: Unexpected number of arguments: %d\n", argc); + gerr("ERROR: Unexpected number of arguments: %d\n", argc); ret = -EINVAL; goto errout_with_post; } @@ -256,7 +256,7 @@ int vnc_server(int argc, FAR char *argv[]) display = atoi(argv[1]); if (display < 0 || display >= RFB_MAX_DISPLAYS) { - gdbg("ERROR: Invalid display number: %d\n", display); + gerr("ERROR: Invalid display number: %d\n", display); ret = -EINVAL; goto errout_with_post; } @@ -270,7 +270,7 @@ int vnc_server(int argc, FAR char *argv[]) fb = (FAR uint8_t *)kmm_zalloc(RFB_SIZE); if (fb == NULL) { - gdbg("ERROR: Failed to allocate framebuffer memory: %lu KB\n", + gerr("ERROR: Failed to allocate framebuffer memory: %lu KB\n", (unsigned long)(RFB_SIZE / 1024)); ret = -ENOMEM; goto errout_with_post; @@ -281,7 +281,7 @@ int vnc_server(int argc, FAR char *argv[]) session = kmm_zalloc(sizeof(struct vnc_session_s)); if (session == NULL) { - gdbg("ERROR: Failed to allocate session\n"); + gerr("ERROR: Failed to allocate session\n"); ret = -ENOMEM; goto errout_with_fb; } @@ -324,7 +324,7 @@ int vnc_server(int argc, FAR char *argv[]) ret = vnc_negotiate(session); if (ret < 0) { - gdbg("ERROR: Failed to negotiate security/framebuffer: %d\n", + gerr("ERROR: Failed to negotiate security/framebuffer: %d\n", ret); continue; } @@ -336,7 +336,7 @@ int vnc_server(int argc, FAR char *argv[]) ret = vnc_start_updater(session); if (ret < 0) { - gdbg("ERROR: Failed to start updater thread: %d\n", ret); + gerr("ERROR: Failed to start updater thread: %d\n", ret); continue; } @@ -362,7 +362,7 @@ int vnc_server(int argc, FAR char *argv[]) ret = vnc_stop_updater(session); if (ret < 0) { - gdbg("ERROR: Failed to stop updater thread: %d\n", ret); + gerr("ERROR: Failed to stop updater thread: %d\n", ret); } } } diff --git a/graphics/vnc/server/vnc_server.h b/graphics/vnc/server/vnc_server.h index 182e7d038b..a625b1ed1c 100644 --- a/graphics/vnc/server/vnc_server.h +++ b/graphics/vnc/server/vnc_server.h @@ -186,24 +186,24 @@ #ifdef CONFIG_VNCSERVER_UPDATE_DEBUG # ifdef CONFIG_CPP_HAVE_VARARGS -# define upddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define upderr(format, ...) err(format, ##__VA_ARGS__) # define updllerr(format, ...) llerr(format, ##__VA_ARGS__) # define updinfo(format, ...) info(format, ##__VA_ARGS__) # define updllinfo(format, ...) llinfo(format, ##__VA_ARGS__) # else -# define upddbg dbg +# define upderr err # define updllerr llerr # define updinfo info # define updllinfo llinfo # endif #else # ifdef CONFIG_CPP_HAVE_VARARGS -# define upddbg(x...) +# define upderr(x...) # define updllerr(x...) # define updinfo(x...) # define updllinfo(x...) # else -# define upddbg (void) +# define upderr (void) # define updllerr (void) # define updinfo (void) # define updllinfo (void) diff --git a/graphics/vnc/server/vnc_updater.c b/graphics/vnc/server/vnc_updater.c index 675d36fd4a..a0c23a0c02 100644 --- a/graphics/vnc/server/vnc_updater.c +++ b/graphics/vnc/server/vnc_updater.c @@ -76,7 +76,7 @@ ****************************************************************************/ #ifdef VNCSERVER_SEM_DEBUG -static sem_t g_dbgsem = SEM_INITIALIZER(1); +static sem_t g_errsem = SEM_INITIALIZER(1); #endif /* A rectangle represent the entire local framebuffer */ @@ -126,7 +126,7 @@ static void vnc_sem_debug(FAR struct vnc_session_s *session, int freewaiting; int queuewaiting; - while (sem_wait(&g_dbgsem) < 0) + while (sem_wait(&g_errsem) < 0) { DEBUGASSERT(get_errno() == EINTR); } @@ -168,7 +168,7 @@ static void vnc_sem_debug(FAR struct vnc_session_s *session, syslog(LOG_INFO, " Unqueued: %u\n", unattached); } - sem_post(&g_dbgsem); + sem_post(&g_errsem); } #else # define vnc_sem_debug(s,m,u) @@ -412,7 +412,7 @@ static FAR void *vnc_updater(FAR void *arg) if (ret < 0) { - gdbg("ERROR: Encoding failed: %d\n", ret); + gerr("ERROR: Encoding failed: %d\n", ret); break; } } diff --git a/include/debug.h b/include/debug.h index bc825b35af..5fe9af5f88 100644 --- a/include/debug.h +++ b/include/debug.h @@ -69,10 +69,10 @@ * additional configuration setting to enable it (e.g., CONFIG_DEBUG_NET * for the network, CONFIG_DEBUG_FS for the file system, etc). * - * In general, error messages and output of importance use [a-z]dbg(). - * [a-z]dbg() is implementation dependent but usually uses file descriptors. + * In general, error messages and output of importance use [a-z]err(). + * [a-z]err() is implementation dependent but usually uses file descriptors. * (that is a problem only because the interrupt task may have re- - * directed stdout). Therefore [a-z]dbg() should not be used in interrupt + * directed stdout). Therefore [a-z]err() should not be used in interrupt * handlers. * * [a-z]warn() -- Identical to [a-z]info() except that it also requires that @@ -80,12 +80,12 @@ * conditions that are potential errors (or perhaps real errors with non- * fatal consequences). * - * [a-z]dbg() -- Identical to [a-z]info() except that it also requires that - * CONFIG_DEBUG_FEATURES be defined. This is intended for important error-related + * [a-z]err() -- Identical to [a-z]info() except that it also requires that + * CONFIG_DEBUG_ERROR be defined. This is intended for important error-related * information that you probably not want to suppress during normal debug * general debugging. * - * [a-z]llinfo() -- Identical to [a-z]dbg() except this is uses special + * [a-z]llinfo() -- Identical to [a-z]err() except this is uses special * interfaces provided by architecture-specific logic to talk directly * to the underlying console hardware. If the architecture provides such * logic, it should define CONFIG_ARCH_LOWPUTC. @@ -102,7 +102,7 @@ * fatal consequences). * * [a-z]llerr() -- Identical to [a-z]llinfo() except that it also requires that - * CONFIG_DEBUG_FEATURES be defined. This is intended for important error-related + * CONFIG_DEBUG_ERROR be defined. This is intended for important error-related * information that you probably not want to suppress during normal debug * general debugging. */ @@ -132,8 +132,8 @@ /* C-99 style variadic macros are supported */ -#ifdef CONFIG_DEBUG_FEATURES -# define dbg(format, ...) \ +#ifdef CONFIG_DEBUG_ERROR +# define err(format, ...) \ __arch_syslog(LOG_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) # ifdef CONFIG_ARCH_LOWPUTC @@ -142,9 +142,8 @@ # else # define llerr(x...) # endif -#else /* CONFIG_DEBUG_FEATURES */ - -# define dbg(x...) +#else /* CONFIG_DEBUG_ERROR */ +# define err(x...) # define llerr(x...) #endif @@ -181,14 +180,14 @@ /* Subsystem specific debug */ #ifdef CONFIG_DEBUG_MM -# define mdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define merr(format, ...) err(format, ##__VA_ARGS__) # define mllerr(format, ...) llerr(format, ##__VA_ARGS__) # define mwarn(format, ...) warn(format, ##__VA_ARGS__) # define mllwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define minfo(format, ...) info(format, ##__VA_ARGS__) # define mllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define mdbg(x...) +# define merr(x...) # define mllerr(x...) # define mwarn(x...) # define mllwarn(x...) @@ -197,14 +196,14 @@ #endif #ifdef CONFIG_DEBUG_SCHED -# define sdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define serr(format, ...) err(format, ##__VA_ARGS__) # define sllerr(format, ...) llerr(format, ##__VA_ARGS__) # define swarn(format, ...) warn(format, ##__VA_ARGS__) # define sllwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define sinfo(format, ...) info(format, ##__VA_ARGS__) # define sllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define sdbg(x...) +# define serr(x...) # define sllerr(x...) # define swarn(x...) # define sllwarn(x...) @@ -213,14 +212,14 @@ #endif #ifdef CONFIG_DEBUG_PAGING -# define pgdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define pgerr(format, ...) err(format, ##__VA_ARGS__) # define pgllerr(format, ...) llerr(format, ##__VA_ARGS__) # define pgwarn(format, ...) warn(format, ##__VA_ARGS__) # define pgllwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define pginfo(format, ...) info(format, ##__VA_ARGS__) # define pgllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define pgdbg(x...) +# define pgerr(x...) # define pgllerr(x...) # define pgwarn(x...) # define pgllwarn(x...) @@ -229,14 +228,14 @@ #endif #ifdef CONFIG_DEBUG_DMA -# define dmadbg(format, ...) dbg(format, ##__VA_ARGS__) +# define dmaerr(format, ...) err(format, ##__VA_ARGS__) # define dmallerr(format, ...) llerr(format, ##__VA_ARGS__) # define dmawarn(format, ...) warn(format, ##__VA_ARGS__) # define dmallwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define dmainfo(format, ...) info(format, ##__VA_ARGS__) # define dmallinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define dmadbg(x...) +# define dmaerr(x...) # define dmallerr(x...) # define dmawarn(x...) # define dmallwarn(x...) @@ -245,14 +244,14 @@ #endif #ifdef CONFIG_DEBUG_NET -# define ndbg(format, ...) dbg(format, ##__VA_ARGS__) +# define nerr(format, ...) err(format, ##__VA_ARGS__) # define nllerr(format, ...) llerr(format, ##__VA_ARGS__) # define nwarn(format, ...) warn(format, ##__VA_ARGS__) # define nllwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define ninfo(format, ...) info(format, ##__VA_ARGS__) # define nllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define ndbg(x...) +# define nerr(x...) # define nllerr(x...) # define nwarn(x...) # define nllwarn(x...) @@ -261,14 +260,14 @@ #endif #ifdef CONFIG_DEBUG_USB -# define udbg(format, ...) dbg(format, ##__VA_ARGS__) +# define uerr(format, ...) err(format, ##__VA_ARGS__) # define ullerr(format, ...) llerr(format, ##__VA_ARGS__) # define uwarn(format, ...) warn(format, ##__VA_ARGS__) # define ullwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define uinfo(format, ...) info(format, ##__VA_ARGS__) # define ullinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define udbg(x...) +# define uerr(x...) # define ullerr(x...) # define uwarn(x...) # define ullwarn(x...) @@ -277,14 +276,14 @@ #endif #ifdef CONFIG_DEBUG_FS -# define fdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define ferr(format, ...) err(format, ##__VA_ARGS__) # define fllerr(format, ...) llerr(format, ##__VA_ARGS__) # define fwarn(format, ...) warn(format, ##__VA_ARGS__) # define fllwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define finfo(format, ...) info(format, ##__VA_ARGS__) # define fllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define fdbg(x...) +# define ferr(x...) # define fllerr(x...) # define fwarn(x...) # define fllwarn(x...) @@ -293,14 +292,14 @@ #endif #ifdef CONFIG_DEBUG_CRYPTO -# define cryptdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define crypterr(format, ...) err(format, ##__VA_ARGS__) # define cryptllerr(format, ...) llerr(format, ##__VA_ARGS__) # define cryptwarn(format, ...) warn(format, ##__VA_ARGS__) # define cryptllwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define cryptinfo(format, ...) info(format, ##__VA_ARGS__) # define cryptllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define cryptdbg(x...) +# define crypterr(x...) # define cryptllerr(x...) # define cryptwarn(x...) # define cryptllwarn(x...) @@ -309,14 +308,14 @@ #endif #ifdef CONFIG_DEBUG_INPUT -# define idbg(format, ...) dbg(format, ##__VA_ARGS__) +# define ierr(format, ...) err(format, ##__VA_ARGS__) # define illerr(format, ...) llerr(format, ##__VA_ARGS__) # define iwarn(format, ...) warn(format, ##__VA_ARGS__) # define illwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define iinfo(format, ...) info(format, ##__VA_ARGS__) # define illinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define idbg(x...) +# define ierr(x...) # define illerr(x...) # define iwarn(x...) # define illwarn(x...) @@ -325,14 +324,14 @@ #endif #ifdef CONFIG_DEBUG_SENSORS -# define sndbg(format, ...) dbg(format, ##__VA_ARGS__) +# define snerr(format, ...) err(format, ##__VA_ARGS__) # define snllerr(format, ...) llerr(format, ##__VA_ARGS__) # define snwarn(format, ...) warn(format, ##__VA_ARGS__) # define snllwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define sninfo(format, ...) info(format, ##__VA_ARGS__) # define snllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define sndbg(x...) +# define snerr(x...) # define snllerr(x...) # define snwarn(x...) # define snllwarn(x...) @@ -341,14 +340,14 @@ #endif #ifdef CONFIG_DEBUG_ANALOG -# define adbg(format, ...) dbg(format, ##__VA_ARGS__) +# define aerr(format, ...) err(format, ##__VA_ARGS__) # define allerr(format, ...) llerr(format, ##__VA_ARGS__) # define awarn(format, ...) warn(format, ##__VA_ARGS__) # define allwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define ainfo(format, ...) info(format, ##__VA_ARGS__) # define allinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define adbg(x...) +# define aerr(x...) # define allerr(x...) # define awarn(x...) # define allwarn(x...) @@ -357,14 +356,14 @@ #endif #ifdef CONFIG_DEBUG_GRAPHICS -# define gdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define gerr(format, ...) err(format, ##__VA_ARGS__) # define gllerr(format, ...) llerr(format, ##__VA_ARGS__) # define gwarn(format, ...) warn(format, ##__VA_ARGS__) # define gllwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define ginfo(format, ...) info(format, ##__VA_ARGS__) # define gllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define gdbg(x...) +# define gerr(x...) # define gllerr(x...) # define gwarn(x...) # define gllwarn(x...) @@ -373,14 +372,14 @@ #endif #ifdef CONFIG_DEBUG_BINFMT -# define bdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define berr(format, ...) err(format, ##__VA_ARGS__) # define bllerr(format, ...) llerr(format, ##__VA_ARGS__) # define bwarn(format, ...) warn(format, ##__VA_ARGS__) # define bllwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define binfo(format, ...) info(format, ##__VA_ARGS__) # define bllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define bdbg(x...) +# define berr(x...) # define bllerr(x...) # define bwarn(x...) # define bllwarn(x...) @@ -389,14 +388,14 @@ #endif #ifdef CONFIG_DEBUG_LIB -# define ldbg(format, ...) dbg(format, ##__VA_ARGS__) +# define lerr(format, ...) err(format, ##__VA_ARGS__) # define lllerr(format, ...) llerr(format, ##__VA_ARGS__) # define lwarn(format, ...) warn(format, ##__VA_ARGS__) # define lllwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define linfo(format, ...) info(format, ##__VA_ARGS__) # define lllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define ldbg(x...) +# define lerr(x...) # define lllerr(x...) # define lwarn(x...) # define lllwarn(x...) @@ -405,14 +404,14 @@ #endif #ifdef CONFIG_DEBUG_AUDIO -# define auddbg(format, ...) dbg(format, ##__VA_ARGS__) +# define auderr(format, ...) err(format, ##__VA_ARGS__) # define audllerr(format, ...) llerr(format, ##__VA_ARGS__) # define audwarn(format, ...) warn(format, ##__VA_ARGS__) # define audllwarn(format, ...) llwarn(format, ##__VA_ARGS__) # define audinfo(format, ...) info(format, ##__VA_ARGS__) # define audllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define auddbg(x...) +# define auderr(x...) # define audllerr(x...) # define audwarn(x...) # define audllwarn(x...) @@ -424,12 +423,12 @@ /* Variadic macros NOT supported */ -#ifdef CONFIG_DEBUG_FEATURES +#ifdef CONFIG_DEBUG_ERROR # ifndef CONFIG_ARCH_LOWPUTC # define llerr (void) # endif #else -# define dbg (void) +# define err (void) # define llerr (void) #endif @@ -454,14 +453,14 @@ /* Subsystem specific debug */ #ifdef CONFIG_DEBUG_MM -# define mdbg dbg +# define merr err # define mllerr llerr # define mwarn warn # define mllwarn llwarn # define minfo info # define mllinfo llinfo #else -# define mdbg (void) +# define merr (void) # define mllerr (void) # define mwarn (void) # define mllwarn (void) @@ -470,14 +469,14 @@ #endif #ifdef CONFIG_DEBUG_SCHED -# define sdbg dbg +# define serr err # define sllerr llerr # define swarn warn # define sllwarn llwarn # define sinfo info # define sllinfo llinfo #else -# define sdbg (void) +# define serr (void) # define sllerr (void) # define swarn (void) # define sllwarn (void) @@ -486,14 +485,14 @@ #endif #ifdef CONFIG_DEBUG_PAGING -# define pgdbg dbg +# define pgerr err # define pgllerr llerr # define pgwarn warn # define pgllwarn llwarn # define pginfo info # define pgllinfo llinfo #else -# define pgdbg (void) +# define pgerr (void) # define pgllerr (void) # define pgwarn (void) # define pgllwarn (void) @@ -502,14 +501,14 @@ #endif #ifdef CONFIG_DEBUG_DMA -# define dmadbg dbg +# define dmaerr err # define dmallerr llerr # define dmawarn warn # define dmallwarn llwarn # define dmainfo info # define dmallinfo llinfo #else -# define dmadbg (void) +# define dmaerr (void) # define dmallerr (void) # define dmawarn (void) # define dmallwarn (void) @@ -518,14 +517,14 @@ #endif #ifdef CONFIG_DEBUG_NET -# define ndbg dbg +# define nerr err # define nllerr llerr # define nwarn warn # define nllwarn llwarn # define ninfo info # define nllinfo llinfo #else -# define ndbg (void) +# define nerr (void) # define nllerr (void) # define nwarn (void) # define nllwarn (void) @@ -534,14 +533,14 @@ #endif #ifdef CONFIG_DEBUG_USB -# define udbg dbg +# define uerr err # define ullerr llerr # define uwarn warn # define ullwarn llwarn # define uinfo info # define ullinfo llinfo #else -# define udbg (void) +# define uerr (void) # define ullerr (void) # define uwarn (void) # define ullwarn (void) @@ -550,14 +549,14 @@ #endif #ifdef CONFIG_DEBUG_FS -# define fdbg dbg +# define ferr err # define fllerr llerr # define fwarn warn # define fllwarn llwarn # define finfo info # define fllinfo llinfo #else -# define fdbg (void) +# define ferr (void) # define fllerr (void) # define fwarn (void) # define fllwarn (void) @@ -566,14 +565,14 @@ #endif #ifdef CONFIG_DEBUG_CRYPTO -# define cryptdbg dbg +# define crypterr err # define cryptllerr llerr # define cryptwarn warn # define cryptllwarn llwarn # define cryptinfo info # define cryptllinfo llinfo #else -# define cryptdbg (void) +# define crypterr (void) # define cryptllerr (void) # define cryptwarn (void) # define cryptllwarn (void) @@ -582,14 +581,14 @@ #endif #ifdef CONFIG_DEBUG_INPUT -# define idbg dbg +# define ierr err # define illerr llerr # define iwarn warn # define illwarn llwarn # define iinfo info # define illinfo llinfo #else -# define idbg (void) +# define ierr (void) # define illerr (void) # define iwarn (void) # define illwarn (void) @@ -598,14 +597,14 @@ #endif #ifdef CONFIG_DEBUG_SENSORS -# define sndbg dbg +# define snerr err # define snllerr llerr # define snwarn warn # define snllwarn llwarn # define sninfo info # define snllinfo llinfo #else -# define sndbg (void) +# define snerr (void) # define snllerr (void) # define snwarn (void) # define snllwarn (void) @@ -614,14 +613,14 @@ #endif #ifdef CONFIG_DEBUG_ANALOG -# define adbg dbg +# define aerr err # define allerr llerr # define awarn warn # define allwarn llwarn # define ainfo info # define allinfo llinfo #else -# define adbg (void) +# define aerr (void) # define allerr (void) # define awarn (void) # define allwarn (void) @@ -630,14 +629,14 @@ #endif #ifdef CONFIG_DEBUG_GRAPHICS -# define gdbg dbg +# define gerr err # define gllerr llerr # define gwarn warn # define gllwarn llwarn # define ginfo info # define gllinfo llinfo #else -# define gdbg (void) +# define gerr (void) # define gllerr (void) # define gwarn (void) # define gllwarn (void) @@ -646,14 +645,14 @@ #endif #ifdef CONFIG_DEBUG_BINFMT -# define bdbg dbg +# define berr err # define bllerr llerr # define bwarn warn # define bllwarn llwarn # define binfo info # define bllinfo llinfo #else -# define bdbg (void) +# define berr (void) # define bllerr (void) # define bwarn (void) # define bllwarn (void) @@ -662,14 +661,14 @@ #endif #ifdef CONFIG_DEBUG_LIB -# define ldbg dbg +# define lerr err # define lllerr llerr # define lwarn warn # define lllwarn llwarn # define linfo info # define lllinfo llinfo #else -# define ldbg (void) +# define lerr (void) # define lllerr (void) # define lwarn (void) # define lllwarn (void) @@ -678,14 +677,14 @@ #endif #ifdef CONFIG_DEBUG_AUDIO -# define auddbg dbg +# define auderr err # define audllerr llerr # define audwarn warn # define audllwarn llwarn # define audinfo info # define audllinfo llinfo #else -# define auddbg (void) +# define auderr (void) # define audllerr (void) # define audwarn (void) # define audllwarn (void) @@ -697,113 +696,113 @@ /* Buffer dumping macros do not depend on varargs */ -#ifdef CONFIG_DEBUG_FEATURES -# define dbgdumpbuffer(m,b,n) lib_dumpbuffer(m,b,n) +#ifdef CONFIG_DEBUG_ERROR +# define errdumpbuffer(m,b,n) lib_dumpbuffer(m,b,n) # ifdef CONFIG_DEBUG_INFO # define infodumpbuffer(m,b,n) lib_dumpbuffer(m,b,n) # else # define infodumpbuffer(m,b,n) # endif #else -# define dbgdumpbuffer(m,b,n) +# define errdumpbuffer(m,b,n) # define infodumpbuffer(m,b,n) # endif /* Subsystem specific debug */ #ifdef CONFIG_DEBUG_MM -# define mdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n) +# define merrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define minfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) #else -# define mdbgdumpbuffer(m,b,n) +# define merrdumpbuffer(m,b,n) # define minfodumpbuffer(m,b,n) #endif #ifdef CONFIG_DEBUG_SCHED -# define sdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n) +# define serrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define sinfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) #else -# define sdbgdumpbuffer(m,b,n) +# define serrdumpbuffer(m,b,n) # define sinfodumpbuffer(m,b,n) #endif #ifdef CONFIG_DEBUG_PAGING -# define pgdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n) +# define pgerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define pginfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) #else -# define pgdbgdumpbuffer(m,b,n) +# define pgerrdumpbuffer(m,b,n) # define pginfodumpbuffer(m,b,n) #endif #ifdef CONFIG_DEBUG_DMA -# define dmadbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n) +# define dmaerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define dmainfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) #else -# define dmadbgdumpbuffer(m,b,n) +# define dmaerrdumpbuffer(m,b,n) # define dmainfodumpbuffer(m,b,n) #endif #ifdef CONFIG_DEBUG_NET -# define ndbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n) +# define nerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define ninfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) #else -# define ndbgdumpbuffer(m,b,n) +# define nerrdumpbuffer(m,b,n) # define ninfodumpbuffer(m,b,n) #endif #ifdef CONFIG_DEBUG_USB -# define udbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n) +# define uerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define uinfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) #else -# define udbgdumpbuffer(m,b,n) +# define uerrdumpbuffer(m,b,n) # define uinfodumpbuffer(m,b,n) #endif #ifdef CONFIG_DEBUG_FS -# define fdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n) +# define ferrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define finfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) #else -# define fdbgdumpbuffer(m,b,n) +# define ferrdumpbuffer(m,b,n) # define finfodumpbuffer(m,b,n) #endif #ifdef CONFIG_DEBUG_INPUT -# define idbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n) +# define ierrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define iinfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) #else -# define idbgdumpbuffer(m,b,n) +# define ierrdumpbuffer(m,b,n) # define iinfodumpbuffer(m,b,n) #endif #ifdef CONFIG_DEBUG_GRAPHICS -# define gdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n) +# define gerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define ginfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) #else -# define gdbgdumpbuffer(m,b,n) +# define gerrdumpbuffer(m,b,n) # define ginfodumpbuffer(m,b,n) #endif #ifdef CONFIG_DEBUG_BINFMT -# define bdbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n) +# define berrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define binfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) #else -# define bdbgdumpbuffer(m,b,n) +# define berrdumpbuffer(m,b,n) # define binfodumpbuffer(m,b,n) #endif #ifdef CONFIG_DEBUG_LIB -# define ldbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n) +# define lerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define linfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) #else -# define ldbgdumpbuffer(m,b,n) +# define lerrdumpbuffer(m,b,n) # define linfodumpbuffer(m,b,n) #endif #ifdef CONFIG_DEBUG_AUDIO -# define auddbgdumpbuffer(m,b,n) dbgdumpbuffer(m,b,n) +# define auderrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define audinfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) #else -# define auddbgdumpbuffer(m,b,n) +# define auderrdumpbuffer(m,b,n) # define audinfodumpbuffer(m,b,n) #endif @@ -839,13 +838,13 @@ void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer, */ #ifndef CONFIG_CPP_HAVE_VARARGS -#ifdef CONFIG_DEBUG_FEATURES -int dbg(const char *format, ...); +#ifdef CONFIG_DEBUG_ERROR +int err(const char *format, ...); # ifdef CONFIG_ARCH_LOWPUTC int llerr(const char *format, ...); # endif -#endif /* CONFIG_DEBUG_FEATURES */ +#endif /* CONFIG_DEBUG_ERROR */ #ifdef CONFIG_DEBUG_WARN int warn(const char *format, ...); diff --git a/include/nuttx/mm/shm.h b/include/nuttx/mm/shm.h index 8c6f90cfaa..80d36f2f94 100644 --- a/include/nuttx/mm/shm.h +++ b/include/nuttx/mm/shm.h @@ -77,18 +77,18 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG_SHM -# define shmdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define shmerr(format, ...) err(format, ##__VA_ARGS__) # define shminfo(format, ...) info(format, ##__VA_ARGS__) # else -# define shmdbg(format, ...) mdbg(format, ##__VA_ARGS__) +# define shmerr(format, ...) merr(format, ##__VA_ARGS__) # define shminfo(format, ...) minfo(format, ##__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG_SHM -# define shmdbg dbg +# define shmerr err # define shminfo info # else -# define shmdbg (void) +# define shmerr (void) # define shminfo (void) # endif #endif diff --git a/include/nuttx/spi/spi_bitbang.c b/include/nuttx/spi/spi_bitbang.c index 5876d3d8ce..2ab152de3c 100644 --- a/include/nuttx/spi/spi_bitbang.c +++ b/include/nuttx/spi/spi_bitbang.c @@ -75,14 +75,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/include/nuttx/spi/spi_bitbang.h b/include/nuttx/spi/spi_bitbang.h index 33571b1bf2..5da7374370 100644 --- a/include/nuttx/spi/spi_bitbang.h +++ b/include/nuttx/spi/spi_bitbang.h @@ -62,14 +62,14 @@ #endif #ifdef CONFIG_DEBUG_SPI -# define spidbg llerr +# define spierr llerr # ifdef CONFIG_DEBUG_INFO # define spiinfo llerr # else # define spiinfo(x...) # endif #else -# define spidbg(x...) +# define spierr(x...) # define spiinfo(x...) #endif diff --git a/include/nuttx/wireless/nrf24l01.h b/include/nuttx/wireless/nrf24l01.h index 94f7f8383b..a166ebf034 100644 --- a/include/nuttx/wireless/nrf24l01.h +++ b/include/nuttx/wireless/nrf24l01.h @@ -91,12 +91,12 @@ /* NRF24L01 debug */ #ifdef NRF24L01_DEBUG -# define wdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define werr(format, ...) err(format, ##__VA_ARGS__) # define wllerr(format, ...) llerr(format, ##__VA_ARGS__) # define winfo(format, ...) info(format, ##__VA_ARGS__) # define wllinfo(format, ...) llinfo(format, ##__VA_ARGS__) #else -# define wdbg(x...) +# define werr(x...) # define wllerr(x...) # define winfo(x...) # define wllinfo(x...) diff --git a/libc/aio/lio_listio.c b/libc/aio/lio_listio.c index b123a4e735..fa03c38f62 100644 --- a/libc/aio/lio_listio.c +++ b/libc/aio/lio_listio.c @@ -255,7 +255,7 @@ static int lio_sigsetup(FAR struct aiocb * const *list, int nent, sighand = (FAR struct lio_sighand_s *)lib_zalloc(sizeof(struct lio_sighand_s)); if (!sighand) { - fdbg("ERROR: lib_zalloc failed\n"); + ferr("ERROR: lib_zalloc failed\n"); return -ENOMEM; } @@ -296,7 +296,7 @@ static int lio_sigsetup(FAR struct aiocb * const *list, int nent, if (status != OK) { int errcode = get_errno(); - fdbg("ERROR sigprocmask failed: %d\n", errcode); + ferr("ERROR sigprocmask failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } @@ -314,7 +314,7 @@ static int lio_sigsetup(FAR struct aiocb * const *list, int nent, if (status != OK) { int errcode = get_errno(); - fdbg("ERROR sigaction failed: %d\n", errcode); + ferr("ERROR sigaction failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } @@ -379,7 +379,7 @@ static int lio_waitall(FAR struct aiocb * const *list, int nent) */ int errcode = get_errno(); - fdbg("ERROR: sigwaitinfo failed: %d\n", errcode); + ferr("ERROR: sigwaitinfo failed: %d\n", errcode); DEBUGASSERT(errcode > 0); return -errcode; } @@ -600,7 +600,7 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent, /* Failed to queue the I/O. Set up the error return. */ errcode = get_errno(); - fdbg("ERROR: aio_read/write failed: %d\n", errcode); + ferr("ERROR: aio_read/write failed: %d\n", errcode); DEBUGASSERT(errcode > 0); aiocbp->aio_result = -errcode; ret = ERROR; @@ -618,7 +618,7 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent, { /* Make the invalid operation complete with an error */ - fdbg("ERROR: Unrecognized opcode: %d\n", aiocbp->aio_lio_opcode); + ferr("ERROR: Unrecognized opcode: %d\n", aiocbp->aio_lio_opcode); aiocbp->aio_result = -EINVAL; ret = ERROR; } diff --git a/libc/misc/lib_dbg.c b/libc/misc/lib_dbg.c index d04c719b1a..1687ddfc8b 100644 --- a/libc/misc/lib_dbg.c +++ b/libc/misc/lib_dbg.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/misc/lib_dbg.c + * libc/misc/lib_err.c * * Copyright (C) 2007-2009, 2011-2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -51,7 +51,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: dbg, llerr, info + * Name: err, llerr, info * * Description: * If the cross-compiler's pre-processor does not support variable @@ -60,7 +60,7 @@ ****************************************************************************/ #ifdef CONFIG_DEBUG_FEATURES -int dbg(const char *format, ...) +int err(const char *format, ...) { va_list ap; int ret; diff --git a/libc/misc/lib_slcddecode.c b/libc/misc/lib_slcddecode.c index 2f8cdaa73e..40ff576683 100644 --- a/libc/misc/lib_slcddecode.c +++ b/libc/misc/lib_slcddecode.c @@ -92,10 +92,10 @@ /* Debug ********************************************************************/ #ifdef CONFIG_DEBUG_LCD -# define lcddbg dbg +# define lcderr err # define lcdinfo info #else -# define lcddbg(x...) +# define lcderr(x...) # define lcdinfo(x...) #endif @@ -264,7 +264,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream, * return the following characters later. */ - lcddbg("Parsing failed: ESC followed by %02x\n", ch); + lcderr("Parsing failed: ESC followed by %02x\n", ch); return slcd_reget(state, pch, parg); } @@ -295,7 +295,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream, if (code < (int)FIRST_SLCDCODE || code > (int)LAST_SLCDCODE) { - lcddbg("Parsing failed: ESC-L followed by %02x\n", ch); + lcderr("Parsing failed: ESC-L followed by %02x\n", ch); /* Not a special command code.. put the character in the reget * buffer. @@ -338,7 +338,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream, * following characters later. */ - lcddbg("Parsing failed: ESC-L-%c followed by %02x\n", + lcderr("Parsing failed: ESC-L-%c followed by %02x\n", state->buf[NDX_COUNTH], ch); return slcd_reget(state, pch, parg); @@ -384,7 +384,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream, * of the characters later. */ - lcddbg("Parsing failed: ESC-L-%c-%c followed by %02x\n", + lcderr("Parsing failed: ESC-L-%c-%c followed by %02x\n", state->buf[NDX_COUNTH], state->buf[NDX_COUNTL], ch); return slcd_reget(state, pch, parg); diff --git a/libc/netdb/lib_dnsaddserver.c b/libc/netdb/lib_dnsaddserver.c index cc689b34c3..d0b7c42323 100644 --- a/libc/netdb/lib_dnsaddserver.c +++ b/libc/netdb/lib_dnsaddserver.c @@ -91,7 +91,7 @@ int dns_add_nameserver(FAR const struct sockaddr *addr, socklen_t addrlen) if (stream == NULL) { int errcode = errno; - ndbg("ERROR: Failed to open %s: %d\n", + nerr("ERROR: Failed to open %s: %d\n", CONFIG_NETDB_RESOLVCONF_PATH, errcode); DEBUGASSERT(errcode > 0); return -errcode; @@ -114,7 +114,7 @@ int dns_add_nameserver(FAR const struct sockaddr *addr, socklen_t addrlen) if (inet_ntop(AF_INET, &in4->sin_addr, addrstr, DNS_MAX_ADDRSTR) == NULL) { ret = -errno; - ndbg("ERROR: inet_ntop failed: %d\n", errcode); + nerr("ERROR: inet_ntop failed: %d\n", errcode); DEBUGASSERT(errcode < 0); goto errout; } @@ -146,7 +146,7 @@ int dns_add_nameserver(FAR const struct sockaddr *addr, socklen_t addrlen) if (inet_ntop(AF_INET6, &in6->sin6_addr, addrstr, DNS_MAX_ADDRSTR) == NULL) { ret = -errno; - ndbg("ERROR: inet_ntop failed: %d\n", errcode); + nerr("ERROR: inet_ntop failed: %d\n", errcode); DEBUGASSERT(errcode < 0); goto errout; } @@ -193,7 +193,7 @@ int dns_add_nameserver(FAR const struct sockaddr *addr, socklen_t addrlen) if (status < 0) { ret = -errno; - ndbg("ERROR: fprintf failed: %d\n", errcode); + nerr("ERROR: fprintf failed: %d\n", errcode); DEBUGASSERT(errcode < 0); goto errout; } diff --git a/libc/netdb/lib_dnsbind.c b/libc/netdb/lib_dnsbind.c index c7eae42953..3feec95912 100644 --- a/libc/netdb/lib_dnsbind.c +++ b/libc/netdb/lib_dnsbind.c @@ -91,7 +91,7 @@ int dns_bind(void) if (!dns_initialize()) { - ndbg("ERROR: DNS client has not been initialized\n"); + nerr("ERROR: DNS client has not been initialized\n"); return -EDESTADDRREQ; } @@ -101,7 +101,7 @@ int dns_bind(void) if (sd < 0) { errcode = get_errno(); - ndbg("ERROR: socket() failed: %d\n", errcode); + nerr("ERROR: socket() failed: %d\n", errcode); return -errcode; } @@ -114,7 +114,7 @@ int dns_bind(void) if (ret < 0) { errcode = get_errno(); - ndbg("ERROR: setsockopt() failed: %d\n", errcode); + nerr("ERROR: setsockopt() failed: %d\n", errcode); close(sd); return -errcode; } diff --git a/libc/netdb/lib_dnscache.c b/libc/netdb/lib_dnscache.c index 72979e4066..5a95dc9b1b 100644 --- a/libc/netdb/lib_dnscache.c +++ b/libc/netdb/lib_dnscache.c @@ -207,7 +207,7 @@ int dns_find_answer(FAR const char *hostname, FAR struct sockaddr *addr, if (!dns_initialize()) { - ndbg("ERROR: DNS failed to initialize\n"); + nerr("ERROR: DNS failed to initialize\n"); return -EAGAIN; } diff --git a/libc/netdb/lib_dnsforeach.c b/libc/netdb/lib_dnsforeach.c index 3d13dc5a63..a6693e3c57 100644 --- a/libc/netdb/lib_dnsforeach.c +++ b/libc/netdb/lib_dnsforeach.c @@ -105,7 +105,7 @@ int dns_foreach_nameserver(dns_callback_t callback, FAR void *arg) if (stream == NULL) { int errcode = errno; - ndbg("ERROR: Failed to open %s: %d\n", + nerr("ERROR: Failed to open %s: %d\n", CONFIG_NETDB_RESOLVCONF_PATH, errcode); DEBUGASSERT(errcode > 0); return -errcode; @@ -123,7 +123,7 @@ int dns_foreach_nameserver(dns_callback_t callback, FAR void *arg) addrstr = skip_spaces(ptr); if (*addrstr == '\0') { - ndbg("ERROR: Missing address in %s record\n", + nerr("ERROR: Missing address in %s record\n", CONFIG_NETDB_RESOLVCONF_PATH); continue; } @@ -155,7 +155,7 @@ int dns_foreach_nameserver(dns_callback_t callback, FAR void *arg) ptr = strchr(addrstr, ']'); if (ptr == NULL) { - ndbg("ERROR: Missing right bracket after %s\n", line); + nerr("ERROR: Missing right bracket after %s\n", line); continue; } @@ -224,7 +224,7 @@ int dns_foreach_nameserver(dns_callback_t callback, FAR void *arg) else #endif { - ndbg("ERROR: Unrecognized address: %s\n", addrstr) + nerr("ERROR: Unrecognized address: %s\n", addrstr) ret = OK; } #ifdef CONFIG_NET_IPv6 diff --git a/libc/netdb/lib_dnsquery.c b/libc/netdb/lib_dnsquery.c index 1510691438..636bad4fe4 100644 --- a/libc/netdb/lib_dnsquery.c +++ b/libc/netdb/lib_dnsquery.c @@ -213,7 +213,7 @@ static int dns_send_query(int sd, FAR const char *name, if (ret < 0) { errcode = get_errno(); - ndbg("ERROR: sendto failed: %d\n", errcode); + nerr("ERROR: sendto failed: %d\n", errcode); return -errcode; } @@ -248,7 +248,7 @@ static int dns_recv_response(int sd, FAR struct sockaddr *addr, if (ret < 0) { errcode = get_errno(); - ndbg("ERROR: recv failed: %d\n", errcode); + nerr("ERROR: recv failed: %d\n", errcode); return -errcode; } @@ -265,7 +265,7 @@ static int dns_recv_response(int sd, FAR struct sockaddr *addr, if ((hdr->flags2 & DNS_FLAG2_ERR_MASK) != 0) { - ndbg("ERROR: DNS reported error: flags2=%02x\n", hdr->flags2); + nerr("ERROR: DNS reported error: flags2=%02x\n", hdr->flags2); return -EPROTO; } @@ -290,7 +290,7 @@ static int dns_recv_response(int sd, FAR struct sockaddr *addr, for (; ; ) { - ndbg("%02X %02X %02X %02X %02X %02X %02X %02X \n", + nerr("%02X %02X %02X %02X %02X %02X %02X %02X \n", nameptr[0], nameptr[1], nameptr[2], nameptr[3], nameptr[4], nameptr[5], nameptr[6], nameptr[7]); @@ -450,7 +450,7 @@ static int dns_query_callback(FAR void *arg, FAR struct sockaddr *addr, * namserver address in resolv.conf. */ - ndbg("ERROR: Invalid IPv4 address size: %d\n", addrlen); + nerr("ERROR: Invalid IPv4 address size: %d\n", addrlen); query->result = -EINVAL; return 0; } @@ -466,7 +466,7 @@ static int dns_query_callback(FAR void *arg, FAR struct sockaddr *addr, * namserver address in resolv.conf. */ - ndbg("ERROR: IPv4 dns_send_query failed: %d\n", ret); + nerr("ERROR: IPv4 dns_send_query failed: %d\n", ret); query->result = ret; return 0; } @@ -492,7 +492,7 @@ static int dns_query_callback(FAR void *arg, FAR struct sockaddr *addr, /* Handle errors */ - ndbg("ERROR: IPv4 dns_recv_response failed: %d\n", ret); + nerr("ERROR: IPv4 dns_recv_response failed: %d\n", ret); if (ret != -EADDRNOTAVAIL) { @@ -531,7 +531,7 @@ static int dns_query_callback(FAR void *arg, FAR struct sockaddr *addr, * namserver address in resolv.conf. */ - ndbg("ERROR: Invalid IPv6 address size: %d\n", addrlen); + nerr("ERROR: Invalid IPv6 address size: %d\n", addrlen); query->result = -EINVAL; return 0; } @@ -547,7 +547,7 @@ static int dns_query_callback(FAR void *arg, FAR struct sockaddr *addr, * namserver address in resolv.conf. */ - ndbg("ERROR: IPv6 dns_send_query failed: %d\n", ret); + nerr("ERROR: IPv6 dns_send_query failed: %d\n", ret); query->result = ret; return 0; } @@ -573,7 +573,7 @@ static int dns_query_callback(FAR void *arg, FAR struct sockaddr *addr, /* Handle errors */ - ndbg("ERROR: IPv6 dns_recv_response failed: %d\n", ret); + nerr("ERROR: IPv6 dns_recv_response failed: %d\n", ret); if (ret != -EADDRNOTAVAIL) { diff --git a/libc/netdb/lib_gethostbyaddrr.c b/libc/netdb/lib_gethostbyaddrr.c index 78439b1911..53e91fda34 100644 --- a/libc/netdb/lib_gethostbyaddrr.c +++ b/libc/netdb/lib_gethostbyaddrr.c @@ -265,7 +265,7 @@ int lib_hostfile_lookup(FAR const void *addr, socklen_t len, int type, { int errcode = errno; - ndbg("ERROR: Failed to open the hosts file %s: %d\n", + nerr("ERROR: Failed to open the hosts file %s: %d\n", CONFIG_NETDB_HOSTCONF_PATH, errcode); UNUSED(errcode); diff --git a/libc/netdb/lib_gethostbynamer.c b/libc/netdb/lib_gethostbynamer.c index f6cf659596..b655211651 100644 --- a/libc/netdb/lib_gethostbynamer.c +++ b/libc/netdb/lib_gethostbynamer.c @@ -583,7 +583,7 @@ static int lib_hostfile_lookup(FAR const char *name, FAR struct hostent *host, { int errcode = errno; - ndbg("ERROR: Failed to open the hosts file %s: %d\n", + nerr("ERROR: Failed to open the hosts file %s: %d\n", CONFIG_NETDB_HOSTCONF_PATH, errcode); UNUSED(errcode); diff --git a/libc/pthread/pthread_attrdestroy.c b/libc/pthread/pthread_attrdestroy.c index 04223f0e04..beb505242c 100644 --- a/libc/pthread/pthread_attrdestroy.c +++ b/libc/pthread/pthread_attrdestroy.c @@ -69,7 +69,7 @@ int pthread_attr_destroy(FAR pthread_attr_t *attr) { int ret; - sdbg("attr=0x%p\n", attr); + serr("attr=0x%p\n", attr); if (!attr) { @@ -81,7 +81,7 @@ int pthread_attr_destroy(FAR pthread_attr_t *attr) ret = OK; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrgetaffinity.c b/libc/pthread/pthread_attrgetaffinity.c index c13ee71d0b..5588c51342 100644 --- a/libc/pthread/pthread_attrgetaffinity.c +++ b/libc/pthread/pthread_attrgetaffinity.c @@ -66,7 +66,7 @@ int pthread_attr_getaffinity_np(FAR const pthread_attr_t *attr, size_t cpusetsize, cpu_set_t *cpuset) { - sdbg("attr=0x%p cpusetsize=%d cpuset=0x%p\n", attr, (int)cpusetsize, cpuset); + serr("attr=0x%p cpusetsize=%d cpuset=0x%p\n", attr, (int)cpusetsize, cpuset); DEBUGASSERT(attr != NULL && cpusetsize == sizeof(cpu_set_t) && cpuset != NULL); diff --git a/libc/pthread/pthread_attrgetinheritsched.c b/libc/pthread/pthread_attrgetinheritsched.c index c4c2838dae..3a52eaee1f 100644 --- a/libc/pthread/pthread_attrgetinheritsched.c +++ b/libc/pthread/pthread_attrgetinheritsched.c @@ -72,7 +72,7 @@ int pthread_attr_getinheritsched(FAR const pthread_attr_t *attr, { int ret; - sdbg("attr=0x%p inheritsched=0x%p\n", attr, inheritsched); + serr("attr=0x%p inheritsched=0x%p\n", attr, inheritsched); if (!attr || !inheritsched) { @@ -84,7 +84,7 @@ int pthread_attr_getinheritsched(FAR const pthread_attr_t *attr, ret = OK; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrgetschedparam.c b/libc/pthread/pthread_attrgetschedparam.c index ddf67a1d66..fb84828f1a 100644 --- a/libc/pthread/pthread_attrgetschedparam.c +++ b/libc/pthread/pthread_attrgetschedparam.c @@ -70,7 +70,7 @@ int pthread_attr_getschedparam(FAR const pthread_attr_t *attr, { int ret; - sdbg("attr=0x%p param=0x%p\n", attr, param); + serr("attr=0x%p param=0x%p\n", attr, param); if (!attr || !param) { @@ -90,6 +90,6 @@ int pthread_attr_getschedparam(FAR const pthread_attr_t *attr, ret = OK; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrgetschedpolicy.c b/libc/pthread/pthread_attrgetschedpolicy.c index 52a48a9504..821c0bffc8 100644 --- a/libc/pthread/pthread_attrgetschedpolicy.c +++ b/libc/pthread/pthread_attrgetschedpolicy.c @@ -68,7 +68,7 @@ int pthread_attr_getschedpolicy(FAR const pthread_attr_t *attr, int *policy) { int ret; - sdbg("attr=0x%p policy=0x%p\n", attr, policy); + serr("attr=0x%p policy=0x%p\n", attr, policy); if (!attr || !policy) { @@ -80,6 +80,6 @@ int pthread_attr_getschedpolicy(FAR const pthread_attr_t *attr, int *policy) ret = OK; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrgetstacksize.c b/libc/pthread/pthread_attrgetstacksize.c index ea95ec7328..3a8df45b89 100644 --- a/libc/pthread/pthread_attrgetstacksize.c +++ b/libc/pthread/pthread_attrgetstacksize.c @@ -67,7 +67,7 @@ int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, FAR long *stacksiz { int ret; - sdbg("attr=0x%p stacksize=0x%p\n", attr, stacksize); + serr("attr=0x%p stacksize=0x%p\n", attr, stacksize); if (!stacksize) { @@ -79,7 +79,7 @@ int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, FAR long *stacksiz ret = OK; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrinit.c b/libc/pthread/pthread_attrinit.c index e073fcd89f..18d3fa09b0 100644 --- a/libc/pthread/pthread_attrinit.c +++ b/libc/pthread/pthread_attrinit.c @@ -87,7 +87,7 @@ int pthread_attr_init(FAR pthread_attr_t *attr) { int ret = OK; - sdbg("attr=0x%p\n", attr); + serr("attr=0x%p\n", attr); if (!attr) { ret = ENOMEM; @@ -102,7 +102,7 @@ int pthread_attr_init(FAR pthread_attr_t *attr) memcpy(attr, &g_default_pthread_attr, sizeof(pthread_attr_t)); } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrsetaffinity.c b/libc/pthread/pthread_attrsetaffinity.c index 0222dfdd7d..6a526cd46e 100644 --- a/libc/pthread/pthread_attrsetaffinity.c +++ b/libc/pthread/pthread_attrsetaffinity.c @@ -68,7 +68,7 @@ int pthread_attr_setaffinity_np(FAR pthread_attr_t *attr, size_t cpusetsize, FAR const cpu_set_t *cpuset) { - sdbg("attr=0x%p cpusetsize=%d cpuset=0x%p\n", attr, (int)cpusetsize, cpuset); + serr("attr=0x%p cpusetsize=%d cpuset=0x%p\n", attr, (int)cpusetsize, cpuset); DEBUGASSERT(attr != NULL && cpusetsize == sizeof(cpu_set_t) && cpuset != NULL && *cpuset != 0); diff --git a/libc/pthread/pthread_attrsetinheritsched.c b/libc/pthread/pthread_attrsetinheritsched.c index 07506773ad..a3ee237410 100644 --- a/libc/pthread/pthread_attrsetinheritsched.c +++ b/libc/pthread/pthread_attrsetinheritsched.c @@ -73,7 +73,7 @@ int pthread_attr_setinheritsched(FAR pthread_attr_t *attr, { int ret; - sdbg("inheritsched=%d\n", inheritsched); + serr("inheritsched=%d\n", inheritsched); if (!attr || (inheritsched != PTHREAD_INHERIT_SCHED && @@ -87,7 +87,7 @@ int pthread_attr_setinheritsched(FAR pthread_attr_t *attr, ret = OK; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrsetschedparam.c b/libc/pthread/pthread_attrsetschedparam.c index 70fcd11272..12af4c8ca8 100644 --- a/libc/pthread/pthread_attrsetschedparam.c +++ b/libc/pthread/pthread_attrsetschedparam.c @@ -70,7 +70,7 @@ int pthread_attr_setschedparam(FAR pthread_attr_t *attr, { int ret; - sdbg("attr=0x%p param=0x%p\n", attr, param); + serr("attr=0x%p param=0x%p\n", attr, param); if (!attr || !param) { @@ -90,6 +90,6 @@ int pthread_attr_setschedparam(FAR pthread_attr_t *attr, ret = OK; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrsetschedpolicy.c b/libc/pthread/pthread_attrsetschedpolicy.c index 76e774e250..932954edfb 100644 --- a/libc/pthread/pthread_attrsetschedpolicy.c +++ b/libc/pthread/pthread_attrsetschedpolicy.c @@ -70,7 +70,7 @@ int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy) { int ret; - sdbg("attr=0x%p policy=%d\n", attr, policy); + serr("attr=0x%p policy=%d\n", attr, policy); if (!attr || (policy != SCHED_FIFO @@ -90,6 +90,6 @@ int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy) ret = OK; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrsetstacksize.c b/libc/pthread/pthread_attrsetstacksize.c index 97769acd25..41bec38f19 100644 --- a/libc/pthread/pthread_attrsetstacksize.c +++ b/libc/pthread/pthread_attrsetstacksize.c @@ -68,7 +68,7 @@ int pthread_attr_setstacksize(FAR pthread_attr_t *attr, long stacksize) { int ret; - sdbg("attr=0x%p stacksize=%ld\n", attr, stacksize); + serr("attr=0x%p stacksize=%ld\n", attr, stacksize); if (!attr || stacksize < PTHREAD_STACK_MIN) { @@ -80,7 +80,7 @@ int pthread_attr_setstacksize(FAR pthread_attr_t *attr, long stacksize) ret = OK; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_condattrdestroy.c b/libc/pthread/pthread_condattrdestroy.c index 5e25a7d421..92af75db74 100644 --- a/libc/pthread/pthread_condattrdestroy.c +++ b/libc/pthread/pthread_condattrdestroy.c @@ -67,14 +67,14 @@ int pthread_condattr_destroy(FAR pthread_condattr_t *attr) { int ret = OK; - sdbg("attr=0x%p\n", attr); + serr("attr=0x%p\n", attr); if (!attr) { ret = EINVAL; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_condattrinit.c b/libc/pthread/pthread_condattrinit.c index 220d972e10..ac6889dc01 100644 --- a/libc/pthread/pthread_condattrinit.c +++ b/libc/pthread/pthread_condattrinit.c @@ -67,7 +67,7 @@ int pthread_condattr_init(FAR pthread_condattr_t *attr) { int ret = OK; - sdbg("attr=0x%p\n", attr); + serr("attr=0x%p\n", attr); if (!attr) { @@ -78,7 +78,7 @@ int pthread_condattr_init(FAR pthread_condattr_t *attr) *attr = 0; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_mutexattrdestroy.c b/libc/pthread/pthread_mutexattrdestroy.c index 60b50718c1..3b0aaba28a 100644 --- a/libc/pthread/pthread_mutexattrdestroy.c +++ b/libc/pthread/pthread_mutexattrdestroy.c @@ -68,7 +68,7 @@ int pthread_mutexattr_destroy(FAR pthread_mutexattr_t *attr) { int ret = OK; - sdbg("attr=0x%p\n", attr); + serr("attr=0x%p\n", attr); if (!attr) { @@ -79,6 +79,6 @@ int pthread_mutexattr_destroy(FAR pthread_mutexattr_t *attr) attr->pshared = 0; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_mutexattrgetpshared.c b/libc/pthread/pthread_mutexattrgetpshared.c index 586a1b203e..a7f8ce6d8f 100644 --- a/libc/pthread/pthread_mutexattrgetpshared.c +++ b/libc/pthread/pthread_mutexattrgetpshared.c @@ -68,7 +68,7 @@ int pthread_mutexattr_getpshared(FAR const pthread_mutexattr_t *attr, FAR int *p { int ret = OK; - sdbg("attr=0x%p pshared=0x%p\n", attr, pshared); + serr("attr=0x%p pshared=0x%p\n", attr, pshared); if (!attr || !pshared) { @@ -79,6 +79,6 @@ int pthread_mutexattr_getpshared(FAR const pthread_mutexattr_t *attr, FAR int *p *pshared = attr->pshared; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_mutexattrinit.c b/libc/pthread/pthread_mutexattrinit.c index b12b8a2994..620736e2c6 100644 --- a/libc/pthread/pthread_mutexattrinit.c +++ b/libc/pthread/pthread_mutexattrinit.c @@ -67,7 +67,7 @@ int pthread_mutexattr_init(FAR pthread_mutexattr_t *attr) { int ret = OK; - sdbg("attr=0x%p\n", attr); + serr("attr=0x%p\n", attr); if (!attr) { @@ -81,6 +81,6 @@ int pthread_mutexattr_init(FAR pthread_mutexattr_t *attr) #endif } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_mutexattrsetpshared.c b/libc/pthread/pthread_mutexattrsetpshared.c index 82f20092bd..ebcc3c7e3c 100644 --- a/libc/pthread/pthread_mutexattrsetpshared.c +++ b/libc/pthread/pthread_mutexattrsetpshared.c @@ -68,7 +68,7 @@ int pthread_mutexattr_setpshared(FAR pthread_mutexattr_t *attr, int pshared) { int ret = OK; - sdbg("attr=0x%p pshared=%d\n", attr, pshared); + serr("attr=0x%p pshared=%d\n", attr, pshared); if (!attr || (pshared != 0 && pshared != 1)) { @@ -79,6 +79,6 @@ int pthread_mutexattr_setpshared(FAR pthread_mutexattr_t *attr, int pshared) attr->pshared = pshared; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/libc/spawn/lib_psa_dump.c b/libc/spawn/lib_psa_dump.c index 0afd087dee..f7af91e35b 100644 --- a/libc/spawn/lib_psa_dump.c +++ b/libc/spawn/lib_psa_dump.c @@ -64,63 +64,63 @@ void posix_spawnattr_dump(posix_spawnattr_t *attr) { - dbg("attr[%p]:\n", attr); - dbg(" flags: %04x\n", attr->flags); + err("attr[%p]:\n", attr); + err(" flags: %04x\n", attr->flags); if (attr->flags == 0) { - dbg(" None\n"); + err(" None\n"); } else { if ((attr->flags & POSIX_SPAWN_RESETIDS) != 0) { - dbg(" POSIX_SPAWN_RESETIDS\n"); + err(" POSIX_SPAWN_RESETIDS\n"); } if ((attr->flags & POSIX_SPAWN_SETPGROUP) != 0) { - dbg(" POSIX_SPAWN_SETPGROUP\n"); + err(" POSIX_SPAWN_SETPGROUP\n"); } if ((attr->flags & POSIX_SPAWN_SETSCHEDPARAM) != 0) { - dbg(" POSIX_SPAWN_SETSCHEDPARAM\n"); + err(" POSIX_SPAWN_SETSCHEDPARAM\n"); } if ((attr->flags & POSIX_SPAWN_SETSCHEDULER) != 0) { - dbg(" POSIX_SPAWN_SETSCHEDULER\n"); + err(" POSIX_SPAWN_SETSCHEDULER\n"); } if ((attr->flags & POSIX_SPAWN_SETSIGDEF) != 0) { - dbg(" POSIX_SPAWN_SETSIGDEF\n"); + err(" POSIX_SPAWN_SETSIGDEF\n"); } if ((attr->flags & POSIX_SPAWN_SETSIGMASK) != 0) { - dbg(" POSIX_SPAWN_SETSIGMASK\n"); + err(" POSIX_SPAWN_SETSIGMASK\n"); } } - dbg(" priority: %d\n", attr->priority); + err(" priority: %d\n", attr->priority); - dbg(" policy: %d\n", attr->policy); + err(" policy: %d\n", attr->policy); if (attr->policy == SCHED_FIFO) { - dbg(" SCHED_FIFO\n"); + err(" SCHED_FIFO\n"); } else if (attr->policy == SCHED_RR) { - dbg(" SCHED_RR\n"); + err(" SCHED_RR\n"); } else { - dbg(" Unrecognized\n"); + err(" Unrecognized\n"); } #ifndef CONFIG_DISABLE_SIGNALS - dbg(" sigmask: %08x\n", attr->sigmask); + err(" sigmask: %08x\n", attr->sigmask); #endif } diff --git a/libc/spawn/lib_psfa_dump.c b/libc/spawn/lib_psfa_dump.c index fe6fd0c276..a335fe6b4c 100644 --- a/libc/spawn/lib_psfa_dump.c +++ b/libc/spawn/lib_psfa_dump.c @@ -75,10 +75,10 @@ void posix_spawn_file_actions_dump(FAR posix_spawn_file_actions_t *file_actions) DEBUGASSERT(file_actions); - dbg("File Actions[%p->%p]:\n", file_actions, *file_actions); + err("File Actions[%p->%p]:\n", file_actions, *file_actions); if (!*file_actions) { - dbg(" NONE\n"); + err(" NONE\n"); return; } @@ -95,7 +95,7 @@ void posix_spawn_file_actions_dump(FAR posix_spawn_file_actions_t *file_actions) FAR struct spawn_close_file_action_s *action = (FAR struct spawn_close_file_action_s *)entry; - dbg(" CLOSE: fd=%d\n", action->fd); + err(" CLOSE: fd=%d\n", action->fd); } break; @@ -104,7 +104,7 @@ void posix_spawn_file_actions_dump(FAR posix_spawn_file_actions_t *file_actions) FAR struct spawn_dup2_file_action_s *action = (FAR struct spawn_dup2_file_action_s *)entry; - dbg(" DUP2: %d->%d\n", action->fd1, action->fd2); + err(" DUP2: %d->%d\n", action->fd1, action->fd2); } break; @@ -113,14 +113,14 @@ void posix_spawn_file_actions_dump(FAR posix_spawn_file_actions_t *file_actions) FAR struct spawn_open_file_action_s *action = (FAR struct spawn_open_file_action_s *)entry; - dbg(" OPEN: path=%s oflags=%04x mode=%04x fd=%d\n", + err(" OPEN: path=%s oflags=%04x mode=%04x fd=%d\n", action->path, action->oflags, action->mode, action->fd); } break; case SPAWN_FILE_ACTION_NONE: default: - dbg(" ERROR: Unknown action: %d\n", entry->action); + err(" ERROR: Unknown action: %d\n", entry->action); break; } } diff --git a/libc/stdio/lib_dtoa.c b/libc/stdio/lib_dtoa.c index e3452126d8..480165ed06 100644 --- a/libc/stdio/lib_dtoa.c +++ b/libc/stdio/lib_dtoa.c @@ -559,12 +559,12 @@ static int cmp(Bigint * a, Bigint * b) #ifdef CONFIG_DEBUG_LIB if (i > 1 && !a->x[i - 1]) { - ldbg("cmp called with a->x[a->wds-1] == 0\n"); + lerr("cmp called with a->x[a->wds-1] == 0\n"); } if (j > 1 && !b->x[j - 1]) { - ldbg("cmp called with b->x[b->wds-1] == 0\n"); + lerr("cmp called with b->x[b->wds-1] == 0\n"); } #endif @@ -722,7 +722,7 @@ static Bigint *d2b(double d, int *e, int *bits) #ifdef CONFIG_DEBUG_LIB if (!z) { - ldbg("Zero passed to d2b\n"); + lerr("Zero passed to d2b\n"); } #endif k = lo0bits(&z); @@ -763,7 +763,7 @@ static Bigint *d2b(double d, int *e, int *bits) #ifdef CONFIG_DEBUG_LIB if (!z) { - ldbg("Zero passed to d2b\n"); + lerr("Zero passed to d2b\n"); } #endif k = lo0bits(&z); @@ -851,7 +851,7 @@ static int quorem(Bigint * b, Bigint * S) #ifdef CONFIG_DEBUG_LIB if (b->wds > n) { - ldbg("oversize b in quorem\n"); + lerr("oversize b in quorem\n"); } #endif if (b->wds < n) @@ -867,7 +867,7 @@ static int quorem(Bigint * b, Bigint * S) #ifdef CONFIG_DEBUG_LIB if (q > 9) { - ldbg("oversized quotient in quorem\n"); + lerr("oversized quotient in quorem\n"); } #endif diff --git a/libc/time/lib_gmtimer.c b/libc/time/lib_gmtimer.c index d6b224cfcc..a3439e3c03 100644 --- a/libc/time/lib_gmtimer.c +++ b/libc/time/lib_gmtimer.c @@ -317,7 +317,7 @@ FAR struct tm *gmtime_r(FAR const time_t *timer, FAR struct tm *result) /* Get the seconds since the EPOCH */ epoch = *timer; - sdbg("timer=%d\n", (int)epoch); + serr("timer=%d\n", (int)epoch); /* Convert to days, hours, minutes, and seconds since the EPOCH */ @@ -332,14 +332,14 @@ FAR struct tm *gmtime_r(FAR const time_t *timer, FAR struct tm *result) sec = epoch; - sdbg("hour=%d min=%d sec=%d\n", + serr("hour=%d min=%d sec=%d\n", (int)hour, (int)min, (int)sec); /* Convert the days since the EPOCH to calendar day */ clock_utc2calendar(jdn, &year, &month, &day); - sdbg("jdn=%d year=%d month=%d day=%d\n", + serr("jdn=%d year=%d month=%d day=%d\n", (int)jdn, (int)year, (int)month, (int)day); /* Then return the struct tm contents */ diff --git a/libc/time/lib_mktime.c b/libc/time/lib_mktime.c index 5798ce5309..327e86f4c7 100644 --- a/libc/time/lib_mktime.c +++ b/libc/time/lib_mktime.c @@ -94,13 +94,13 @@ time_t mktime(FAR struct tm *tp) */ jdn = clock_calendar2utc(tp->tm_year + 1900, tp->tm_mon, tp->tm_mday); - sdbg("jdn=%d tm_year=%d tm_mon=%d tm_mday=%d\n", + serr("jdn=%d tm_year=%d tm_mon=%d tm_mday=%d\n", (int)jdn, tp->tm_year, tp->tm_mon, tp->tm_mday); /* Return the seconds into the julian day. */ ret = ((jdn * 24 + tp->tm_hour) * 60 + tp->tm_min) * 60 + tp->tm_sec; - sdbg("ret=%d tm_hour=%d tm_min=%d tm_sec=%d\n", + serr("ret=%d tm_hour=%d tm_min=%d tm_sec=%d\n", (int)ret, tp->tm_hour, tp->tm_min, tp->tm_sec); return ret; diff --git a/libnx/nxfonts/nxfonts_getfont.c b/libnx/nxfonts/nxfonts_getfont.c index c52c082281..86cdc98bfb 100644 --- a/libnx/nxfonts/nxfonts_getfont.c +++ b/libnx/nxfonts/nxfonts_getfont.c @@ -475,7 +475,7 @@ static inline FAR const struct nx_fontset_s * fontset = &package->font8; #else - gdbg("8-bit font support disabled: %d\n", ch); + gerr("8-bit font support disabled: %d\n", ch); return NULL; #endif } @@ -483,7 +483,7 @@ static inline FAR const struct nx_fontset_s * { /* Someday, perhaps 16-bit fonts will go here */ - gdbg("16-bit font not currently supported\n"); + gerr("16-bit font not currently supported\n"); return NULL; } @@ -494,7 +494,7 @@ static inline FAR const struct nx_fontset_s * return fontset; } - gdbg("No bitmap for code %02x\n", ch); + gerr("No bitmap for code %02x\n", ch); return NULL; } diff --git a/libnx/nxmu/nx_bitmap.c b/libnx/nxmu/nx_bitmap.c index 8526e92f29..d59e237ef6 100644 --- a/libnx/nxmu/nx_bitmap.c +++ b/libnx/nxmu/nx_bitmap.c @@ -133,7 +133,7 @@ int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest, if (ret != OK) { - gdbg("sem_init failed: %d\n", errno); + gerr("sem_init failed: %d\n", errno); return ret; } diff --git a/libnx/nxmu/nx_connect.c b/libnx/nxmu/nx_connect.c index 540bf698f7..b5a5ab83ed 100644 --- a/libnx/nxmu/nx_connect.c +++ b/libnx/nxmu/nx_connect.c @@ -160,7 +160,7 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname) #endif if (conn->crdmq == (mqd_t)-1) { - gdbg("mq_open(%s) failed: %d\n", climqname, errno); + gerr("mq_open(%s) failed: %d\n", climqname, errno); goto errout_with_conn; } @@ -173,7 +173,7 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname) conn->cwrmq = mq_open(svrmqname, O_WRONLY|O_CREAT, 0666, &attr); if (conn->cwrmq == (mqd_t)-1) { - gdbg("mq_open(%s) failed: %d\n", svrmqname, errno); + gerr("mq_open(%s) failed: %d\n", svrmqname, errno); goto errout_with_rmq; } @@ -185,7 +185,7 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname) ret = nxmu_sendserver(conn, &outmsg, sizeof(struct nxsvrmsg_s)); if (ret < 0) { - gdbg("nxmu_sendserver failed: %d\n", errno); + gerr("nxmu_sendserver failed: %d\n", errno); goto errout_with_wmq; } @@ -201,7 +201,7 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname) ret = nx_eventhandler((NXHANDLE)conn); if (ret < 0) { - gdbg("nx_message failed: %d\n", errno); + gerr("nx_message failed: %d\n", errno); goto errout_with_wmq; } usleep(300000); diff --git a/libnx/nxmu/nx_disconnect.c b/libnx/nxmu/nx_disconnect.c index 323e414af7..50571f38ac 100644 --- a/libnx/nxmu/nx_disconnect.c +++ b/libnx/nxmu/nx_disconnect.c @@ -102,6 +102,6 @@ void nx_disconnect(NXHANDLE handle) ret = nxmu_sendserver(conn, &outmsg, sizeof(struct nxsvrmsg_s)); if (ret < 0) { - gdbg("ERROR: nxmu_sendserver() returned %d\n", ret); + gerr("ERROR: nxmu_sendserver() returned %d\n", ret); } } diff --git a/libnx/nxmu/nx_eventhandler.c b/libnx/nxmu/nx_eventhandler.c index d67860b2fa..da32903e25 100644 --- a/libnx/nxmu/nx_eventhandler.c +++ b/libnx/nxmu/nx_eventhandler.c @@ -164,7 +164,7 @@ int nx_eventhandler(NXHANDLE handle) } else { - gdbg("mq_receive failed: %d\n", errno); + gerr("mq_receive failed: %d\n", errno); return ERROR; } } @@ -254,7 +254,7 @@ int nx_eventhandler(NXHANDLE handle) break; default: - gdbg("Unrecognized message opcode: %d\n", ((FAR struct nxsvrmsg_s *)buffer)->msgid); + gerr("Unrecognized message opcode: %d\n", ((FAR struct nxsvrmsg_s *)buffer)->msgid); break; } diff --git a/libnx/nxmu/nx_getrectangle.c b/libnx/nxmu/nx_getrectangle.c index 737831e9a4..9fd53d9fcf 100644 --- a/libnx/nxmu/nx_getrectangle.c +++ b/libnx/nxmu/nx_getrectangle.c @@ -127,7 +127,7 @@ int nx_getrectangle(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect, if (ret != OK) { - gdbg("sem_init failed: %d\n", errno); + gerr("sem_init failed: %d\n", errno); return ret; } diff --git a/libnx/nxmu/nx_redrawreq.c b/libnx/nxmu/nx_redrawreq.c index ed0e639096..cc771119f9 100644 --- a/libnx/nxmu/nx_redrawreq.c +++ b/libnx/nxmu/nx_redrawreq.c @@ -106,6 +106,6 @@ void nx_redrawreq(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect) ret = nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_redrawreq_s)); if (ret < 0) { - gdbg("ERROR: nxmu_sendwindow failed: %d\n", errno); + gerr("ERROR: nxmu_sendwindow failed: %d\n", errno); } } diff --git a/libnx/nxmu/nxmu_sendserver.c b/libnx/nxmu/nxmu_sendserver.c index 0b93809a66..6400cf07bb 100644 --- a/libnx/nxmu/nxmu_sendserver.c +++ b/libnx/nxmu/nxmu_sendserver.c @@ -105,7 +105,7 @@ int nxmu_sendserver(FAR struct nxfe_conn_s *conn, FAR const void *msg, ret = mq_send(conn->cwrmq, msg, msglen, NX_SVRMSG_PRIO); if (ret < 0) { - gdbg("mq_send failed: %d\n", errno); + gerr("mq_send failed: %d\n", errno); } return ret; diff --git a/libxx/libxx_new.cxx b/libxx/libxx_new.cxx index 290933883c..953da41fd0 100644 --- a/libxx/libxx_new.cxx +++ b/libxx/libxx_new.cxx @@ -93,7 +93,7 @@ void *operator new(unsigned int nbytes) // Oh my.. we are required to return a valid pointer and // we cannot throw an exception! We are bad. - dbg("Failed to allocate\n"); + err("Failed to allocate\n"); } #endif diff --git a/libxx/libxx_newa.cxx b/libxx/libxx_newa.cxx index 7b909dad42..cc8d9a1869 100644 --- a/libxx/libxx_newa.cxx +++ b/libxx/libxx_newa.cxx @@ -93,7 +93,7 @@ void *operator new[](unsigned int nbytes) // Oh my.. we are required to return a valid pointer and // we cannot throw an exception! We are bad. - dbg("Failed to allocate\n"); + err("Failed to allocate\n"); } #endif diff --git a/libxx/libxx_stdthrow.cxx b/libxx/libxx_stdthrow.cxx index 79f20093a4..12eae86485 100644 --- a/libxx/libxx_stdthrow.cxx +++ b/libxx/libxx_stdthrow.cxx @@ -56,25 +56,25 @@ namespace std { void __throw_out_of_range(const char*) { - dbg("C++: Vector .at() with argument out of range\n"); + err("C++: Vector .at() with argument out of range\n"); abort(); } void __throw_length_error(const char*) { - dbg("C++: Vector resize to excessive length\n"); + err("C++: Vector resize to excessive length\n"); abort(); } void __throw_bad_alloc() { - dbg("C++: Bad allocation\n"); + err("C++: Bad allocation\n"); abort(); } void __throw_bad_function_call() { - dbg("C++: Bad function call\n"); + err("C++: Bad function call\n"); abort(); } } diff --git a/mm/mm_gran/mm_gran.h b/mm/mm_gran/mm_gran.h index 2d1e8a4159..4685788611 100644 --- a/mm/mm_gran/mm_gran.h +++ b/mm/mm_gran/mm_gran.h @@ -63,18 +63,18 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG_GRAM -# define grandbg(format, ...) dbg(format, ##__VA_ARGS__) +# define granerr(format, ...) err(format, ##__VA_ARGS__) # define graninfo(format, ...) info(format, ##__VA_ARGS__) # else -# define grandbg(format, ...) mdbg(format, ##__VA_ARGS__) +# define granerr(format, ...) merr(format, ##__VA_ARGS__) # define graninfo(format, ...) minfo(format, ##__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG_GRAM -# define grandbg dbg +# define granerr err # define graninfo info # else -# define grandbg (void) +# define granerr (void) # define graninfo (void) # endif #endif diff --git a/mm/mm_gran/mm_pgalloc.c b/mm/mm_gran/mm_pgalloc.c index 72d0531199..64e1a0ede8 100644 --- a/mm/mm_gran/mm_pgalloc.c +++ b/mm/mm_gran/mm_pgalloc.c @@ -66,18 +66,18 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG_PGALLOC -# define pgadbg(format, ...) dbg(format, ##__VA_ARGS__) +# define pgaerr(format, ...) err(format, ##__VA_ARGS__) # define pgainfo(format, ...) info(format, ##__VA_ARGS__) # else -# define pgadbg(format, ...) mdbg(format, ##__VA_ARGS__) +# define pgaerr(format, ...) merr(format, ##__VA_ARGS__) # define pgainfo(format, ...) minfo(format, ##__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG_PGALLOC -# define pgadbg dbg +# define pgaerr err # define pgainfo info # else -# define pgadbg (void) +# define pgaerr (void) # define pgainfo (void) # endif #endif diff --git a/mm/mm_heap/mm_malloc.c b/mm/mm_heap/mm_malloc.c index 2594ebcda2..84457eef77 100644 --- a/mm/mm_heap/mm_malloc.c +++ b/mm/mm_heap/mm_malloc.c @@ -186,7 +186,7 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size) #ifdef CONFIG_DEBUG_MM if (!ret) { - mdbg("Allocation failed, size %d\n", size); + merr("Allocation failed, size %d\n", size); } else { diff --git a/mm/mm_heap/mm_sem.c b/mm/mm_heap/mm_sem.c index 0cbe1b4e61..d0b6775854 100644 --- a/mm/mm_heap/mm_sem.c +++ b/mm/mm_heap/mm_sem.c @@ -53,17 +53,17 @@ //#define MONITOR_MM_SEMAPHORE 1 #ifdef MONITOR_MM_SEMAPHORE -# ifdef CONFIG_DEBUG_FEATURES +# ifdef CONFIG_DEBUG_ERRORS # include -# define msemdbg dbg +# define msemerr err # else -# define msemdbg printf +# define msemerr printf # endif #else # ifdef CONFIG_CPP_HAVE_VARARGS -# define msemdbg(x...) +# define msemerr(x...) # else -# define msemdbg (void) +# define msemerr (void) # endif #endif @@ -157,7 +157,7 @@ void mm_takesemaphore(FAR struct mm_heap_s *heap) { /* Take the semaphore (perhaps waiting) */ - msemdbg("PID=%d taking\n", my_pid); + msemerr("PID=%d taking\n", my_pid); while (sem_wait(&heap->mm_semaphore) != 0) { /* The only case that an error should occur here is if @@ -173,7 +173,7 @@ void mm_takesemaphore(FAR struct mm_heap_s *heap) heap->mm_counts_held = 1; } - msemdbg("Holder=%d count=%d\n", heap->mm_holder, heap->mm_counts_held); + msemerr("Holder=%d count=%d\n", heap->mm_holder, heap->mm_counts_held); } /**************************************************************************** @@ -186,7 +186,7 @@ void mm_takesemaphore(FAR struct mm_heap_s *heap) void mm_givesemaphore(FAR struct mm_heap_s *heap) { -#ifdef CONFIG_DEBUG_FEATURES +#if defined(CONFIG_DEBUG_ASSERTIONS) || defined(CONFIG_DEBUG_ERRORS) pid_t my_pid = getpid(); #endif @@ -201,15 +201,13 @@ void mm_givesemaphore(FAR struct mm_heap_s *heap) /* Yes, just release one count and return */ heap->mm_counts_held--; - msemdbg("Holder=%d count=%d\n", heap->mm_holder, heap->mm_counts_held); + msemerr("Holder=%d count=%d\n", heap->mm_holder, heap->mm_counts_held); } else { /* Nope, this is the last reference I have */ -#ifdef CONFIG_DEBUG_FEATURES - msemdbg("PID=%d giving\n", my_pid); -#endif + msemerr("PID=%d giving\n", my_pid); heap->mm_holder = -1; heap->mm_counts_held = 0; diff --git a/mm/shm/shm_initialize.c b/mm/shm/shm_initialize.c index a25bc8fd19..38c82f2b93 100644 --- a/mm/shm/shm_initialize.c +++ b/mm/shm/shm_initialize.c @@ -127,7 +127,7 @@ int shm_group_initialize(FAR struct task_group_s *group) if (!group->tg_shm.gs_handle) { - shmdbg("gran_initialize() failed\n"); + shmerr("gran_initialize() failed\n"); return -ENOMEM; } diff --git a/mm/shm/shmat.c b/mm/shm/shmat.c index b3658a38fa..bec7c5e87a 100644 --- a/mm/shm/shmat.c +++ b/mm/shm/shmat.c @@ -136,7 +136,7 @@ FAR void *shmat(int shmid, FAR const void *shmaddr, int shmflg) ret = sem_wait(®ion->sr_sem); if (ret < 0) { - shmdbg("sem_wait failed: %d\n", ret); + shmerr("sem_wait failed: %d\n", ret); goto errout; } @@ -146,7 +146,7 @@ FAR void *shmat(int shmid, FAR const void *shmaddr, int shmflg) region->sr_ds.shm_segsz); if (vaddr == 0) { - shmdbg("gran_alloc() failed\n"); + shmerr("gran_alloc() failed\n"); ret = -ENOMEM; goto errout_with_semaphore; } @@ -160,7 +160,7 @@ FAR void *shmat(int shmid, FAR const void *shmaddr, int shmflg) ret = up_shmat(region->sr_pages, npages, vaddr); if (ret < 0) { - shmdbg("up_shmat() failed\n"); + shmerr("up_shmat() failed\n"); goto errout_with_vaddr; } diff --git a/mm/shm/shmctl.c b/mm/shm/shmctl.c index 6ba3a33f1a..e5eea7abcc 100644 --- a/mm/shm/shmctl.c +++ b/mm/shm/shmctl.c @@ -134,7 +134,7 @@ int shmctl(int shmid, int cmd, struct shmid_ds *buf) ret = sem_wait(®ion->sr_sem); if (ret < 0) { - shmdbg("sem_wait failed: %d\n", ret); + shmerr("sem_wait failed: %d\n", ret); return ret; } @@ -190,7 +190,7 @@ int shmctl(int shmid, int cmd, struct shmid_ds *buf) break; default: - shmdbg("Unrecognized command: %d\n", cmd); + shmerr("Unrecognized command: %d\n", cmd); ret = -EINVAL; goto errout_with_semaphore; } diff --git a/mm/shm/shmdt.c b/mm/shm/shmdt.c index 201e944b65..2014674ed2 100644 --- a/mm/shm/shmdt.c +++ b/mm/shm/shmdt.c @@ -106,7 +106,7 @@ int shmdt(FAR const void *shmaddr) if (shmid >= CONFIG_ARCH_SHM_MAXREGIONS) { - shmdbg("No region matching this virtual address: %p\n", shmaddr); + shmerr("No region matching this virtual address: %p\n", shmaddr); ret = -EINVAL; goto errout_with_errno; } @@ -121,7 +121,7 @@ int shmdt(FAR const void *shmaddr) ret = sem_wait(®ion->sr_sem); if (ret < 0) { - shmdbg("sem_wait failed: %d\n", ret); + shmerr("sem_wait failed: %d\n", ret); goto errout; } @@ -141,7 +141,7 @@ int shmdt(FAR const void *shmaddr) ret = up_shmdt((uintptr_t)shmaddr, npages); if (ret < 0) { - shmdbg("up_shmdt() failed\n"); + shmerr("up_shmdt() failed\n"); } /* Indicate that there is no longer any mapping for this region. */ diff --git a/mm/shm/shmget.c b/mm/shm/shmget.c index e3f0208460..10d5e3ed2b 100644 --- a/mm/shm/shmget.c +++ b/mm/shm/shmget.c @@ -188,7 +188,7 @@ static int shm_extend(int shmid, size_t size) region->sr_pages[pgalloc] = mm_pgalloc(1); if (region->sr_pages[pgalloc] == 0) { - shmdbg("mm_pgalloc(1) failed\n"); + shmerr("mm_pgalloc(1) failed\n"); break; } @@ -249,7 +249,7 @@ static int shm_create(key_t key, size_t size, int shmflg) ret = shm_reserve(key, shmflg); if (ret < 0) { - shmdbg("shm_reserve failed: %d\n", ret); + shmerr("shm_reserve failed: %d\n", ret); return ret; } @@ -400,7 +400,7 @@ int shmget(key_t key, size_t size, int shmflg) ret = shm_create(key, size, shmflg); if (ret < 0) { - shmdbg("shm_create failed: %d\n", ret); + shmerr("shm_create failed: %d\n", ret); goto errout_with_semaphore; } @@ -443,7 +443,7 @@ int shmget(key_t key, size_t size, int shmflg) ret = shm_extend(shmid, size); if (ret < 0) { - shmdbg("shm_create failed: %d\n", ret); + shmerr("shm_create failed: %d\n", ret); goto errout_with_semaphore; } } diff --git a/net/arp/arp_send.c b/net/arp/arp_send.c index 1807ed1ee0..7fd6e78f09 100644 --- a/net/arp/arp_send.c +++ b/net/arp/arp_send.c @@ -230,7 +230,7 @@ int arp_send(in_addr_t ipaddr) #endif if (!dev) { - ndbg("ERROR: Unreachable: %08lx\n", (unsigned long)ipaddr); + nerr("ERROR: Unreachable: %08lx\n", (unsigned long)ipaddr); ret = -EHOSTUNREACH; goto errout; } @@ -285,7 +285,7 @@ int arp_send(in_addr_t ipaddr) state.snd_cb = arp_callback_alloc(dev); if (!state.snd_cb) { - ndbg("ERROR: Failed to allocate a callback\n"); + nerr("ERROR: Failed to allocate a callback\n"); ret = -ENOMEM; goto errout_with_lock; } @@ -368,7 +368,7 @@ int arp_send(in_addr_t ipaddr) { /* Break out on a send failure */ - ndbg("ERROR: Send failed: %d\n", ret); + nerr("ERROR: Send failed: %d\n", ret); break; } @@ -396,7 +396,7 @@ int arp_send(in_addr_t ipaddr) /* Increment the retry count */ state.snd_retries++; - ndbg("ERROR: arp_wait failed: %d\n", ret); + nerr("ERROR: arp_wait failed: %d\n", ret); } sem_destroy(&state.snd_sem); diff --git a/net/icmp/icmp_ping.c b/net/icmp/icmp_ping.c index b674ce440d..075e6aae0d 100644 --- a/net/icmp/icmp_ping.c +++ b/net/icmp/icmp_ping.c @@ -347,7 +347,7 @@ int icmp_ping(in_addr_t addr, uint16_t id, uint16_t seqno, uint16_t datalen, #endif if (dev == 0) { - ndbg("ERROR: Not reachable\n"); + nerr("ERROR: Not reachable\n"); return -ENETUNREACH; } @@ -357,7 +357,7 @@ int icmp_ping(in_addr_t addr, uint16_t id, uint16_t seqno, uint16_t datalen, ret = arp_send(addr); if (ret < 0) { - ndbg("ERROR: Not reachable\n"); + nerr("ERROR: Not reachable\n"); return -ENETUNREACH; } #endif diff --git a/net/icmpv6/icmpv6_autoconfig.c b/net/icmpv6/icmpv6_autoconfig.c index 3465931658..26650bbae4 100644 --- a/net/icmpv6/icmpv6_autoconfig.c +++ b/net/icmpv6/icmpv6_autoconfig.c @@ -225,7 +225,7 @@ static int icmpv6_send_message(FAR struct net_driver_s *dev, bool advertise) state.snd_cb = icmpv6_callback_alloc(dev); if (!state.snd_cb) { - ndbg("ERROR: Failed to allocate a cllback\n"); + nerr("ERROR: Failed to allocate a cllback\n"); ret = -ENOMEM; goto errout_with_semaphore; } @@ -341,7 +341,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) #ifndef CONFIG_NET_ETHERNET /* Only Ethernet supported for now */ - ndbg("ERROR: Only Ethernet is supported\n"); + nerr("ERROR: Only Ethernet is supported\n"); return -ENOSYS; #else /* CONFIG_NET_ETHERNET */ @@ -361,7 +361,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) if (dev->d_lltype != NET_LL_ETHERNET) { - ndbg("ERROR: Only Ethernet is supported\n"); + nerr("ERROR: Only Ethernet is supported\n"); return -ENOSYS; } #endif @@ -439,7 +439,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) * have not back-up plan in place. Just bail. */ - ndbg("ERROR: IP conflict\n"); + nerr("ERROR: IP conflict\n"); return -EEXIST; } #endif @@ -477,7 +477,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) ret = icmpv6_send_message(dev, false); if (ret < 0) { - ndbg("ERROR: Failed send router solicitation: %d\n", ret); + nerr("ERROR: Failed send router solicitation: %d\n", ret); break; } @@ -502,7 +502,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) if (ret < 0) { - ndbg("ERROR: Failed to get the router advertisement: %d (retries=%d)\n", + nerr("ERROR: Failed to get the router advertisement: %d (retries=%d)\n", ret, retries); /* Claim the link local address as ours by sending the ICMPv6 Neighbor @@ -512,7 +512,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) ret = icmpv6_send_message(dev, true); if (ret < 0) { - ndbg("ERROR: Failed send neighbor advertisement: %d\n", ret); + nerr("ERROR: Failed send neighbor advertisement: %d\n", ret); netdev_ifdown(dev); } diff --git a/net/icmpv6/icmpv6_neighbor.c b/net/icmpv6/icmpv6_neighbor.c index 95723eb858..0f0dd9076a 100644 --- a/net/icmpv6/icmpv6_neighbor.c +++ b/net/icmpv6/icmpv6_neighbor.c @@ -232,7 +232,7 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr) #endif if (!dev) { - ndbg("ERROR: Unreachable: %08lx\n", (unsigned long)ipaddr); + nerr("ERROR: Unreachable: %08lx\n", (unsigned long)ipaddr); ret = -EHOSTUNREACH; goto errout; } @@ -298,7 +298,7 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr) state.snd_cb = icmpv6_callback_alloc(dev); if (!state.snd_cb) { - ndbg("ERROR: Failed to allocate a cllback\n"); + nerr("ERROR: Failed to allocate a cllback\n"); ret = -ENOMEM; goto errout_with_lock; } diff --git a/net/icmpv6/icmpv6_ping.c b/net/icmpv6/icmpv6_ping.c index 9a959a0177..da5b1701b9 100644 --- a/net/icmpv6/icmpv6_ping.c +++ b/net/icmpv6/icmpv6_ping.c @@ -417,7 +417,7 @@ int icmpv6_ping(net_ipv6addr_t addr, uint16_t id, uint16_t seqno, ret = icmpv6_neighbor(addr); if (ret < 0) { - ndbg("ERROR: Not reachable\n"); + nerr("ERROR: Not reachable\n"); return -ENETUNREACH; } #endif /* CONFIG_NET_ICMPv6_NEIGHBOR */ @@ -431,7 +431,7 @@ int icmpv6_ping(net_ipv6addr_t addr, uint16_t id, uint16_t seqno, #endif if (dev == 0) { - ndbg("ERROR: Not reachable\n"); + nerr("ERROR: Not reachable\n"); return -ENETUNREACH; } diff --git a/net/igmp/igmp_group.c b/net/igmp/igmp_group.c index 9a1af28807..b8e673ccea 100644 --- a/net/igmp/igmp_group.c +++ b/net/igmp/igmp_group.c @@ -88,24 +88,24 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef IGMP_GRPDEBUG -# define grpdbg(format, ...) ndbg(format, ##__VA_ARGS__) +# define grperr(format, ...) nerr(format, ##__VA_ARGS__) # define grpllerr(format, ...) nllerr(format, ##__VA_ARGS__) # define grpinfo(format, ...) ninfo(format, ##__VA_ARGS__) # define grpllinfo(format, ...) nllinfo(format, ##__VA_ARGS__) # else -# define grpdbg(x...) +# define grperr(x...) # define grpllerr(x...) # define grpinfo(x...) # define grpllinfo(x...) # endif #else # ifdef IGMP_GRPDEBUG -# define grpdbg ndbg +# define grperr nerr # define grpllerr nllerr # define grpinfo ninfo # define grpllinfo nllinfo # else -# define grpdbg (void) +# define grperr (void) # define grpllerr (void) # define grpinfo (void) # define grpllinfo (void) diff --git a/net/igmp/igmp_leave.c b/net/igmp/igmp_leave.c index 5e0019b3a2..eb970ae127 100644 --- a/net/igmp/igmp_leave.c +++ b/net/igmp/igmp_leave.c @@ -134,7 +134,7 @@ int igmp_leavegroup(struct net_driver_s *dev, FAR const struct in_addr *grpaddr) /* Find the entry corresponding to the address leaving the group */ group = igmp_grpfind(dev, &grpaddr->s_addr); - ndbg("Leaving group: %p\n", group); + nerr("Leaving group: %p\n", group); if (group) { /* Cancel the timer and discard any queued Membership Reports. Canceling @@ -155,7 +155,7 @@ int igmp_leavegroup(struct net_driver_s *dev, FAR const struct in_addr *grpaddr) if (IS_LASTREPORT(group->flags)) { - ndbg("Schedule Leave Group message\n"); + nerr("Schedule Leave Group message\n"); IGMP_STATINCR(g_netstats.igmp.leave_sched); igmp_waitmsg(group, IGMP_LEAVE_GROUP); } diff --git a/net/igmp/igmp_timer.c b/net/igmp/igmp_timer.c index 78dd618601..bd26598991 100644 --- a/net/igmp/igmp_timer.c +++ b/net/igmp/igmp_timer.c @@ -73,24 +73,24 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef IGMP_GTMRDEBUG -# define gtmrdbg(format, ...) ndbg(format, ##__VA_ARGS__) +# define gtmrerr(format, ...) nerr(format, ##__VA_ARGS__) # define gtmrllerr(format, ...) nllerr(format, ##__VA_ARGS__) # define gtmrinfo(format, ...) ninfo(format, ##__VA_ARGS__) # define gtmrllinfo(format, ...) nllinfo(format, ##__VA_ARGS__) # else -# define gtmrdbg(x...) +# define gtmrerr(x...) # define gtmrllerr(x...) # define gtmrinfo(x...) # define gtmrllinfo(x...) # endif #else # ifdef IGMP_GTMRDEBUG -# define gtmrdbg ndbg +# define gtmrerr nerr # define gtmrllerr nllerr # define gtmrinfo ninfo # define gtmrllinfo nllinfo # else -# define gtmrdbg (void) +# define gtmrerr (void) # define gtmrllerr (void) # define gtmrinfo (void) # define gtmrllinfo (void) @@ -184,7 +184,7 @@ void igmp_starttimer(FAR struct igmp_group_s *group, uint8_t decisecs) * Important!! this should be a random timer from 0 to decisecs */ - gtmrdbg("decisecs: %d\n", decisecs); + gtmrerr("decisecs: %d\n", decisecs); igmp_startticks(group, net_dsec2tick(decisecs)); } @@ -224,7 +224,7 @@ bool igmp_cmptimer(FAR struct igmp_group_s *group, int maxticks) * test as well. */ - gtmrdbg("maxticks: %d remaining: %d\n", maxticks, remaining); + gtmrerr("maxticks: %d remaining: %d\n", maxticks, remaining); if (maxticks > remaining) { /* Cancel the watchdog timer and return true */ diff --git a/net/iob/iob_add_queue.c b/net/iob/iob_add_queue.c index c6df88ef0a..16c615d0e8 100644 --- a/net/iob/iob_add_queue.c +++ b/net/iob/iob_add_queue.c @@ -125,7 +125,7 @@ int iob_add_queue(FAR struct iob_s *iob, FAR struct iob_queue_s *iobq) qentry = iob_alloc_qentry(); if (!qentry) { - ndbg("ERROR: Failed to allocate a container\n"); + nerr("ERROR: Failed to allocate a container\n"); return -ENOMEM; } diff --git a/net/iob/iob_clone.c b/net/iob/iob_clone.c index 73ccd81893..a0a5bd5c50 100644 --- a/net/iob/iob_clone.c +++ b/net/iob/iob_clone.c @@ -168,7 +168,7 @@ int iob_clone(FAR struct iob_s *iob1, FAR struct iob_s *iob2, bool throttled) next = iob_alloc(throttled); if (!next) { - ndbg("Failed to allocate an I/O buffer/n"); + nerr("Failed to allocate an I/O buffer/n"); return -ENOMEM; } diff --git a/net/iob/iob_contig.c b/net/iob/iob_contig.c index 8817d7de61..c7b948f25e 100644 --- a/net/iob/iob_contig.c +++ b/net/iob/iob_contig.c @@ -161,7 +161,7 @@ int iob_contig(FAR struct iob_s *iob, unsigned int len) else { - ndbg("ERROR: pktlen=%u < requested len=%u\n", iob->io_pktlen, len); + nerr("ERROR: pktlen=%u < requested len=%u\n", iob->io_pktlen, len); return -ENOSPC; } } diff --git a/net/iob/iob_copyin.c b/net/iob/iob_copyin.c index 4c2205cd7e..53c9379e3b 100644 --- a/net/iob/iob_copyin.c +++ b/net/iob/iob_copyin.c @@ -104,7 +104,7 @@ static int iob_copyin_internal(FAR struct iob_s *iob, FAR const uint8_t *src, if (offset > iob->io_pktlen) { - ndbg("ERROR: offset is past the end of data: %u > %u\n", + nerr("ERROR: offset is past the end of data: %u > %u\n", offset, iob->io_pktlen); return -ESPIPE; } @@ -220,7 +220,7 @@ static int iob_copyin_internal(FAR struct iob_s *iob, FAR const uint8_t *src, if (next == NULL) { - ndbg("ERROR: Failed to allocate I/O buffer\n"); + nerr("ERROR: Failed to allocate I/O buffer\n"); return len; } diff --git a/net/iob/iob_dump.c b/net/iob/iob_dump.c index 78fd87a72c..d8dab7b684 100644 --- a/net/iob/iob_dump.c +++ b/net/iob/iob_dump.c @@ -83,7 +83,7 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len, if (offset > head->io_pktlen) { - ndbg("ERROR: offset is past the end of data: %u > %u\n", + nerr("ERROR: offset is past the end of data: %u > %u\n", offset, head->io_pktlen); return; } diff --git a/net/local/local_accept.c b/net/local/local_accept.c index d26fc74813..e148e3e60f 100644 --- a/net/local/local_accept.c +++ b/net/local/local_accept.c @@ -156,7 +156,7 @@ int psock_local_accept(FAR struct socket *psock, FAR struct sockaddr *addr, conn = local_alloc(); if (!conn) { - ndbg("ERROR: Failed to allocate new connection structure\n"); + nerr("ERROR: Failed to allocate new connection structure\n"); ret = -ENOMEM; } else @@ -180,7 +180,7 @@ int psock_local_accept(FAR struct socket *psock, FAR struct sockaddr *addr, _SS_ISNONBLOCK(psock->s_flags)); if (ret < 0) { - ndbg("ERROR: Failed to open write-only FIFOs for %s: %d\n", + nerr("ERROR: Failed to open write-only FIFOs for %s: %d\n", conn->lc_path, ret); } } @@ -200,7 +200,7 @@ int psock_local_accept(FAR struct socket *psock, FAR struct sockaddr *addr, _SS_ISNONBLOCK(psock->s_flags)); if (ret < 0) { - ndbg("ERROR: Failed to open read-only FIFOs for %s: %d\n", + nerr("ERROR: Failed to open read-only FIFOs for %s: %d\n", conn->lc_path, ret); } } diff --git a/net/local/local_connect.c b/net/local/local_connect.c index 1eab722083..b336b370b3 100644 --- a/net/local/local_connect.c +++ b/net/local/local_connect.c @@ -136,9 +136,9 @@ int inline local_stream_connect(FAR struct local_conn_s *client, server->u.server.lc_pending >= server->u.server.lc_backlog) { net_unlock(state); - ndbg("ERROR: Server is not listening: lc_state=%d\n", + nerr("ERROR: Server is not listening: lc_state=%d\n", server->lc_state); - ndbg(" OR: The backlog limit was reached: %d or %d\n", + nerr(" OR: The backlog limit was reached: %d or %d\n", server->u.server.lc_pending, server->u.server.lc_backlog); return -ECONNREFUSED; } @@ -153,7 +153,7 @@ int inline local_stream_connect(FAR struct local_conn_s *client, ret = local_create_fifos(client); if (ret < 0) { - ndbg("ERROR: Failed to create FIFOs for %s: %d\n", + nerr("ERROR: Failed to create FIFOs for %s: %d\n", client->lc_path, ret); net_unlock(state); @@ -167,7 +167,7 @@ int inline local_stream_connect(FAR struct local_conn_s *client, ret = local_open_client_tx(client, nonblock); if (ret < 0) { - ndbg("ERROR: Failed to open write-only FIFOs for %s: %d\n", + nerr("ERROR: Failed to open write-only FIFOs for %s: %d\n", client->lc_path, ret); net_unlock(state); @@ -198,7 +198,7 @@ int inline local_stream_connect(FAR struct local_conn_s *client, if (ret < 0) { - ndbg("ERROR: Failed to connect: %d\n", ret); + nerr("ERROR: Failed to connect: %d\n", ret); goto errout_with_outfd; } @@ -207,7 +207,7 @@ int inline local_stream_connect(FAR struct local_conn_s *client, ret = local_open_client_rx(client, nonblock); if (ret < 0) { - ndbg("ERROR: Failed to open write-only FIFOs for %s: %d\n", + nerr("ERROR: Failed to open write-only FIFOs for %s: %d\n", client->lc_path, ret); goto errout_with_outfd; } diff --git a/net/local/local_fifo.c b/net/local/local_fifo.c index 569aa92a01..ff53d40024 100644 --- a/net/local/local_fifo.c +++ b/net/local/local_fifo.c @@ -189,7 +189,7 @@ static int local_create_fifo(FAR const char *path) int errcode = get_errno(); DEBUGASSERT(errcode > 0); - ndbg("ERROR: Failed to create FIFO %s: %d\n", path, errcode); + nerr("ERROR: Failed to create FIFO %s: %d\n", path, errcode); return -errcode; } } @@ -230,7 +230,7 @@ static int local_release_fifo(FAR const char *path) int errcode = get_errno(); DEBUGASSERT(errcode > 0); - ndbg("ERROR: Failed to unlink FIFO %s: %d\n", path, errcode); + nerr("ERROR: Failed to unlink FIFO %s: %d\n", path, errcode); return -errcode; } } @@ -260,7 +260,7 @@ static int local_rx_open(FAR struct local_conn_s *conn, FAR const char *path, int errcode = get_errno(); DEBUGASSERT(errcode > 0); - ndbg("ERROR: Failed on open %s for reading: %d\n", + nerr("ERROR: Failed on open %s for reading: %d\n", path, errcode); /* Map the errcode to something consistent with the return @@ -296,7 +296,7 @@ static int local_tx_open(FAR struct local_conn_s *conn, FAR const char *path, int errcode = get_errno(); DEBUGASSERT(errcode > 0); - ndbg("ERROR: Failed on open %s for writing: %d\n", + nerr("ERROR: Failed on open %s for writing: %d\n", path, errcode); /* Map the errcode to something consistent with the return @@ -336,7 +336,7 @@ static int local_set_policy(int fd, unsigned long policy) int errcode = get_errno(); DEBUGASSERT(errcode > 0); - ndbg("ERROR: Failed to set FIFO buffer policty: %d\n", errcode); + nerr("ERROR: Failed to set FIFO buffer policty: %d\n", errcode); return -errcode; } diff --git a/net/local/local_netpoll.c b/net/local/local_netpoll.c index 01ebe0884a..03ef0bc6d6 100644 --- a/net/local/local_netpoll.c +++ b/net/local/local_netpoll.c @@ -152,7 +152,7 @@ void local_accept_pollnotify(FAR struct local_conn_s *conn, fds->revents |= (fds->events & eventset); if (fds->revents != 0) { - ndbg("Report events: %02x\n", fds->revents); + nerr("Report events: %02x\n", fds->revents); sem_post(fds->sem); } } diff --git a/net/local/local_recvfrom.c b/net/local/local_recvfrom.c index bf5dc45c16..8585468f61 100644 --- a/net/local/local_recvfrom.c +++ b/net/local/local_recvfrom.c @@ -88,7 +88,7 @@ static int psock_fifo_read(FAR struct socket *psock, FAR void *buf, if (ret == -ECONNRESET) { - ndbg("ERROR: Lost connection: %d\n", ret); + nerr("ERROR: Lost connection: %d\n", ret); /* Report an ungraceful loss of connection. This should * eventually be reported as ENOTCONN. @@ -111,7 +111,7 @@ static int psock_fifo_read(FAR struct socket *psock, FAR void *buf, } else { - ndbg("ERROR: Failed to read packet: %d\n", ret); + nerr("ERROR: Failed to read packet: %d\n", ret); return ret; } } @@ -155,7 +155,7 @@ psock_stream_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, if (conn->lc_state != LOCAL_STATE_CONNECTED) { - ndbg("ERROR: not connected\n"); + nerr("ERROR: not connected\n"); return -ENOTCONN; } @@ -174,12 +174,12 @@ psock_stream_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, ret = local_sync(conn->lc_infd); if (ret < 0) { - ndbg("ERROR: Failed to get packet length: %d\n", ret); + nerr("ERROR: Failed to get packet length: %d\n", ret); return ret; } else if (ret > UINT16_MAX) { - ndbg("ERROR: Packet is too big: %d\n", ret); + nerr("ERROR: Packet is too big: %d\n", ret); return -E2BIG; } @@ -259,7 +259,7 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, { /* Either not bound to address or it is connected */ - ndbg("ERROR: Connected or not bound\n"); + nerr("ERROR: Connected or not bound\n"); return -EISCONN; } @@ -272,7 +272,7 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, ret = local_create_halfduplex(conn, conn->lc_path); if (ret < 0) { - ndbg("ERROR: Failed to create FIFO for %s: %d\n", + nerr("ERROR: Failed to create FIFO for %s: %d\n", conn->lc_path, ret); return ret; } @@ -282,7 +282,7 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, ret = local_open_receiver(conn, _SS_ISNONBLOCK(psock->s_flags)); if (ret < 0) { - ndbg("ERROR: Failed to open FIFO for %s: %d\n", + nerr("ERROR: Failed to open FIFO for %s: %d\n", conn->lc_path, ret); goto errout_with_halfduplex; return ret; @@ -295,12 +295,12 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, ret = local_sync(conn->lc_infd); if (ret < 0) { - ndbg("ERROR: Failed to get packet length: %d\n", ret); + nerr("ERROR: Failed to get packet length: %d\n", ret); goto errout_with_infd; } else if (ret > UINT16_MAX) { - ndbg("ERROR: Packet is too big: %d\n", ret); + nerr("ERROR: Packet is too big: %d\n", ret); goto errout_with_infd; } @@ -439,7 +439,7 @@ ssize_t psock_local_recvfrom(FAR struct socket *psock, FAR void *buf, #endif { DEBUGPANIC(); - ndbg("ERROR: Unrecognized socket type: %s\n", psock->s_type); + nerr("ERROR: Unrecognized socket type: %s\n", psock->s_type); return -EINVAL; } } diff --git a/net/local/local_recvutils.c b/net/local/local_recvutils.c index 95845fe0b7..ea19aa65a6 100644 --- a/net/local/local_recvutils.c +++ b/net/local/local_recvutils.c @@ -93,7 +93,7 @@ int local_fifo_read(int fd, FAR uint8_t *buf, size_t *len) if (errcode != EINTR) { - ndbg("ERROR: Read failed: %d\n", errcode); + nerr("ERROR: Read failed: %d\n", errcode); ret = -errcode; goto errout; } @@ -160,7 +160,7 @@ int local_sync(int fd) ret = local_fifo_read(fd, &sync, &readlen); if (ret < 0) { - ndbg("ERROR: Failed to read sync bytes: %d\n", ret); + nerr("ERROR: Failed to read sync bytes: %d\n", ret); return ret; } } @@ -174,7 +174,7 @@ int local_sync(int fd) ret = local_fifo_read(fd, &sync, &readlen); if (ret < 0) { - ndbg("ERROR: Failed to read sync bytes: %d\n", ret); + nerr("ERROR: Failed to read sync bytes: %d\n", ret); return ret; } } diff --git a/net/local/local_send.c b/net/local/local_send.c index 272120138d..c8f1cd92a0 100644 --- a/net/local/local_send.c +++ b/net/local/local_send.c @@ -88,7 +88,7 @@ ssize_t psock_local_send(FAR struct socket *psock, FAR const void *buf, if (peer->lc_state != LOCAL_STATE_CONNECTED || peer->lc_outfd < 0) { - ndbg("ERROR: not connected\n"); + nerr("ERROR: not connected\n"); return -ENOTCONN; } diff --git a/net/local/local_sendpacket.c b/net/local/local_sendpacket.c index 0f6942802b..fce8b4fe68 100644 --- a/net/local/local_sendpacket.c +++ b/net/local/local_sendpacket.c @@ -100,7 +100,7 @@ static int local_fifo_write(int fd, FAR const uint8_t *buf, size_t len) if (errcode != EINTR) { - ndbg("ERROR: Write failed: %d\n", errcode); + nerr("ERROR: Write failed: %d\n", errcode); return -errcode; } diff --git a/net/local/local_sendto.c b/net/local/local_sendto.c index 8142110c08..1351c67a28 100644 --- a/net/local/local_sendto.c +++ b/net/local/local_sendto.c @@ -106,7 +106,7 @@ ssize_t psock_local_sendto(FAR struct socket *psock, FAR const void *buf, { /* Either not bound to address or it is connected */ - ndbg("ERROR: Connected state\n"); + nerr("ERROR: Connected state\n"); return -EISCONN; } @@ -130,7 +130,7 @@ ssize_t psock_local_sendto(FAR struct socket *psock, FAR const void *buf, ret = local_create_halfduplex(conn, unaddr->sun_path); if (ret < 0) { - ndbg("ERROR: Failed to create FIFO for %s: %d\n", + nerr("ERROR: Failed to create FIFO for %s: %d\n", conn->lc_path, ret); return ret; } @@ -141,7 +141,7 @@ ssize_t psock_local_sendto(FAR struct socket *psock, FAR const void *buf, _SS_ISNONBLOCK(psock->s_flags)); if (ret < 0) { - ndbg("ERROR: Failed to open FIFO for %s: %d\n", + nerr("ERROR: Failed to open FIFO for %s: %d\n", unaddr->sun_path, ret); nsent = ret; @@ -153,7 +153,7 @@ ssize_t psock_local_sendto(FAR struct socket *psock, FAR const void *buf, nsent = local_send_packet(conn->lc_outfd, buf, len); if (nsent < 0) { - ndbg("ERROR: Failed to send the packet: %d\n", ret); + nerr("ERROR: Failed to send the packet: %d\n", ret); } else { diff --git a/net/procfs/net_procfs.c b/net/procfs/net_procfs.c index 3beb1a72ee..80e30a9a0d 100644 --- a/net/procfs/net_procfs.c +++ b/net/procfs/net_procfs.c @@ -137,7 +137,7 @@ static int netprocfs_open(FAR struct file *filep, FAR const char *relpath, if (((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) && (net_procfsoperations.write == NULL)) { - fdbg("ERROR: Only O_RDONLY supported\n"); + ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; } @@ -167,7 +167,7 @@ static int netprocfs_open(FAR struct file *filep, FAR const char *relpath, copy = strdup(relpath); if (copy == NULL) { - fdbg("ERROR: strdup failed\n"); + ferr("ERROR: strdup failed\n"); return -ENOMEM; } @@ -177,7 +177,7 @@ static int netprocfs_open(FAR struct file *filep, FAR const char *relpath, if (dev == NULL) { - fdbg("ERROR: relpath is '%s'\n", relpath); + ferr("ERROR: relpath is '%s'\n", relpath); return -ENOENT; } } @@ -187,7 +187,7 @@ static int netprocfs_open(FAR struct file *filep, FAR const char *relpath, priv = (FAR struct netprocfs_file_s *)kmm_zalloc(sizeof(struct netprocfs_file_s)); if (!priv) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -294,7 +294,7 @@ static int netprocfs_dup(FAR const struct file *oldp, FAR struct file *newp) newpriv = (FAR struct netprocfs_file_s *)kmm_zalloc(sizeof(struct netprocfs_file_s)); if (!newpriv) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -334,7 +334,7 @@ static int netprocfs_opendir(FAR const char *relpath, * should return -ENOENT. */ - fdbg("ERROR: Bad relpath: %s\n", relpath); + ferr("ERROR: Bad relpath: %s\n", relpath); return -ENOTDIR; } @@ -347,7 +347,7 @@ static int netprocfs_opendir(FAR const char *relpath, if (!level1) { - fdbg("ERROR: Failed to allocate the level1 directory structure\n"); + ferr("ERROR: Failed to allocate the level1 directory structure\n"); return -ENOMEM; } @@ -518,7 +518,7 @@ static int netprocfs_stat(FAR const char *relpath, FAR struct stat *buf) copy = strdup(relpath); if (copy == NULL) { - fdbg("ERROR: strdup failed\n"); + ferr("ERROR: strdup failed\n"); return -ENOMEM; } @@ -528,7 +528,7 @@ static int netprocfs_stat(FAR const char *relpath, FAR struct stat *buf) if (dev == NULL) { - fdbg("ERROR: relpath is '%s'\n", relpath); + ferr("ERROR: relpath is '%s'\n", relpath); return -ENOENT; } diff --git a/net/route/net_addroute.c b/net/route/net_addroute.c index bf9ea3f3df..3451a1691e 100644 --- a/net/route/net_addroute.c +++ b/net/route/net_addroute.c @@ -81,7 +81,7 @@ int net_addroute(in_addr_t target, in_addr_t netmask, in_addr_t router) route = net_allocroute(); if (!route) { - ndbg("ERROR: Failed to allocate a route\n"); + nerr("ERROR: Failed to allocate a route\n"); return -ENOMEM; } @@ -114,7 +114,7 @@ int net_addroute_ipv6(net_ipv6addr_t target, net_ipv6addr_t netmask, net_ipv6add route = net_allocroute_ipv6(); if (!route) { - ndbg("ERROR: Failed to allocate a route\n"); + nerr("ERROR: Failed to allocate a route\n"); return -ENOMEM; } diff --git a/net/socket/bind.c b/net/socket/bind.c index 4580b4943b..1197460ce7 100644 --- a/net/socket/bind.c +++ b/net/socket/bind.c @@ -196,14 +196,14 @@ int psock_bind(FAR struct socket *psock, const struct sockaddr *addr, #endif default: - ndbg("ERROR: Unrecognized address family: %d\n", addr->sa_family); + nerr("ERROR: Unrecognized address family: %d\n", addr->sa_family); errcode = EAFNOSUPPORT; goto errout; } if (addrlen < minlen) { - ndbg("ERROR: Invalid address length: %d < %d\n", addrlen, minlen); + nerr("ERROR: Invalid address length: %d < %d\n", addrlen, minlen); errcode = EBADF; goto errout; } diff --git a/net/socket/net_clone.c b/net/socket/net_clone.c index 5d46f45ead..c819b6ebe4 100644 --- a/net/socket/net_clone.c +++ b/net/socket/net_clone.c @@ -116,7 +116,7 @@ int net_clone(FAR struct socket *psock1, FAR struct socket *psock2) else #endif { - ndbg("Unsupported type: %d\n", psock2->s_type); + nerr("Unsupported type: %d\n", psock2->s_type); ret = -EBADF; } diff --git a/net/socket/net_sendfile.c b/net/socket/net_sendfile.c index b310943ea1..b380258c2b 100644 --- a/net/socket/net_sendfile.c +++ b/net/socket/net_sendfile.c @@ -610,7 +610,7 @@ ssize_t net_sendfile(int outfd, struct file *infile, off_t *offset, if (!psock || psock->s_crefs <= 0) { - ndbg("ERROR: Invalid socket\n"); + nerr("ERROR: Invalid socket\n"); errcode = EBADF; goto errout; } @@ -619,7 +619,7 @@ ssize_t net_sendfile(int outfd, struct file *infile, off_t *offset, if (psock->s_type != SOCK_STREAM || !_SS_ISCONNECTED(psock->s_flags)) { - ndbg("ERROR: Not connected\n"); + nerr("ERROR: Not connected\n"); errcode = ENOTCONN; goto errout; } @@ -657,7 +657,7 @@ ssize_t net_sendfile(int outfd, struct file *infile, off_t *offset, if (ret < 0) { - ndbg("ERROR: Not reachable\n"); + nerr("ERROR: Not reachable\n"); errcode = ENETUNREACH; goto errout; } diff --git a/net/socket/net_vfcntl.c b/net/socket/net_vfcntl.c index a1cb386e76..977db7833a 100644 --- a/net/socket/net_vfcntl.c +++ b/net/socket/net_vfcntl.c @@ -216,7 +216,7 @@ int net_vfcntl(int sockfd, int cmd, va_list ap) #endif #endif /* CONFIG_NET_LOCAL || CONFIG_NET_TCP_READAHEAD || CONFIG_NET_UDP_READAHEAD */ { - ndbg("ERROR: Non-blocking not supported for this socket\n"); + nerr("ERROR: Non-blocking not supported for this socket\n"); } } break; diff --git a/net/socket/recvfrom.c b/net/socket/recvfrom.c index 470296475c..7ee8c8820f 100644 --- a/net/socket/recvfrom.c +++ b/net/socket/recvfrom.c @@ -293,11 +293,11 @@ static inline void recvfrom_newtcpdata(FAR struct net_driver_s *dev, #ifdef CONFIG_DEBUG_NET if (nsaved < buflen) { - ndbg("ERROR: packet data not saved (%d bytes)\n", buflen - nsaved); + nerr("ERROR: packet data not saved (%d bytes)\n", buflen - nsaved); } #endif #else - ndbg("ERROR: packet data lost (%d bytes)\n", dev->d_len - recvlen); + nerr("ERROR: packet data lost (%d bytes)\n", dev->d_len - recvlen); #endif } @@ -1988,7 +1988,7 @@ ssize_t psock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, default: { - ndbg("ERROR: Unsupported socket type: %d\n", psock->s_type); + nerr("ERROR: Unsupported socket type: %d\n", psock->s_type); ret = -ENOSYS; } break; diff --git a/net/socket/sendto.c b/net/socket/sendto.c index 31a33f4142..79eb93e68f 100644 --- a/net/socket/sendto.c +++ b/net/socket/sendto.c @@ -139,7 +139,7 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf, #if defined(CONFIG_NET_TCP) || defined(CONFIG_NET_LOCAL_STREAM) return psock_send(psock, buf, len, flags); #else - ndbg("ERROR: No 'to' address\n"); + nerr("ERROR: No 'to' address\n"); errcode = EINVAL; goto errout; #endif @@ -168,14 +168,14 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf, #endif default: - ndbg("ERROR: Unrecognized address family: %d\n", to->sa_family); + nerr("ERROR: Unrecognized address family: %d\n", to->sa_family); errcode = EAFNOSUPPORT; goto errout; } if (tolen < minlen) { - ndbg("ERROR: Invalid address length: %d < %d\n", tolen, minlen); + nerr("ERROR: Invalid address length: %d < %d\n", tolen, minlen); errcode = EBADF; goto errout; } @@ -184,7 +184,7 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf, if (!psock || psock->s_crefs <= 0) { - ndbg("ERROR: Invalid socket\n"); + nerr("ERROR: Invalid socket\n"); errcode = EBADF; goto errout; } @@ -193,7 +193,7 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf, if (psock->s_type != SOCK_DGRAM) { - ndbg("ERROR: Connected socket\n"); + nerr("ERROR: Connected socket\n"); errcode = EISCONN; goto errout; } @@ -225,7 +225,7 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf, if (nsent < 0) { - ndbg("ERROR: UDP or Unix domain sendto() failed: %ld\n", (long)nsent); + nerr("ERROR: UDP or Unix domain sendto() failed: %ld\n", (long)nsent); errcode = -nsent; goto errout; } diff --git a/net/tcp/tcp_conn.c b/net/tcp/tcp_conn.c index 57b477af90..6501a80ecf 100644 --- a/net/tcp/tcp_conn.c +++ b/net/tcp/tcp_conn.c @@ -532,7 +532,7 @@ static inline int tcp_ipv4_bind(FAR struct tcp_conn_s *conn, if (port < 0) { - ndbg("tcp_selectport failed: %d\n", port); + nerr("tcp_selectport failed: %d\n", port); return port; } @@ -552,7 +552,7 @@ static inline int tcp_ipv4_bind(FAR struct tcp_conn_s *conn, { /* If no device is found, then the address is not reachable */ - ndbg("tcp_local_ipv4_device failed: %d\n", ret); + nerr("tcp_local_ipv4_device failed: %d\n", ret); /* Back out the local address setting */ @@ -613,7 +613,7 @@ static inline int tcp_ipv6_bind(FAR struct tcp_conn_s *conn, if (port < 0) { - ndbg("tcp_selectport failed: %d\n", port); + nerr("tcp_selectport failed: %d\n", port); return port; } @@ -633,7 +633,7 @@ static inline int tcp_ipv6_bind(FAR struct tcp_conn_s *conn, { /* If no device is found, then the address is not reachable */ - ndbg("tcp_local_ipv6_device failed: %d\n", ret); + nerr("tcp_local_ipv6_device failed: %d\n", ret); /* Back out the local address setting */ @@ -1066,7 +1066,7 @@ FAR struct tcp_conn_s *tcp_alloc_accept(FAR struct net_driver_s *dev, * probably really just assert here. */ - ndbg("Failed to find network device: %d\n", ret); + nerr("Failed to find network device: %d\n", ret); tcp_free(conn); return NULL; } @@ -1320,7 +1320,7 @@ int tcp_connect(FAR struct tcp_conn_s *conn, FAR const struct sockaddr *addr) * just assert here. */ - ndbg("Failed to find network device: %d\n", ret); + nerr("Failed to find network device: %d\n", ret); goto errout_with_lock; } diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c index 5d1b163b8b..2ae4d36daa 100644 --- a/net/tcp/tcp_send_buffered.c +++ b/net/tcp/tcp_send_buffered.c @@ -941,14 +941,14 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf, if (!psock || psock->s_crefs <= 0) { - ndbg("ERROR: Invalid socket\n"); + nerr("ERROR: Invalid socket\n"); errcode = EBADF; goto errout; } if (psock->s_type != SOCK_STREAM || !_SS_ISCONNECTED(psock->s_flags)) { - ndbg("ERROR: Not connected\n"); + nerr("ERROR: Not connected\n"); errcode = ENOTCONN; goto errout; } @@ -985,7 +985,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf, if (ret < 0) { - ndbg("ERROR: Not reachable\n"); + nerr("ERROR: Not reachable\n"); errcode = ENETUNREACH; goto errout; } @@ -1011,7 +1011,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf, { /* A buffer allocation error occurred */ - ndbg("ERROR: Failed to allocate write buffer\n"); + nerr("ERROR: Failed to allocate write buffer\n"); errcode = ENOMEM; goto errout_with_lock; } @@ -1029,7 +1029,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf, { /* A buffer allocation error occurred */ - ndbg("ERROR: Failed to allocate callback\n"); + nerr("ERROR: Failed to allocate callback\n"); errcode = ENOMEM; goto errout_with_wrb; } @@ -1136,13 +1136,13 @@ int psock_tcp_cansend(FAR struct socket *psock) { if (!psock || psock->s_crefs <= 0) { - ndbg("ERROR: Invalid socket\n"); + nerr("ERROR: Invalid socket\n"); return -EBADF; } if (psock->s_type != SOCK_STREAM || !_SS_ISCONNECTED(psock->s_flags)) { - ndbg("ERROR: Not connected\n"); + nerr("ERROR: Not connected\n"); return -ENOTCONN; } diff --git a/net/tcp/tcp_send_unbuffered.c b/net/tcp/tcp_send_unbuffered.c index ea3c5c42cb..73dbd0691d 100644 --- a/net/tcp/tcp_send_unbuffered.c +++ b/net/tcp/tcp_send_unbuffered.c @@ -726,7 +726,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, if (!psock || psock->s_crefs <= 0) { - ndbg("ERROR: Invalid socket\n"); + nerr("ERROR: Invalid socket\n"); errcode = EBADF; goto errout; } @@ -735,7 +735,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, if (psock->s_type != SOCK_STREAM || !_SS_ISCONNECTED(psock->s_flags)) { - ndbg("ERROR: Not connected\n"); + nerr("ERROR: Not connected\n"); errcode = ENOTCONN; goto errout; } @@ -773,7 +773,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, if (ret < 0) { - ndbg("ERROR: Not reachable\n"); + nerr("ERROR: Not reachable\n"); errcode = ENETUNREACH; goto errout; } diff --git a/net/tcp/tcp_wrbuffer.c b/net/tcp/tcp_wrbuffer.c index 1c4dd824fb..149c83143d 100644 --- a/net/tcp/tcp_wrbuffer.c +++ b/net/tcp/tcp_wrbuffer.c @@ -160,7 +160,7 @@ FAR struct tcp_wrbuffer_s *tcp_wrbuffer_alloc(void) wrb->wb_iob = iob_alloc(false); if (!wrb->wb_iob) { - ndbg("ERROR: Failed to allocate I/O buffer\n"); + nerr("ERROR: Failed to allocate I/O buffer\n"); tcp_wrbuffer_release(wrb); return NULL; } diff --git a/net/udp/udp_psock_sendto.c b/net/udp/udp_psock_sendto.c index 40136453e1..9486851822 100644 --- a/net/udp/udp_psock_sendto.c +++ b/net/udp/udp_psock_sendto.c @@ -375,7 +375,7 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf, if (ret < 0) { - ndbg("ERROR: Peer not reachable\n"); + nerr("ERROR: Peer not reachable\n"); return -ENETUNREACH; } #endif /* CONFIG_NET_ARP_SEND || CONFIG_NET_ICMPv6_NEIGHBOR */ @@ -419,7 +419,7 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf, ret = udp_connect(conn, to); if (ret < 0) { - ndbg("ERROR: udp_connect failed: %d\n", ret); + nerr("ERROR: udp_connect failed: %d\n", ret); goto errout_with_lock; } @@ -430,7 +430,7 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf, dev = udp_find_raddr_device(conn); if (dev == NULL) { - ndbg("ERROR: udp_find_raddr_device failed\n"); + nerr("ERROR: udp_find_raddr_device failed\n"); ret = -ENETUNREACH; goto errout_with_lock; } diff --git a/sched/clock/clock_getres.c b/sched/clock/clock_getres.c index aad5dec9c3..f02ea4f846 100644 --- a/sched/clock/clock_getres.c +++ b/sched/clock/clock_getres.c @@ -62,13 +62,13 @@ int clock_getres(clockid_t clock_id, struct timespec *res) { int ret = OK; - sdbg("clock_id=%d\n", clock_id); + serr("clock_id=%d\n", clock_id); /* Only CLOCK_REALTIME is supported */ if (clock_id != CLOCK_REALTIME) { - sdbg("Returning ERROR\n"); + serr("Returning ERROR\n"); set_errno(EINVAL); ret = ERROR; } @@ -79,7 +79,7 @@ int clock_getres(clockid_t clock_id, struct timespec *res) res->tv_sec = 0; res->tv_nsec = NSEC_PER_TICK; - sdbg("Returning res=(%d,%d)\n", (int)res->tv_sec, (int)res->tv_nsec); + serr("Returning res=(%d,%d)\n", (int)res->tv_sec, (int)res->tv_nsec); } return ret; diff --git a/sched/clock/clock_gettime.c b/sched/clock/clock_gettime.c index 50e3c6e7c1..5e90568607 100644 --- a/sched/clock/clock_gettime.c +++ b/sched/clock/clock_gettime.c @@ -68,7 +68,7 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp) uint32_t carry; int ret = OK; - sdbg("clock_id=%d\n", clock_id); + serr("clock_id=%d\n", clock_id); DEBUGASSERT(tp != NULL); #ifdef CONFIG_CLOCK_MONOTONIC @@ -148,14 +148,14 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp) if (ret < 0) { - sdbg("Returning ERROR\n"); + serr("Returning ERROR\n"); set_errno(-ret); ret = ERROR; } else { - sdbg("Returning tp=(%d,%d)\n", (int)tp->tv_sec, (int)tp->tv_nsec); + serr("Returning tp=(%d,%d)\n", (int)tp->tv_sec, (int)tp->tv_nsec); } return ret; diff --git a/sched/clock/clock_settime.c b/sched/clock/clock_settime.c index 640e375a63..0ca5f8ef52 100644 --- a/sched/clock/clock_settime.c +++ b/sched/clock/clock_settime.c @@ -67,7 +67,7 @@ int clock_settime(clockid_t clock_id, FAR const struct timespec *tp) irqstate_t flags; int ret = OK; - sdbg("clock_id=%d\n", clock_id); + serr("clock_id=%d\n", clock_id); DEBUGASSERT(tp != NULL); /* CLOCK_REALTIME - POSIX demands this to be present. This is the wall @@ -120,13 +120,13 @@ int clock_settime(clockid_t clock_id, FAR const struct timespec *tp) #endif leave_critical_section(flags); - sdbg("basetime=(%ld,%lu) bias=(%ld,%lu)\n", + serr("basetime=(%ld,%lu) bias=(%ld,%lu)\n", (long)g_basetime.tv_sec, (unsigned long)g_basetime.tv_nsec, (long)bias.tv_sec, (unsigned long)bias.tv_nsec); } else { - sdbg("Returning ERROR\n"); + serr("Returning ERROR\n"); set_errno(EINVAL); ret = ERROR; } diff --git a/sched/group/group_addrenv.c b/sched/group/group_addrenv.c index ddc27a4153..596de965a6 100644 --- a/sched/group/group_addrenv.c +++ b/sched/group/group_addrenv.c @@ -163,7 +163,7 @@ int group_addrenv(FAR struct tcb_s *tcb) ret = up_addrenv_select(&group->tg_addrenv, NULL); if (ret < 0) { - bdbg("ERROR: up_addrenv_select failed: %d\n", ret); + berr("ERROR: up_addrenv_select failed: %d\n", ret); } /* Save the new, current group */ diff --git a/sched/group/group_childstatus.c b/sched/group/group_childstatus.c index 065697b482..1b6b5a77a6 100644 --- a/sched/group/group_childstatus.c +++ b/sched/group/group_childstatus.c @@ -115,10 +115,10 @@ static void group_dumpchildren(FAR struct task_group_s *group, FAR struct child_status_s *child; int i; - dbg("Task group=%p: %s\n", group, msg); + err("Task group=%p: %s\n", group, msg); for (i = 0, child = group->tg_children; child; i++, child = child->flink) { - dbg(" %d. ch_flags=%02x ch_pid=%d ch_status=%d\n", + err(" %d. ch_flags=%02x ch_pid=%d ch_status=%d\n", i, child->ch_flags, child->ch_pid, child->ch_status); } } diff --git a/sched/group/group_join.c b/sched/group/group_join.c index bdf2fc546d..5aecedebe7 100644 --- a/sched/group/group_join.c +++ b/sched/group/group_join.c @@ -110,7 +110,7 @@ static inline int group_addmember(FAR struct task_group_s *group, pid_t pid) if (!newmembers) { - sdbg("ERROR: Failed to reallocate tg_members\n"); + serr("ERROR: Failed to reallocate tg_members\n"); return -ENOMEM; } diff --git a/sched/init/os_smpstart.c b/sched/init/os_smpstart.c index da7852317c..e9cd3c11a8 100644 --- a/sched/init/os_smpstart.c +++ b/sched/init/os_smpstart.c @@ -133,7 +133,7 @@ int os_idle_task(int argc, FAR char *argv[]) { /* Enter the IDLE loop */ - sdbg("CPU%d: Beginning Idle Loop\n", this_cpu()); + serr("CPU%d: Beginning Idle Loop\n", this_cpu()); for (; ; ) { @@ -207,7 +207,7 @@ int os_smp_start(void) ret = up_cpu_idlestack(cpu, tcb, CONFIG_SMP_IDLETHREAD_STACKSIZE); if (ret < 0) { - sdbg("ERROR: Failed to allocate stack for CPU%d\n", cpu); + serr("ERROR: Failed to allocate stack for CPU%d\n", cpu); return ret; } @@ -231,7 +231,7 @@ int os_smp_start(void) ret = up_cpu_start(cpu); if (ret < 0) { - sdbg("ERROR: Failed to start CPU%d: %d\n", cpu, ret); + serr("ERROR: Failed to start CPU%d: %d\n", cpu, ret); return ret; } } diff --git a/sched/init/os_start.c b/sched/init/os_start.c index be4a26f265..9fecc43755 100644 --- a/sched/init/os_start.c +++ b/sched/init/os_start.c @@ -797,7 +797,7 @@ void os_start(void) /* The IDLE Loop **********************************************************/ /* When control is return to this point, the system is idle. */ - sdbg("CPU0: Beginning Idle Loop\n"); + serr("CPU0: Beginning Idle Loop\n"); for (; ; ) { /* Perform garbage collection (if it is not being done by the worker diff --git a/sched/module/mod_bind.c b/sched/module/mod_bind.c index 75d8e1b56a..f7fe4f4f4b 100644 --- a/sched/module/mod_bind.c +++ b/sched/module/mod_bind.c @@ -73,7 +73,7 @@ static inline int mod_readrel(FAR struct mod_loadinfo_s *loadinfo, if (index < 0 || index > (relsec->sh_size / sizeof(Elf32_Rel))) { - sdbg("Bad relocation symbol index: %d\n", index); + serr("Bad relocation symbol index: %d\n", index); return -EINVAL; } @@ -125,7 +125,7 @@ static int mod_relocate(FAR struct mod_loadinfo_s *loadinfo, int relidx) ret = mod_readrel(loadinfo, relsec, i, &rel); if (ret < 0) { - sdbg("Section %d reloc %d: Failed to read relocation entry: %d\n", + serr("Section %d reloc %d: Failed to read relocation entry: %d\n", relidx, i, ret); return ret; } @@ -141,7 +141,7 @@ static int mod_relocate(FAR struct mod_loadinfo_s *loadinfo, int relidx) ret = mod_readsym(loadinfo, symidx, &sym); if (ret < 0) { - sdbg("Section %d reloc %d: Failed to read symbol[%d]: %d\n", + serr("Section %d reloc %d: Failed to read symbol[%d]: %d\n", relidx, i, symidx, ret); return ret; } @@ -163,13 +163,13 @@ static int mod_relocate(FAR struct mod_loadinfo_s *loadinfo, int relidx) if (ret == -ESRCH) { - sdbg("Section %d reloc %d: Undefined symbol[%d] has no name: %d\n", + serr("Section %d reloc %d: Undefined symbol[%d] has no name: %d\n", relidx, i, symidx, ret); psym = NULL; } else { - sdbg("Section %d reloc %d: Failed to get value of symbol[%d]: %d\n", + serr("Section %d reloc %d: Failed to get value of symbol[%d]: %d\n", relidx, i, symidx, ret); return ret; } @@ -179,7 +179,7 @@ static int mod_relocate(FAR struct mod_loadinfo_s *loadinfo, int relidx) if (rel.r_offset < 0 || rel.r_offset > dstsec->sh_size - sizeof(uint32_t)) { - sdbg("Section %d reloc %d: Relocation address out of range, offset %d size %d\n", + serr("Section %d reloc %d: Relocation address out of range, offset %d size %d\n", relidx, i, rel.r_offset, dstsec->sh_size); return -EINVAL; } @@ -191,7 +191,7 @@ static int mod_relocate(FAR struct mod_loadinfo_s *loadinfo, int relidx) ret = up_relocate(&rel, psym, addr); if (ret < 0) { - sdbg("ERROR: Section %d reloc %d: Relocation failed: %d\n", relidx, i, ret); + serr("ERROR: Section %d reloc %d: Relocation failed: %d\n", relidx, i, ret); return ret; } } @@ -201,7 +201,7 @@ static int mod_relocate(FAR struct mod_loadinfo_s *loadinfo, int relidx) static int mod_relocateadd(FAR struct mod_loadinfo_s *loadinfo, int relidx) { - sdbg("Not implemented\n"); + serr("Not implemented\n"); return -ENOSYS; } @@ -242,7 +242,7 @@ int mod_bind(FAR struct mod_loadinfo_s *loadinfo) ret = mod_allocbuffer(loadinfo); if (ret < 0) { - sdbg("mod_allocbuffer failed: %d\n", ret); + serr("mod_allocbuffer failed: %d\n", ret); return -ENOMEM; } diff --git a/sched/module/mod_init.c b/sched/module/mod_init.c index 67a63e65dd..3d2f659b6a 100644 --- a/sched/module/mod_init.c +++ b/sched/module/mod_init.c @@ -102,7 +102,7 @@ static inline int mod_filelen(FAR struct mod_loadinfo_s *loadinfo, if (ret < 0) { int errval = errno; - sdbg("Failed to stat file: %d\n", errval); + serr("Failed to stat file: %d\n", errval); return -errval; } @@ -110,7 +110,7 @@ static inline int mod_filelen(FAR struct mod_loadinfo_s *loadinfo, if (!S_ISREG(buf.st_mode)) { - sdbg("Not a regular file. mode: %d\n", buf.st_mode); + serr("Not a regular file. mode: %d\n", buf.st_mode); return -ENOENT; } @@ -157,7 +157,7 @@ int mod_initialize(FAR const char *filename, ret = mod_filelen(loadinfo, filename); if (ret < 0) { - sdbg("mod_filelen failed: %d\n", ret); + serr("mod_filelen failed: %d\n", ret); return ret; } @@ -167,7 +167,7 @@ int mod_initialize(FAR const char *filename, if (loadinfo->filfd < 0) { int errval = errno; - sdbg("Failed to open ELF binary %s: %d\n", filename, errval); + serr("Failed to open ELF binary %s: %d\n", filename, errval); return -errval; } @@ -177,7 +177,7 @@ int mod_initialize(FAR const char *filename, sizeof(Elf32_Ehdr), 0); if (ret < 0) { - sdbg("Failed to read ELF header: %d\n", ret); + serr("Failed to read ELF header: %d\n", ret); return ret; } @@ -196,7 +196,7 @@ int mod_initialize(FAR const char *filename, * is not correctly formed. */ - sdbg("Bad ELF header: %d\n", ret); + serr("Bad ELF header: %d\n", ret); return ret; } diff --git a/sched/module/mod_insmod.c b/sched/module/mod_insmod.c index 9b4add646a..0b5c681da7 100644 --- a/sched/module/mod_insmod.c +++ b/sched/module/mod_insmod.c @@ -89,50 +89,50 @@ static void mod_dumploadinfo(FAR struct mod_loadinfo_s *loadinfo) { int i; - sdbg("LOAD_INFO:\n"); - sdbg(" textalloc: %08lx\n", (long)loadinfo->textalloc); - sdbg(" datastart: %08lx\n", (long)loadinfo->datastart); - sdbg(" textsize: %ld\n", (long)loadinfo->textsize); - sdbg(" datasize: %ld\n", (long)loadinfo->datasize); - sdbg(" filelen: %ld\n", (long)loadinfo->filelen); - sdbg(" filfd: %d\n", loadinfo->filfd); - sdbg(" symtabidx: %d\n", loadinfo->symtabidx); - sdbg(" strtabidx: %d\n", loadinfo->strtabidx); - - sdbg("ELF Header:\n"); - sdbg(" e_ident: %02x %02x %02x %02x\n", + serr("LOAD_INFO:\n"); + serr(" textalloc: %08lx\n", (long)loadinfo->textalloc); + serr(" datastart: %08lx\n", (long)loadinfo->datastart); + serr(" textsize: %ld\n", (long)loadinfo->textsize); + serr(" datasize: %ld\n", (long)loadinfo->datasize); + serr(" filelen: %ld\n", (long)loadinfo->filelen); + serr(" filfd: %d\n", loadinfo->filfd); + serr(" symtabidx: %d\n", loadinfo->symtabidx); + serr(" strtabidx: %d\n", loadinfo->strtabidx); + + serr("ELF Header:\n"); + serr(" e_ident: %02x %02x %02x %02x\n", loadinfo->ehdr.e_ident[0], loadinfo->ehdr.e_ident[1], loadinfo->ehdr.e_ident[2], loadinfo->ehdr.e_ident[3]); - sdbg(" e_type: %04x\n", loadinfo->ehdr.e_type); - sdbg(" e_machine: %04x\n", loadinfo->ehdr.e_machine); - sdbg(" e_version: %08x\n", loadinfo->ehdr.e_version); - sdbg(" e_entry: %08lx\n", (long)loadinfo->ehdr.e_entry); - sdbg(" e_phoff: %d\n", loadinfo->ehdr.e_phoff); - sdbg(" e_shoff: %d\n", loadinfo->ehdr.e_shoff); - sdbg(" e_flags: %08x\n" , loadinfo->ehdr.e_flags); - sdbg(" e_ehsize: %d\n", loadinfo->ehdr.e_ehsize); - sdbg(" e_phentsize: %d\n", loadinfo->ehdr.e_phentsize); - sdbg(" e_phnum: %d\n", loadinfo->ehdr.e_phnum); - sdbg(" e_shentsize: %d\n", loadinfo->ehdr.e_shentsize); - sdbg(" e_shnum: %d\n", loadinfo->ehdr.e_shnum); - sdbg(" e_shstrndx: %d\n", loadinfo->ehdr.e_shstrndx); + serr(" e_type: %04x\n", loadinfo->ehdr.e_type); + serr(" e_machine: %04x\n", loadinfo->ehdr.e_machine); + serr(" e_version: %08x\n", loadinfo->ehdr.e_version); + serr(" e_entry: %08lx\n", (long)loadinfo->ehdr.e_entry); + serr(" e_phoff: %d\n", loadinfo->ehdr.e_phoff); + serr(" e_shoff: %d\n", loadinfo->ehdr.e_shoff); + serr(" e_flags: %08x\n" , loadinfo->ehdr.e_flags); + serr(" e_ehsize: %d\n", loadinfo->ehdr.e_ehsize); + serr(" e_phentsize: %d\n", loadinfo->ehdr.e_phentsize); + serr(" e_phnum: %d\n", loadinfo->ehdr.e_phnum); + serr(" e_shentsize: %d\n", loadinfo->ehdr.e_shentsize); + serr(" e_shnum: %d\n", loadinfo->ehdr.e_shnum); + serr(" e_shstrndx: %d\n", loadinfo->ehdr.e_shstrndx); if (loadinfo->shdr && loadinfo->ehdr.e_shnum > 0) { for (i = 0; i < loadinfo->ehdr.e_shnum; i++) { FAR Elf32_Shdr *shdr = &loadinfo->shdr[i]; - sdbg("Sections %d:\n", i); - sdbg(" sh_name: %08x\n", shdr->sh_name); - sdbg(" sh_type: %08x\n", shdr->sh_type); - sdbg(" sh_flags: %08x\n", shdr->sh_flags); - sdbg(" sh_addr: %08x\n", shdr->sh_addr); - sdbg(" sh_offset: %d\n", shdr->sh_offset); - sdbg(" sh_size: %d\n", shdr->sh_size); - sdbg(" sh_link: %d\n", shdr->sh_link); - sdbg(" sh_info: %d\n", shdr->sh_info); - sdbg(" sh_addralign: %d\n", shdr->sh_addralign); - sdbg(" sh_entsize: %d\n", shdr->sh_entsize); + serr("Sections %d:\n", i); + serr(" sh_name: %08x\n", shdr->sh_name); + serr(" sh_type: %08x\n", shdr->sh_type); + serr(" sh_flags: %08x\n", shdr->sh_flags); + serr(" sh_addr: %08x\n", shdr->sh_addr); + serr(" sh_offset: %d\n", shdr->sh_offset); + serr(" sh_size: %d\n", shdr->sh_size); + serr(" sh_link: %d\n", shdr->sh_link); + serr(" sh_info: %d\n", shdr->sh_info); + serr(" sh_addralign: %d\n", shdr->sh_addralign); + serr(" sh_entsize: %d\n", shdr->sh_entsize); } } } @@ -212,7 +212,7 @@ int insmod(FAR const char *filename, FAR const char *modulename) mod_dumploadinfo(&loadinfo); if (ret != 0) { - sdbg("ERROR: Failed to initialize to load module: %d\n", ret); + serr("ERROR: Failed to initialize to load module: %d\n", ret); goto errout_with_lock; } @@ -221,7 +221,7 @@ int insmod(FAR const char *filename, FAR const char *modulename) modp = (FAR struct module_s *)kmm_zalloc(sizeof(struct module_s)); if (ret != 0) { - sdbg("Failed to initialize for load of ELF program: %d\n", ret); + serr("Failed to initialize for load of ELF program: %d\n", ret); goto errout_with_loadinfo; } @@ -235,7 +235,7 @@ int insmod(FAR const char *filename, FAR const char *modulename) mod_dumploadinfo(&loadinfo); if (ret != 0) { - sdbg("Failed to load ELF program binary: %d\n", ret); + serr("Failed to load ELF program binary: %d\n", ret); goto errout_with_registry_entry; } @@ -244,7 +244,7 @@ int insmod(FAR const char *filename, FAR const char *modulename) ret = mod_bind(&loadinfo); if (ret != 0) { - sdbg("Failed to bind symbols program binary: %d\n", ret); + serr("Failed to bind symbols program binary: %d\n", ret); goto errout_with_load; } @@ -269,7 +269,7 @@ int insmod(FAR const char *filename, FAR const char *modulename) ret = initializer(&modp->uninitializer, &modp->arg); if (ret < 0) { - sdbg("Failed to initialize the module: %d\n", ret); + serr("Failed to initialize the module: %d\n", ret); goto errout_with_load; } diff --git a/sched/module/mod_iobuffer.c b/sched/module/mod_iobuffer.c index 0a8c4bc4ef..82640606e8 100644 --- a/sched/module/mod_iobuffer.c +++ b/sched/module/mod_iobuffer.c @@ -75,7 +75,7 @@ int mod_allocbuffer(FAR struct mod_loadinfo_s *loadinfo) loadinfo->iobuffer = (FAR uint8_t *)kmm_malloc(CONFIG_MODULE_BUFFERSIZE); if (!loadinfo->iobuffer) { - sdbg("Failed to allocate an I/O buffer\n"); + serr("Failed to allocate an I/O buffer\n"); return -ENOMEM; } @@ -111,7 +111,7 @@ int mod_reallocbuffer(FAR struct mod_loadinfo_s *loadinfo, size_t increment) buffer = kmm_realloc((FAR void *)loadinfo->iobuffer, newsize); if (!buffer) { - sdbg("Failed to reallocate the I/O buffer\n"); + serr("Failed to reallocate the I/O buffer\n"); return -ENOMEM; } diff --git a/sched/module/mod_load.c b/sched/module/mod_load.c index de693e575e..2ce413bd6f 100644 --- a/sched/module/mod_load.c +++ b/sched/module/mod_load.c @@ -192,7 +192,7 @@ static inline int mod_loadfile(FAR struct mod_loadinfo_s *loadinfo) ret = mod_read(loadinfo, *pptr, shdr->sh_size, shdr->sh_offset); if (ret < 0) { - sdbg("ERROR: Failed to read section %d: %d\n", i, ret); + serr("ERROR: Failed to read section %d: %d\n", i, ret); return ret; } } @@ -250,7 +250,7 @@ int mod_load(FAR struct mod_loadinfo_s *loadinfo) ret = mod_loadshdrs(loadinfo); if (ret < 0) { - sdbg("ERROR: mod_loadshdrs failed: %d\n", ret); + serr("ERROR: mod_loadshdrs failed: %d\n", ret); goto errout_with_buffers; } @@ -265,7 +265,7 @@ int mod_load(FAR struct mod_loadinfo_s *loadinfo) loadinfo->textalloc = (uintptr_t)kmm_zalloc(loadinfo->textsize + loadinfo->datasize); if (!loadinfo->textalloc) { - sdbg("ERROR: Failed to allocate memory for the module\n"); + serr("ERROR: Failed to allocate memory for the module\n"); ret = -ENOMEM; goto errout_with_buffers; } @@ -277,7 +277,7 @@ int mod_load(FAR struct mod_loadinfo_s *loadinfo) ret = mod_loadfile(loadinfo); if (ret < 0) { - sdbg("ERROR: mod_loadfile failed: %d\n", ret); + serr("ERROR: mod_loadfile failed: %d\n", ret); goto errout_with_buffers; } diff --git a/sched/module/mod_procfs.c b/sched/module/mod_procfs.c index cb0ec00613..50388d0d72 100644 --- a/sched/module/mod_procfs.c +++ b/sched/module/mod_procfs.c @@ -181,7 +181,7 @@ static int modprocfs_open(FAR struct file *filep, FAR const char *relpath, if (((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0)) { - fdbg("ERROR: Only O_RDONLY supported\n"); + ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; } @@ -190,7 +190,7 @@ static int modprocfs_open(FAR struct file *filep, FAR const char *relpath, priv = (FAR struct modprocfs_file_s *)kmm_zalloc(sizeof(struct modprocfs_file_s)); if (!priv) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } @@ -282,7 +282,7 @@ static int modprocfs_dup(FAR const struct file *oldp, FAR struct file *newp) newpriv = (FAR struct modprocfs_file_s *)kmm_zalloc(sizeof(struct modprocfs_file_s)); if (!newpriv) { - fdbg("ERROR: Failed to allocate file attributes\n"); + ferr("ERROR: Failed to allocate file attributes\n"); return -ENOMEM; } diff --git a/sched/module/mod_read.c b/sched/module/mod_read.c index 1440f5f5ea..38c2f8697e 100644 --- a/sched/module/mod_read.c +++ b/sched/module/mod_read.c @@ -126,7 +126,7 @@ int mod_read(FAR struct mod_loadinfo_s *loadinfo, FAR uint8_t *buffer, if (rpos != offset) { int errval = errno; - sdbg("Failed to seek to position %lu: %d\n", + serr("Failed to seek to position %lu: %d\n", (unsigned long)offset, errval); return -errval; } @@ -142,14 +142,14 @@ int mod_read(FAR struct mod_loadinfo_s *loadinfo, FAR uint8_t *buffer, if (errval != EINTR) { - sdbg("Read from offset %lu failed: %d\n", + serr("Read from offset %lu failed: %d\n", (unsigned long)offset, errval); return -errval; } } else if (nbytes == 0) { - sdbg("Unexpected end of file\n"); + serr("Unexpected end of file\n"); return -ENODATA; } else diff --git a/sched/module/mod_registry.c b/sched/module/mod_registry.c index 7df1168b35..93a022e8bd 100644 --- a/sched/module/mod_registry.c +++ b/sched/module/mod_registry.c @@ -153,7 +153,7 @@ int mod_registry_del(FAR struct module_s *modp) if (curr == NULL) { - sdbg("ERROR: Could not find module entry\n"); + serr("ERROR: Could not find module entry\n"); return -ENOENT; } diff --git a/sched/module/mod_rmmod.c b/sched/module/mod_rmmod.c index 76fff1c7aa..59f7d2f15d 100644 --- a/sched/module/mod_rmmod.c +++ b/sched/module/mod_rmmod.c @@ -88,7 +88,7 @@ int rmmod(FAR const char *modulename) modp = mod_registry_find(modulename); if (modp == NULL) { - sdbg("ERROR: Failed to find module %s: %d\n", modulename, ret); + serr("ERROR: Failed to find module %s: %d\n", modulename, ret); ret = -ENOENT; goto errout_with_lock; } @@ -105,7 +105,7 @@ int rmmod(FAR const char *modulename) if (ret < 0) { - sdbg("ERROR: Failed to uninitialize the module: %d\n", ret); + serr("ERROR: Failed to uninitialize the module: %d\n", ret); goto errout_with_lock; } @@ -140,7 +140,7 @@ int rmmod(FAR const char *modulename) ret = mod_registry_del(modp); if (ret < 0) { - sdbg("ERROR: Failed to remove the module from the registry: %d\n", ret); + serr("ERROR: Failed to remove the module from the registry: %d\n", ret); goto errout_with_lock; } diff --git a/sched/module/mod_sections.c b/sched/module/mod_sections.c index dcfaaf9ae6..6eeeb398ff 100644 --- a/sched/module/mod_sections.c +++ b/sched/module/mod_sections.c @@ -85,7 +85,7 @@ static inline int mod_sectname(FAR struct mod_loadinfo_s *loadinfo, shstrndx = loadinfo->ehdr.e_shstrndx; if (shstrndx == SHN_UNDEF) { - sdbg("No section header string table\n"); + serr("No section header string table\n"); return -EINVAL; } @@ -118,7 +118,7 @@ static inline int mod_sectname(FAR struct mod_loadinfo_s *loadinfo, { if (loadinfo->filelen <= offset) { - sdbg("At end of file\n"); + serr("At end of file\n"); return -EINVAL; } @@ -131,7 +131,7 @@ static inline int mod_sectname(FAR struct mod_loadinfo_s *loadinfo, ret = mod_read(loadinfo, buffer, readlen, offset); if (ret < 0) { - sdbg("Failed to read section name\n"); + serr("Failed to read section name\n"); return ret; } @@ -151,7 +151,7 @@ static inline int mod_sectname(FAR struct mod_loadinfo_s *loadinfo, ret = mod_reallocbuffer(loadinfo, CONFIG_MODULE_BUFFERINCR); if (ret < 0) { - sdbg("mod_reallocbuffer failed: %d\n", ret); + serr("mod_reallocbuffer failed: %d\n", ret); return ret; } } @@ -188,7 +188,7 @@ int mod_loadshdrs(FAR struct mod_loadinfo_s *loadinfo) if (loadinfo->ehdr.e_shnum < 1) { - sdbg("No sections(?)\n"); + serr("No sections(?)\n"); return -EINVAL; } @@ -197,7 +197,7 @@ int mod_loadshdrs(FAR struct mod_loadinfo_s *loadinfo) shdrsize = (size_t)loadinfo->ehdr.e_shentsize * (size_t)loadinfo->ehdr.e_shnum; if (loadinfo->ehdr.e_shoff + shdrsize > loadinfo->filelen) { - sdbg("Insufficent space in file for section header table\n"); + serr("Insufficent space in file for section header table\n"); return -ESPIPE; } @@ -206,7 +206,7 @@ int mod_loadshdrs(FAR struct mod_loadinfo_s *loadinfo) loadinfo->shdr = (FAR FAR Elf32_Shdr *)kmm_malloc(shdrsize); if (!loadinfo->shdr) { - sdbg("Failed to allocate the section header table. Size: %ld\n", + serr("Failed to allocate the section header table. Size: %ld\n", (long)shdrsize); return -ENOMEM; } @@ -217,7 +217,7 @@ int mod_loadshdrs(FAR struct mod_loadinfo_s *loadinfo) loadinfo->ehdr.e_shoff); if (ret < 0) { - sdbg("Failed to read section header table: %d\n", ret); + serr("Failed to read section header table: %d\n", ret); } return ret; @@ -256,7 +256,7 @@ int mod_findsection(FAR struct mod_loadinfo_s *loadinfo, ret = mod_sectname(loadinfo, shdr); if (ret < 0) { - sdbg("mod_sectname failed: %d\n", ret); + serr("mod_sectname failed: %d\n", ret); return ret; } diff --git a/sched/module/mod_symbols.c b/sched/module/mod_symbols.c index 632b978866..d0e7c3ddf6 100644 --- a/sched/module/mod_symbols.c +++ b/sched/module/mod_symbols.c @@ -93,7 +93,7 @@ static int mod_symname(FAR struct mod_loadinfo_s *loadinfo, if (sym->st_name == 0) { - sdbg("Symbol has no name\n"); + serr("Symbol has no name\n"); return -ESRCH; } @@ -112,7 +112,7 @@ static int mod_symname(FAR struct mod_loadinfo_s *loadinfo, { if (loadinfo->filelen <= offset) { - sdbg("At end of file\n"); + serr("At end of file\n"); return -EINVAL; } @@ -125,7 +125,7 @@ static int mod_symname(FAR struct mod_loadinfo_s *loadinfo, ret = mod_read(loadinfo, buffer, readlen, offset); if (ret < 0) { - sdbg("mod_read failed: %d\n", ret); + serr("mod_read failed: %d\n", ret); return ret; } @@ -145,7 +145,7 @@ static int mod_symname(FAR struct mod_loadinfo_s *loadinfo, ret = mod_reallocbuffer(loadinfo, CONFIG_MODULE_BUFFERINCR); if (ret < 0) { - sdbg("mod_reallocbuffer failed: %d\n", ret); + serr("mod_reallocbuffer failed: %d\n", ret); return ret; } } @@ -191,7 +191,7 @@ int mod_findsymtab(FAR struct mod_loadinfo_s *loadinfo) if (loadinfo->symtabidx == 0) { - sdbg("No symbols in ELF file\n"); + serr("No symbols in ELF file\n"); return -EINVAL; } @@ -225,7 +225,7 @@ int mod_readsym(FAR struct mod_loadinfo_s *loadinfo, int index, if (index < 0 || index > (symtab->sh_size / sizeof(Elf32_Sym))) { - sdbg("Bad relocation symbol index: %d\n", index); + serr("Bad relocation symbol index: %d\n", index); return -EINVAL; } @@ -273,7 +273,7 @@ int mod_symvalue(FAR struct mod_loadinfo_s *loadinfo, FAR Elf32_Sym *sym) { /* NuttX ELF modules should be compiled with -fno-common. */ - sdbg("SHN_COMMON: Re-compile with -fno-common\n"); + serr("SHN_COMMON: Re-compile with -fno-common\n"); return -ENOSYS; } @@ -298,7 +298,7 @@ int mod_symvalue(FAR struct mod_loadinfo_s *loadinfo, FAR Elf32_Sym *sym) * indicate the nameless symbol. */ - sdbg("SHN_UNDEF: Failed to get symbol name: %d\n", ret); + serr("SHN_UNDEF: Failed to get symbol name: %d\n", ret); return ret; } @@ -315,7 +315,7 @@ int mod_symvalue(FAR struct mod_loadinfo_s *loadinfo, FAR Elf32_Sym *sym) #endif if (!symbol) { - sdbg("SHN_UNDEF: Exported symbol \"%s\" not found\n", loadinfo->iobuffer); + serr("SHN_UNDEF: Exported symbol \"%s\" not found\n", loadinfo->iobuffer); return -ENOENT; } diff --git a/sched/module/mod_verify.c b/sched/module/mod_verify.c index 5469edaed0..401d1283f2 100644 --- a/sched/module/mod_verify.c +++ b/sched/module/mod_verify.c @@ -79,7 +79,7 @@ int mod_verifyheader(FAR const Elf32_Ehdr *ehdr) { if (!ehdr) { - sdbg("NULL ELF header!"); + serr("NULL ELF header!"); return -ENOEXEC; } @@ -96,7 +96,7 @@ int mod_verifyheader(FAR const Elf32_Ehdr *ehdr) if (ehdr->e_type != ET_REL) { - sdbg("Not a relocatable file: e_type=%d\n", ehdr->e_type); + serr("Not a relocatable file: e_type=%d\n", ehdr->e_type); return -EINVAL; } @@ -104,7 +104,7 @@ int mod_verifyheader(FAR const Elf32_Ehdr *ehdr) if (up_checkarch(ehdr)) { - sdbg("Not a supported architecture\n"); + serr("Not a supported architecture\n"); return -ENOEXEC; } diff --git a/sched/pthread/pthread_completejoin.c b/sched/pthread/pthread_completejoin.c index 24343cdb3b..3f39f59e74 100644 --- a/sched/pthread/pthread_completejoin.c +++ b/sched/pthread/pthread_completejoin.c @@ -214,7 +214,7 @@ int pthread_completejoin(pid_t pid, FAR void *exit_value) pjoin = pthread_findjoininfo(group, pid); if (!pjoin) { - sdbg("Could not find join info, pid=%d\n", pid); + serr("Could not find join info, pid=%d\n", pid); (void)pthread_givesemaphore(&group->tg_joinsem); return ERROR; } @@ -271,7 +271,7 @@ int pthread_completejoin(pid_t pid, FAR void *exit_value) void pthread_destroyjoin(FAR struct task_group_s *group, FAR struct join_s *pjoin) { - sdbg("pjoin=0x%p\n", pjoin); + serr("pjoin=0x%p\n", pjoin); /* Remove the join info from the set of joins */ diff --git a/sched/pthread/pthread_condbroadcast.c b/sched/pthread/pthread_condbroadcast.c index a86c3a8a14..623698c459 100644 --- a/sched/pthread/pthread_condbroadcast.c +++ b/sched/pthread/pthread_condbroadcast.c @@ -71,7 +71,7 @@ int pthread_cond_broadcast(FAR pthread_cond_t *cond) int ret = OK; int sval; - sdbg("cond=0x%p\n", cond); + serr("cond=0x%p\n", cond); if (!cond) { @@ -118,7 +118,7 @@ int pthread_cond_broadcast(FAR pthread_cond_t *cond) sched_unlock(); } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_conddestroy.c b/sched/pthread/pthread_conddestroy.c index 2584e8dbae..904cd08b4c 100644 --- a/sched/pthread/pthread_conddestroy.c +++ b/sched/pthread/pthread_conddestroy.c @@ -68,7 +68,7 @@ int pthread_cond_destroy(FAR pthread_cond_t *cond) { int ret = OK; - sdbg("cond=0x%p\n", cond); + serr("cond=0x%p\n", cond); if (!cond) { @@ -82,7 +82,7 @@ int pthread_cond_destroy(FAR pthread_cond_t *cond) ret = EINVAL; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_condinit.c b/sched/pthread/pthread_condinit.c index a73811e078..768ed19399 100644 --- a/sched/pthread/pthread_condinit.c +++ b/sched/pthread/pthread_condinit.c @@ -69,7 +69,7 @@ int pthread_cond_init(FAR pthread_cond_t *cond, FAR const pthread_condattr_t *at { int ret = OK; - sdbg("cond=0x%p attr=0x%p\n", cond, attr); + serr("cond=0x%p attr=0x%p\n", cond, attr); if (!cond) { @@ -85,7 +85,7 @@ int pthread_cond_init(FAR pthread_cond_t *cond, FAR const pthread_condattr_t *at ret = EINVAL; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_condsignal.c b/sched/pthread/pthread_condsignal.c index b84ef5d55c..f9f19973f5 100644 --- a/sched/pthread/pthread_condsignal.c +++ b/sched/pthread/pthread_condsignal.c @@ -70,7 +70,7 @@ int pthread_cond_signal(FAR pthread_cond_t *cond) int ret = OK; int sval; - sdbg("cond=0x%p\n", cond); + serr("cond=0x%p\n", cond); if (!cond) { @@ -101,16 +101,16 @@ int pthread_cond_signal(FAR pthread_cond_t *cond) * operation that will guarantee this to be so. */ - sdbg("sval=%d\n", sval); + serr("sval=%d\n", sval); if (sval < 0) { - sdbg("Signalling...\n"); + serr("Signalling...\n"); ret = pthread_givesemaphore((FAR sem_t *)&cond->sem); } } } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_condtimedwait.c b/sched/pthread/pthread_condtimedwait.c index 0e8443b2fb..2b7606893f 100644 --- a/sched/pthread/pthread_condtimedwait.c +++ b/sched/pthread/pthread_condtimedwait.c @@ -174,7 +174,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, int ret = OK; int status; - sdbg("cond=0x%p mutex=0x%p abstime=0x%p\n", cond, mutex, abstime); + serr("cond=0x%p mutex=0x%p abstime=0x%p\n", cond, mutex, abstime); DEBUGASSERT(rtcb->waitdog == NULL); @@ -212,7 +212,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, } else { - sdbg("Give up mutex...\n"); + serr("Give up mutex...\n"); /* We must disable pre-emption and interrupts here so that * the time stays valid until the wait begins. This adds @@ -292,7 +292,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, if (get_errno() == EINTR) { - sdbg("Timedout!\n"); + serr("Timedout!\n"); ret = ETIMEDOUT; } else @@ -312,7 +312,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, /* Reacquire the mutex (retaining the ret). */ - sdbg("Re-locking...\n"); + serr("Re-locking...\n"); status = pthread_takesemaphore((FAR sem_t *)&mutex->sem); if (!status) { @@ -338,7 +338,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, } } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_condwait.c b/sched/pthread/pthread_condwait.c index d60aece8ef..b388d4d810 100644 --- a/sched/pthread/pthread_condwait.c +++ b/sched/pthread/pthread_condwait.c @@ -71,7 +71,7 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex) { int ret; - sdbg("cond=0x%p mutex=0x%p\n", cond, mutex); + serr("cond=0x%p mutex=0x%p\n", cond, mutex); /* Make sure that non-NULL references were provided. */ @@ -90,7 +90,7 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex) { /* Give up the mutex */ - sdbg("Give up mutex / take cond\n"); + serr("Give up mutex / take cond\n"); sched_lock(); mutex->pid = -1; @@ -103,7 +103,7 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex) /* Reacquire the mutex */ - sdbg("Reacquire mutex...\n"); + serr("Reacquire mutex...\n"); ret |= pthread_takesemaphore((FAR sem_t *)&mutex->sem); if (!ret) { @@ -111,7 +111,7 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex) } } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c index 0869c56ed8..487827fbcb 100644 --- a/sched/pthread/pthread_create.c +++ b/sched/pthread/pthread_create.c @@ -249,7 +249,7 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, ptcb = (FAR struct pthread_tcb_s *)kmm_zalloc(sizeof(struct pthread_tcb_s)); if (!ptcb) { - sdbg("ERROR: Failed to allocate TCB\n"); + serr("ERROR: Failed to allocate TCB\n"); return ENOMEM; } @@ -282,7 +282,7 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, pjoin = (FAR struct join_s *)kmm_zalloc(sizeof(struct join_s)); if (!pjoin) { - sdbg("ERROR: Failed to allocate join\n"); + serr("ERROR: Failed to allocate join\n"); errcode = ENOMEM; goto errout_with_tcb; } diff --git a/sched/pthread/pthread_detach.c b/sched/pthread/pthread_detach.c index 6bc3585b48..3da518fd30 100644 --- a/sched/pthread/pthread_detach.c +++ b/sched/pthread/pthread_detach.c @@ -82,7 +82,7 @@ int pthread_detach(pthread_t thread) FAR struct join_s *pjoin; int ret; - sdbg("Thread=%d group=%p\n", thread, group); + serr("Thread=%d group=%p\n", thread, group); DEBUGASSERT(group); /* Find the entry associated with this pthread. */ @@ -91,7 +91,7 @@ int pthread_detach(pthread_t thread) pjoin = pthread_findjoininfo(group, (pid_t)thread); if (!pjoin) { - sdbg("Could not find thread entry\n"); + serr("Could not find thread entry\n"); ret = EINVAL; } else @@ -121,6 +121,6 @@ int pthread_detach(pthread_t thread) (void)pthread_givesemaphore(&group->tg_joinsem); - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_exit.c b/sched/pthread/pthread_exit.c index d742ef8fdd..ed61e24b88 100644 --- a/sched/pthread/pthread_exit.c +++ b/sched/pthread/pthread_exit.c @@ -78,7 +78,7 @@ void pthread_exit(FAR void *exit_value) FAR struct tcb_s *tcb = this_task(); int status; - sdbg("exit_value=%p\n", exit_value); + serr("exit_value=%p\n", exit_value); /* Block any signal actions that would awaken us while were * are performing the JOIN handshake. diff --git a/sched/pthread/pthread_getaffinity.c b/sched/pthread/pthread_getaffinity.c index 04d1921910..bcf284ba43 100644 --- a/sched/pthread/pthread_getaffinity.c +++ b/sched/pthread/pthread_getaffinity.c @@ -80,7 +80,7 @@ int pthread_getaffinity_np(pthread_t thread, size_t cpusetsize, { int ret; - sdbg("thread ID=%d cpusetsize=%d cpuset=%p\n", + serr("thread ID=%d cpusetsize=%d cpuset=%p\n", (int)thread, (int)cpusetsize, cpusetsize); DEBUGASSERT(thread > 0 && cpusetsize == sizeof(cpu_set_t) && diff --git a/sched/pthread/pthread_getschedparam.c b/sched/pthread/pthread_getschedparam.c index fbb1be26b0..5e5bbb16b5 100644 --- a/sched/pthread/pthread_getschedparam.c +++ b/sched/pthread/pthread_getschedparam.c @@ -88,7 +88,7 @@ int pthread_getschedparam(pthread_t thread, FAR int *policy, { int ret; - sdbg("Thread ID=%d policy=0x%p param=0x%p\n", thread, policy, param); + serr("Thread ID=%d policy=0x%p param=0x%p\n", thread, policy, param); if (!policy || !param) { @@ -113,7 +113,7 @@ int pthread_getschedparam(pthread_t thread, FAR int *policy, } } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_join.c b/sched/pthread/pthread_join.c index 9bb9fa3fa0..933f40cddf 100644 --- a/sched/pthread/pthread_join.c +++ b/sched/pthread/pthread_join.c @@ -87,7 +87,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) FAR struct join_s *pjoin; int ret; - sdbg("thread=%d group=%p\n", thread, group); + serr("thread=%d group=%p\n", thread, group); DEBUGASSERT(group); /* First make sure that this is not an attempt to join to @@ -121,7 +121,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) FAR struct tcb_s *tcb = sched_gettcb((pthread_t)thread); - sdbg("Could not find thread data\n"); + serr("Could not find thread data\n"); /* Case (1) or (3) -- we can't tell which. Assume (3) */ @@ -159,19 +159,19 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) if (pjoin->terminated) { - sdbg("Thread has terminated\n"); + serr("Thread has terminated\n"); /* Get the thread exit value from the terminated thread. */ if (pexit_value) { - sdbg("exit_value=0x%p\n", pjoin->exit_value); + serr("exit_value=0x%p\n", pjoin->exit_value); *pexit_value = pjoin->exit_value; } } else { - sdbg("Thread is still running\n"); + serr("Thread is still running\n"); /* Relinquish the data set semaphore. Since pre-emption is * disabled, we can be certain that no task has the @@ -195,7 +195,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) if (pexit_value) { *pexit_value = pjoin->exit_value; - sdbg("exit_value=0x%p\n", pjoin->exit_value); + serr("exit_value=0x%p\n", pjoin->exit_value); } /* Post the thread's data semaphore so that the exiting thread @@ -230,6 +230,6 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) ret = OK; } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_mutexdestroy.c b/sched/pthread/pthread_mutexdestroy.c index d7d5e7c898..ece500f642 100644 --- a/sched/pthread/pthread_mutexdestroy.c +++ b/sched/pthread/pthread_mutexdestroy.c @@ -72,7 +72,7 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex) int ret = OK; int status; - sdbg("mutex=0x%p\n", mutex); + serr("mutex=0x%p\n", mutex); if (!mutex) { @@ -106,6 +106,6 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex) sched_unlock(); } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_mutexinit.c b/sched/pthread/pthread_mutexinit.c index c4355d41bd..74065d9530 100644 --- a/sched/pthread/pthread_mutexinit.c +++ b/sched/pthread/pthread_mutexinit.c @@ -75,7 +75,7 @@ int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR const pthread_mutexattr_t int ret = OK; int status; - sdbg("mutex=0x%p attr=0x%p\n", mutex, attr); + serr("mutex=0x%p attr=0x%p\n", mutex, attr); if (!mutex) { @@ -113,6 +113,6 @@ int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR const pthread_mutexattr_t #endif } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_mutexlock.c b/sched/pthread/pthread_mutexlock.c index 85e16adc47..9a9d56ed37 100644 --- a/sched/pthread/pthread_mutexlock.c +++ b/sched/pthread/pthread_mutexlock.c @@ -106,7 +106,7 @@ int pthread_mutex_lock(FAR pthread_mutex_t *mutex) int mypid = (int)getpid(); int ret = OK; - sdbg("mutex=0x%p\n", mutex); + serr("mutex=0x%p\n", mutex); if (!mutex) { @@ -140,7 +140,7 @@ int pthread_mutex_lock(FAR pthread_mutex_t *mutex) * is like PTHREAD_MUTEX_ERRORCHECK) */ - sdbg("Returning EDEADLK\n"); + serr("Returning EDEADLK\n"); ret = EDEADLK; } } @@ -166,7 +166,7 @@ int pthread_mutex_lock(FAR pthread_mutex_t *mutex) sched_unlock(); } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_mutextrylock.c b/sched/pthread/pthread_mutextrylock.c index 249dd28d8c..4249b17a74 100644 --- a/sched/pthread/pthread_mutextrylock.c +++ b/sched/pthread/pthread_mutextrylock.c @@ -85,7 +85,7 @@ int pthread_mutex_trylock(FAR pthread_mutex_t *mutex) { int ret = OK; - sdbg("mutex=0x%p\n", mutex); + serr("mutex=0x%p\n", mutex); if (!mutex) { @@ -149,7 +149,7 @@ int pthread_mutex_trylock(FAR pthread_mutex_t *mutex) sched_unlock(); } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_mutexunlock.c b/sched/pthread/pthread_mutexunlock.c index 3b50894050..385329a4e4 100644 --- a/sched/pthread/pthread_mutexunlock.c +++ b/sched/pthread/pthread_mutexunlock.c @@ -82,7 +82,7 @@ int pthread_mutex_unlock(FAR pthread_mutex_t *mutex) { int ret = OK; - sdbg("mutex=0x%p\n", mutex); + serr("mutex=0x%p\n", mutex); if (!mutex) { @@ -102,7 +102,7 @@ int pthread_mutex_unlock(FAR pthread_mutex_t *mutex) { /* No... return an error (default behavior is like PTHREAD_MUTEX_ERRORCHECK) */ - sdbg("Holder=%d returning EPERM\n", mutex->pid); + serr("Holder=%d returning EPERM\n", mutex->pid); ret = EPERM; } @@ -137,7 +137,7 @@ int pthread_mutex_unlock(FAR pthread_mutex_t *mutex) sched_unlock(); } - sdbg("Returning %d\n", ret); + serr("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_setaffinity.c b/sched/pthread/pthread_setaffinity.c index 3948bf9025..c67d36f7d4 100644 --- a/sched/pthread/pthread_setaffinity.c +++ b/sched/pthread/pthread_setaffinity.c @@ -82,7 +82,7 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, { int ret; - sdbg("thread ID=%d cpusetsize=%d cpuset=%p\n", + serr("thread ID=%d cpusetsize=%d cpuset=%p\n", (int)thread, (int)cpusetsize, cpusetsize); DEBUGASSERT(thread > 0 && cpusetsize == sizeof(cpu_set_t) && diff --git a/sched/pthread/pthread_setschedparam.c b/sched/pthread/pthread_setschedparam.c index fe7ee0cdb1..5db0bde3da 100644 --- a/sched/pthread/pthread_setschedparam.c +++ b/sched/pthread/pthread_setschedparam.c @@ -103,7 +103,7 @@ int pthread_setschedparam(pthread_t thread, int policy, { int ret; - sdbg("thread ID=%d policy=%d param=0x%p\n", thread, policy, param); + serr("thread ID=%d policy=%d param=0x%p\n", thread, policy, param); /* Set the errno to some non-zero value (failsafe) */ diff --git a/sched/semaphore/sem_holder.c b/sched/semaphore/sem_holder.c index 873dff5be1..ea07b995fb 100644 --- a/sched/semaphore/sem_holder.c +++ b/sched/semaphore/sem_holder.c @@ -116,7 +116,7 @@ static inline FAR struct semholder_s *sem_allocholder(sem_t *sem) #endif else { - sdbg("Insufficient pre-allocated holders\n"); + serr("Insufficient pre-allocated holders\n"); pholder = NULL; } @@ -283,7 +283,7 @@ static int sem_boostholderprio(FAR struct semholder_s *pholder, if (!sched_verifytcb(htcb)) { - sdbg("TCB 0x%08x is a stale handle, counts lost\n", htcb); + serr("TCB 0x%08x is a stale handle, counts lost\n", htcb); sem_freeholder(sem, pholder); } @@ -321,7 +321,7 @@ static int sem_boostholderprio(FAR struct semholder_s *pholder, } else { - sdbg("CONFIG_SEM_NNESTPRIO exceeded\n"); + serr("CONFIG_SEM_NNESTPRIO exceeded\n"); } } @@ -402,10 +402,10 @@ static int sem_dumpholder(FAR struct semholder_s *pholder, FAR sem_t *sem, FAR void *arg) { #if CONFIG_SEM_PREALLOCHOLDERS > 0 - dbg(" %08x: %08x %08x %04x\n", + err(" %08x: %08x %08x %04x\n", pholder, pholder->flink, pholder->htcb, pholder->counts); #else - dbg(" %08x: %08x %04x\n", pholder, pholder->htcb, pholder->counts); + err(" %08x: %08x %04x\n", pholder, pholder->htcb, pholder->counts); #endif return 0; } @@ -434,7 +434,7 @@ static int sem_restoreholderprio(FAR struct semholder_s *pholder, if (!sched_verifytcb(htcb)) { - sdbg("TCB 0x%08x is a stale handle, counts lost\n", htcb); + serr("TCB 0x%08x is a stale handle, counts lost\n", htcb); sem_freeholder(sem, pholder); } @@ -819,13 +819,13 @@ void sem_destroyholder(FAR sem_t *sem) #if CONFIG_SEM_PREALLOCHOLDERS > 0 if (sem->hhead) { - sdbg("Semaphore destroyed with holders\n"); + serr("Semaphore destroyed with holders\n"); (void)sem_foreachholder(sem, sem_recoverholders, NULL); } #else if (sem->holder.htcb) { - sdbg("Semaphore destroyed with holder\n"); + serr("Semaphore destroyed with holder\n"); } sem->holder.htcb = NULL; diff --git a/sched/signal/sig_deliver.c b/sched/signal/sig_deliver.c index 1f9c378b8a..5d715c5ce0 100644 --- a/sched/signal/sig_deliver.c +++ b/sched/signal/sig_deliver.c @@ -86,7 +86,7 @@ void sig_deliver(FAR struct tcb_s *stcb) for (sigq = (FAR sigq_t *)stcb->sigpendactionq.head; (sigq); sigq = next) { next = sigq->flink; - sdbg("Sending signal sigq=0x%x\n", sigq); + serr("Sending signal sigq=0x%x\n", sigq); /* Remove the signal structure from the sigpendactionq and place it * in the sigpostedq. NOTE: Since signals are processed one at a diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c index 107982c59b..7bf297a1be 100644 --- a/sched/signal/sig_dispatch.c +++ b/sched/signal/sig_dispatch.c @@ -301,7 +301,7 @@ int sig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info) irqstate_t flags; int ret = OK; - sdbg("TCB=0x%08x signo=%d code=%d value=%d mask=%08x\n", + serr("TCB=0x%08x signo=%d code=%d value=%d mask=%08x\n", stcb, info->si_signo, info->si_code, info->si_value.sival_int, stcb->sigprocmask); diff --git a/sched/signal/sig_mqnotempty.c b/sched/signal/sig_mqnotempty.c index 44b05b7aff..b10832722e 100644 --- a/sched/signal/sig_mqnotempty.c +++ b/sched/signal/sig_mqnotempty.c @@ -76,9 +76,9 @@ int sig_mqnotempty(int pid, int signo, void *sival_ptr) int ret; #ifdef CONFIG_CAN_PASS_STRUCTS - sdbg("pid=%p signo=%d value=%d\n", pid, signo, value.sival_int); + serr("pid=%p signo=%d value=%d\n", pid, signo, value.sival_int); #else - sdbg("pid=%p signo=%d sival_ptr=%p\n", pid, signo, sival_ptr); + serr("pid=%p signo=%d sival_ptr=%p\n", pid, signo, sival_ptr); #endif /* Verify that we can perform the signalling operation */ diff --git a/sched/signal/sig_nanosleep.c b/sched/signal/sig_nanosleep.c index 382715c798..0ac8e7fadb 100644 --- a/sched/signal/sig_nanosleep.c +++ b/sched/signal/sig_nanosleep.c @@ -108,7 +108,7 @@ int nanosleep(FAR const struct timespec *rqtp, FAR struct timespec *rmtp) sigset_t set; struct siginfo value; int errval; -#ifdef CONFIG_DEBUG_FEATURES /* Warning avoidance */ +#ifdef CONFIG_DEBUG_ASSERTIONS /* Warning avoidance */ int ret; #endif @@ -135,7 +135,7 @@ int nanosleep(FAR const struct timespec *rqtp, FAR struct timespec *rmtp) /* nanosleep is a simple application of sigtimedwait. */ -#ifdef CONFIG_DEBUG_FEATURES /* Warning avoidance */ +#ifdef CONFIG_DEBUG_ASSERTIONS /* Warning avoidance */ ret = sigtimedwait(&set, &value, rqtp); #else (void)sigtimedwait(&set, &value, rqtp); diff --git a/sched/signal/sig_queue.c b/sched/signal/sig_queue.c index 3daa59c155..c931c9a664 100644 --- a/sched/signal/sig_queue.c +++ b/sched/signal/sig_queue.c @@ -98,9 +98,9 @@ int sigqueue(int pid, int signo, void *sival_ptr) int ret; #ifdef CONFIG_CAN_PASS_STRUCTS - sdbg("pid=0x%08x signo=%d value=%d\n", pid, signo, value.sival_int); + serr("pid=0x%08x signo=%d value=%d\n", pid, signo, value.sival_int); #else - sdbg("pid=0x%08x signo=%d value=%p\n", pid, signo, sival_ptr); + serr("pid=0x%08x signo=%d value=%p\n", pid, signo, sival_ptr); #endif /* Sanity checks */ diff --git a/sched/task/task_create.c b/sched/task/task_create.c index c8dc768d5a..520dd921fb 100644 --- a/sched/task/task_create.c +++ b/sched/task/task_create.c @@ -98,7 +98,7 @@ static int thread_create(FAR const char *name, uint8_t ttype, int priority, tcb = (FAR struct task_tcb_s *)kmm_zalloc(sizeof(struct task_tcb_s)); if (!tcb) { - sdbg("ERROR: Failed to allocate TCB\n"); + serr("ERROR: Failed to allocate TCB\n"); errcode = ENOMEM; goto errout; } diff --git a/sched/task/task_execv.c b/sched/task/task_execv.c index c4457df537..b2e6323600 100644 --- a/sched/task/task_execv.c +++ b/sched/task/task_execv.c @@ -134,7 +134,7 @@ int execv(FAR const char *path, FAR char * const argv[]) ret = exec(path, (FAR char * const *)argv, symtab, nsymbols); if (ret < 0) { - sdbg("exec failed: %d\n", errno); + serr("exec failed: %d\n", errno); return ERROR; } diff --git a/sched/task/task_posixspawn.c b/sched/task/task_posixspawn.c index fe13c80ac3..a185dd8ae1 100644 --- a/sched/task/task_posixspawn.c +++ b/sched/task/task_posixspawn.c @@ -135,7 +135,7 @@ static int posix_spawn_exec(FAR pid_t *pidp, FAR const char *path, if (pid < 0) { ret = get_errno(); - sdbg("ERROR: exec failed: %d\n", ret); + serr("ERROR: exec failed: %d\n", ret); goto errout; } @@ -224,7 +224,7 @@ static int posix_spawn_proxy(int argc, FAR char *argv[]) int tmp = task_reparent(0, *g_spawn_parms.pid); if (tmp < 0) { - sdbg("ERROR: task_reparent() failed: %d\n", tmp); + serr("ERROR: task_reparent() failed: %d\n", tmp); } } #endif @@ -407,7 +407,7 @@ int posix_spawn(FAR pid_t *pid, FAR const char *path, { int errcode = get_errno(); - sdbg("ERROR: sched_getparam failed: %d\n", errcode); + serr("ERROR: sched_getparam failed: %d\n", errcode); spawn_semgive(&g_spawn_parmsem); return errcode; } @@ -433,7 +433,7 @@ int posix_spawn(FAR pid_t *pid, FAR const char *path, if (proxy < 0) { ret = get_errno(); - sdbg("ERROR: Failed to start posix_spawn_proxy: %d\n", ret); + serr("ERROR: Failed to start posix_spawn_proxy: %d\n", ret); goto errout_with_lock; } @@ -444,7 +444,7 @@ int posix_spawn(FAR pid_t *pid, FAR const char *path, ret = waitpid(proxy, &status, 0); if (ret < 0) { - sdbg("ERROR: waitpid() failed: %d\n", errno); + serr("ERROR: waitpid() failed: %d\n", errno); goto errout_with_lock; } #else diff --git a/sched/task/task_prctl.c b/sched/task/task_prctl.c index 654ecba481..9a4d814939 100644 --- a/sched/task/task_prctl.c +++ b/sched/task/task_prctl.c @@ -111,7 +111,7 @@ int prctl(int option, ...) if (!tcb) { - sdbg("Pid does not correspond to a task: %d\n", pid); + serr("Pid does not correspond to a task: %d\n", pid); errcode = ESRCH; goto errout; } @@ -120,7 +120,7 @@ int prctl(int option, ...) if (!name) { - sdbg("No name provide\n"); + serr("No name provide\n"); errcode = EFAULT; goto errout; } @@ -144,13 +144,13 @@ int prctl(int option, ...) } break; #else - sdbg("Option not enabled: %d\n", option); + serr("Option not enabled: %d\n", option); errcode = ENOSYS; goto errout; #endif default: - sdbg("Unrecognized option: %d\n", option); + serr("Unrecognized option: %d\n", option); errcode = EINVAL; goto errout; } diff --git a/sched/task/task_spawn.c b/sched/task/task_spawn.c index 9d4019bf26..b2ae31c1f3 100644 --- a/sched/task/task_spawn.c +++ b/sched/task/task_spawn.c @@ -155,7 +155,7 @@ static int task_spawn_exec(FAR pid_t *pidp, FAR const char *name, if (pid < 0) { ret = get_errno(); - sdbg("ERROR: task_create failed: %d\n", ret); + serr("ERROR: task_create failed: %d\n", ret); goto errout; } @@ -252,7 +252,7 @@ static int task_spawn_proxy(int argc, FAR char *argv[]) int tmp = task_reparent(0, *g_spawn_parms.pid); if (tmp < 0) { - sdbg("ERROR: task_reparent() failed: %d\n", tmp); + serr("ERROR: task_reparent() failed: %d\n", tmp); } } #endif @@ -399,7 +399,7 @@ int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry, { int errcode = get_errno(); - sdbg("ERROR: sched_getparam failed: %d\n", errcode); + serr("ERROR: sched_getparam failed: %d\n", errcode); spawn_semgive(&g_spawn_parmsem); return errcode; } @@ -425,7 +425,7 @@ int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry, if (proxy < 0) { ret = get_errno(); - sdbg("ERROR: Failed to start task_spawn_proxy: %d\n", ret); + serr("ERROR: Failed to start task_spawn_proxy: %d\n", ret); goto errout_with_lock; } @@ -436,7 +436,7 @@ int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry, ret = waitpid(proxy, &status, 0); if (ret < 0) { - sdbg("ERROR: waitpid() failed: %d\n", errno); + serr("ERROR: waitpid() failed: %d\n", errno); goto errout_with_lock; } #else diff --git a/sched/task/task_spawnparms.c b/sched/task/task_spawnparms.c index e6d377c473..bb249e584a 100644 --- a/sched/task/task_spawnparms.c +++ b/sched/task/task_spawnparms.c @@ -102,7 +102,7 @@ static inline int spawn_dup2(FAR struct spawn_dup2_file_action_s *action) { int errcode = get_errno(); - sdbg("ERROR: dup2 failed: %d\n", errcode); + serr("ERROR: dup2 failed: %d\n", errcode); return -errcode; } @@ -123,7 +123,7 @@ static inline int spawn_open(FAR struct spawn_open_file_action_s *action) if (fd < 0) { ret = get_errno(); - sdbg("ERROR: open failed: %d\n", ret); + serr("ERROR: open failed: %d\n", ret); } /* Does the return file descriptor happen to match the required file @@ -140,7 +140,7 @@ static inline int spawn_open(FAR struct spawn_open_file_action_s *action) if (ret < 0) { ret = get_errno(); - sdbg("ERROR: dup2 failed: %d\n", ret); + serr("ERROR: dup2 failed: %d\n", ret); } sinfo("Closing fd=%d\n", fd); @@ -347,7 +347,7 @@ int spawn_proxyattrs(FAR const posix_spawnattr_t *attr, case SPAWN_FILE_ACTION_NONE: default: - sdbg("ERROR: Unknown action: %d\n", entry->action); + serr("ERROR: Unknown action: %d\n", entry->action); ret = EINVAL; break; } diff --git a/sched/task/task_vfork.c b/sched/task/task_vfork.c index 476e8c06d7..a427d7c000 100644 --- a/sched/task/task_vfork.c +++ b/sched/task/task_vfork.c @@ -268,7 +268,7 @@ FAR struct task_tcb_s *task_vforksetup(start_t retaddr) child = (FAR struct task_tcb_s *)kmm_zalloc(sizeof(struct task_tcb_s)); if (!child) { - sdbg("ERROR: Failed to allocate TCB\n"); + serr("ERROR: Failed to allocate TCB\n"); set_errno(ENOMEM); return NULL; } @@ -434,7 +434,7 @@ pid_t task_vforkstart(FAR struct task_tcb_s *child) ret = waitpid(pid, &rc, 0); if (ret < 0) { - sdbg("ERROR: waitpid failed: %d\n", errno); + serr("ERROR: waitpid failed: %d\n", errno); } #else (void)waitpid(pid, &rc, 0); -- GitLab