xpp: style: convert __FUNCTION__ to __func__

* Applied via:
  perl -pi -e 's/\b__FUNCTION__\b/__func__/g' "$@"

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-By: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10422 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Oron Peled 2012-01-11 15:17:09 +00:00 committed by Tzafrir Cohen
parent 647212c45f
commit 535ef8086c
15 changed files with 123 additions and 123 deletions

View File

@ -1372,7 +1372,7 @@ static void su_new_state(xpd_t *xpd, byte reg_x30)
priv = xpd->priv; priv = xpd->priv;
BUG_ON(!priv); BUG_ON(!priv);
if(!priv->initialized) { if(!priv->initialized) {
XPD_ERR(xpd, "%s called on uninitialized AB\n", __FUNCTION__); XPD_ERR(xpd, "%s called on uninitialized AB\n", __func__);
return; return;
} }
new_state.reg = reg_x30; new_state.reg = reg_x30;
@ -1477,7 +1477,7 @@ static int BRI_card_register_reply(xbus_t *xbus, xpd_t *xpd, reg_cmd_t *info)
static int rate_limit; static int rate_limit;
if((rate_limit++ % 1003) < 5) if((rate_limit++ % 1003) < 5)
notify_bad_xpd(__FUNCTION__, xbus, addr , orig_xpd->xpdname); notify_bad_xpd(__func__, xbus, addr , orig_xpd->xpdname);
return -EPROTO; return -EPROTO;
} }
spin_lock_irqsave(&xpd->lock, flags); spin_lock_irqsave(&xpd->lock, flags);

View File

@ -835,7 +835,7 @@ HANDLER_DEF(FXO, SIG_CHANGED)
struct FXO_priv_data *priv; struct FXO_priv_data *priv;
if(!xpd) { if(!xpd) {
notify_bad_xpd(__FUNCTION__, xbus, XPACKET_ADDR(pack), cmd->name); notify_bad_xpd(__func__, xbus, XPACKET_ADDR(pack), cmd->name);
return -EPROTO; return -EPROTO;
} }
priv = xpd->priv; priv = xpd->priv;
@ -1359,7 +1359,7 @@ static int fxo_xpd_probe(struct device *dev)
XPD_DBG(DEVICES, xpd, "SYSFS\n"); XPD_DBG(DEVICES, xpd, "SYSFS\n");
ret = device_create_file(dev, &dev_attr_fxo_battery); ret = device_create_file(dev, &dev_attr_fxo_battery);
if(ret) { if(ret) {
XPD_ERR(xpd, "%s: device_create_file(fxo_battery) failed: %d\n", __FUNCTION__, ret); XPD_ERR(xpd, "%s: device_create_file(fxo_battery) failed: %d\n", __func__, ret);
goto fail_fxo_battery; goto fail_fxo_battery;
} }
return 0; return 0;

View File

@ -805,7 +805,7 @@ static int FXS_card_hooksig(xpd_t *xpd, int pos, enum dahdi_txsig txsig)
break; break;
default: default:
XPD_NOTICE(xpd, "%s: Can't set tx state to %s (%d)\n", XPD_NOTICE(xpd, "%s: Can't set tx state to %s (%d)\n",
__FUNCTION__, txsig2str(txsig), txsig); __func__, txsig2str(txsig), txsig);
ret = -EINVAL; ret = -EINVAL;
} }
return ret; return ret;
@ -872,7 +872,7 @@ static int FXS_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a
return -ENODEV; return -ENODEV;
if (pos < 0 || pos >= PHONEDEV(xpd).channels) { if (pos < 0 || pos >= PHONEDEV(xpd).channels) {
XPD_NOTICE(xpd, "Bad channel number %d in %s(), cmd=%u\n", XPD_NOTICE(xpd, "Bad channel number %d in %s(), cmd=%u\n",
pos, __FUNCTION__, cmd); pos, __func__, cmd);
return -EINVAL; return -EINVAL;
} }

View File

@ -545,7 +545,7 @@ HANDLER_DEF(GLOBAL, REGISTER_REPLY)
static int rate_limit; static int rate_limit;
if((rate_limit++ % 1003) < 5) if((rate_limit++ % 1003) < 5)
notify_bad_xpd(__FUNCTION__, xbus, XPACKET_ADDR(pack), ""); notify_bad_xpd(__func__, xbus, XPACKET_ADDR(pack), "");
return -EPROTO; return -EPROTO;
} }
if(debug & DBG_REGS) { if(debug & DBG_REGS) {

View File

@ -606,7 +606,7 @@ static int set_pri_proto(xpd_t *xpd, enum pri_protocol set_proto)
return -ENOSYS; return -ENOSYS;
default: default:
XPD_ERR(xpd, "%s: Unknown pri protocol = %d\n", XPD_ERR(xpd, "%s: Unknown pri protocol = %d\n",
__FUNCTION__, set_proto); __func__, set_proto);
return -EINVAL; return -EINVAL;
} }
priv->pri_protocol = set_proto; priv->pri_protocol = set_proto;
@ -747,7 +747,7 @@ static void set_reg_lim0(const char *msg, xpd_t *xpd)
lim0 |= REG_LIM0_MAS; lim0 |= REG_LIM0_MAS;
else else
lim0 &= ~REG_LIM0_MAS; lim0 &= ~REG_LIM0_MAS;
XPD_DBG(SIGNAL, xpd, "%s(%s): %s, %s\n", __FUNCTION__, msg, XPD_DBG(SIGNAL, xpd, "%s(%s): %s, %s\n", __func__, msg,
(is_master_mode) ? "MASTER" : "SLAVE", (is_master_mode) ? "MASTER" : "SLAVE",
(localloop) ? "LOCALLOOP" : "NO_LOCALLOOP"); (localloop) ? "LOCALLOOP" : "NO_LOCALLOOP");
write_subunit(xpd, REG_LIM0 , lim0); write_subunit(xpd, REG_LIM0 , lim0);
@ -764,7 +764,7 @@ static int set_master_mode(const char *msg, xpd_t *xpd)
{ {
BUG_ON(!xpd); BUG_ON(!xpd);
XPD_DBG(SIGNAL, xpd, "\n"); XPD_DBG(SIGNAL, xpd, "\n");
set_reg_lim0(__FUNCTION__, xpd); set_reg_lim0(__func__, xpd);
set_clocking(xpd); set_clocking(xpd);
return 0; return 0;
} }
@ -777,12 +777,12 @@ static int set_localloop(xpd_t *xpd, bool localloop)
priv = xpd->priv; priv = xpd->priv;
if(SPAN_REGISTERED(xpd)) { if(SPAN_REGISTERED(xpd)) {
XPD_NOTICE(xpd, "Registered as span %d. Cannot do %s\n", XPD_NOTICE(xpd, "Registered as span %d. Cannot do %s\n",
PHONEDEV(xpd).span.spanno, __FUNCTION__); PHONEDEV(xpd).span.spanno, __func__);
return -EBUSY; return -EBUSY;
} }
priv->local_loopback = localloop; priv->local_loopback = localloop;
XPD_DBG(SIGNAL, xpd, "%s: %s\n", __FUNCTION__, (localloop) ? "LOCALLOOP" : "NO"); XPD_DBG(SIGNAL, xpd, "%s: %s\n", __func__, (localloop) ? "LOCALLOOP" : "NO");
set_master_mode(__FUNCTION__, xpd); set_master_mode(__func__, xpd);
return 0; return 0;
} }
@ -921,7 +921,7 @@ static int pri_lineconfig(xpd_t *xpd, int lineconfig)
} }
if(flags && flags != BIT(i)) { if(flags && flags != BIT(i)) {
ERR("%s: BUG: i=%d flags=0x%X\n", ERR("%s: BUG: i=%d flags=0x%X\n",
__FUNCTION__, i, flags); __func__, i, flags);
// BUG(); // BUG();
} }
} }
@ -1012,24 +1012,24 @@ static int pri_lineconfig(xpd_t *xpd, int lineconfig)
framingstr, codingstr, crcstr, framingstr, codingstr, crcstr,
(lineconfig & DAHDI_CONFIG_NOTOPEN)?"YELLOW":"", (lineconfig & DAHDI_CONFIG_NOTOPEN)?"YELLOW":"",
lineconfig); lineconfig);
set_reg_lim0(__FUNCTION__, xpd); set_reg_lim0(__func__, xpd);
XPD_DBG(GENERAL, xpd, "%s: fmr1(0x%02X) = 0x%02X\n", __FUNCTION__, REG_FMR1, fmr1); XPD_DBG(GENERAL, xpd, "%s: fmr1(0x%02X) = 0x%02X\n", __func__, REG_FMR1, fmr1);
write_subunit(xpd, REG_FMR1, fmr1); write_subunit(xpd, REG_FMR1, fmr1);
XPD_DBG(GENERAL, xpd, "%s: fmr2(0x%02X) = 0x%02X\n", __FUNCTION__, REG_FMR2, fmr2); XPD_DBG(GENERAL, xpd, "%s: fmr2(0x%02X) = 0x%02X\n", __func__, REG_FMR2, fmr2);
write_subunit(xpd, REG_FMR2, fmr2); write_subunit(xpd, REG_FMR2, fmr2);
XPD_DBG(GENERAL, xpd, "%s: fmr0(0x%02X) = 0x%02X\n", __FUNCTION__, REG_FMR0, fmr0); XPD_DBG(GENERAL, xpd, "%s: fmr0(0x%02X) = 0x%02X\n", __func__, REG_FMR0, fmr0);
write_subunit(xpd, REG_FMR0, fmr0); write_subunit(xpd, REG_FMR0, fmr0);
XPD_DBG(GENERAL, xpd, "%s: fmr4(0x%02X) = 0x%02X\n", __FUNCTION__, REG_FMR4, fmr4); XPD_DBG(GENERAL, xpd, "%s: fmr4(0x%02X) = 0x%02X\n", __func__, REG_FMR4, fmr4);
write_subunit(xpd, REG_FMR4, fmr4); write_subunit(xpd, REG_FMR4, fmr4);
if(fmr3) { if(fmr3) {
XPD_DBG(GENERAL, xpd, "%s: fmr3(0x%02X) = 0x%02X\n", __FUNCTION__, REG_FMR3, fmr3); XPD_DBG(GENERAL, xpd, "%s: fmr3(0x%02X) = 0x%02X\n", __func__, REG_FMR3, fmr3);
write_subunit(xpd, REG_FMR3, fmr3); write_subunit(xpd, REG_FMR3, fmr3);
} }
XPD_DBG(GENERAL, xpd, "%s: cmdr(0x%02X) = 0x%02X\n", __FUNCTION__, REG_CMDR_E, cmdr); XPD_DBG(GENERAL, xpd, "%s: cmdr(0x%02X) = 0x%02X\n", __func__, REG_CMDR_E, cmdr);
write_subunit(xpd, REG_CMDR_E, cmdr); write_subunit(xpd, REG_CMDR_E, cmdr);
#ifdef JAPANEZE_SUPPORT #ifdef JAPANEZE_SUPPORT
if(rc0) { if(rc0) {
XPD_DBG(GENERAL, xpd, "%s: rc0(0x%02X) = 0x%02X\n", __FUNCTION__, REG_RC0, rc0); XPD_DBG(GENERAL, xpd, "%s: rc0(0x%02X) = 0x%02X\n", __func__, REG_RC0, rc0);
write_subunit(xpd, REG_RC0, rc0); write_subunit(xpd, REG_RC0, rc0);
} }
#endif #endif
@ -1042,12 +1042,12 @@ static int pri_lineconfig(xpd_t *xpd, int lineconfig)
* They are unused in E1 and should be 1 * They are unused in E1 and should be 1
*/ */
XPD_DBG(GENERAL, xpd, "%s: rs1(0x%02X) = 0x%02X\n", XPD_DBG(GENERAL, xpd, "%s: rs1(0x%02X) = 0x%02X\n",
__FUNCTION__, REG_RS1_E, rs1); __func__, REG_RS1_E, rs1);
write_subunit(xpd, REG_RS1_E, rs1); write_subunit(xpd, REG_RS1_E, rs1);
} }
xsp |= REG_XSP_E_CASEN; /* Same as REG_FMR5_T_EIBR for T1 */ xsp |= REG_XSP_E_CASEN; /* Same as REG_FMR5_T_EIBR for T1 */
} }
XPD_DBG(GENERAL, xpd, "%s: xsp(0x%02X) = 0x%02X\n", __FUNCTION__, REG_XSP_E, xsp); XPD_DBG(GENERAL, xpd, "%s: xsp(0x%02X) = 0x%02X\n", __func__, REG_XSP_E, xsp);
write_subunit(xpd, REG_XSP_E, xsp); write_subunit(xpd, REG_XSP_E, xsp);
return 0; return 0;
bad_lineconfig: bad_lineconfig:
@ -1206,7 +1206,7 @@ static int PRI_card_init(xbus_t *xbus, xpd_t *xpd)
PHONEDEV(xpd).direction = TO_PSTN; PHONEDEV(xpd).direction = TO_PSTN;
XPD_DBG(DEVICES, xpd, "%s\n", xpd->type_name); XPD_DBG(DEVICES, xpd, "%s\n", xpd->type_name);
PHONEDEV(xpd).timing_priority = 1; /* High priority SLAVE */ PHONEDEV(xpd).timing_priority = 1; /* High priority SLAVE */
set_master_mode(__FUNCTION__, xpd); set_master_mode(__func__, xpd);
for(ret = 0; ret < NUM_LEDS; ret++) { for(ret = 0; ret < NUM_LEDS; ret++) {
DO_LED(xpd, ret, PRI_LED_ON); DO_LED(xpd, ret, PRI_LED_ON);
msleep(20); msleep(20);
@ -1576,7 +1576,7 @@ static int encode_rbsbits_e1(xpd_t *xpd, int pos, int bits)
if(pos == 15) if(pos == 15)
return 0; /* Don't write dchan in CAS */ return 0; /* Don't write dchan in CAS */
if(pos < 0 || pos > 31) { if(pos < 0 || pos > 31) {
XPD_NOTICE(xpd, "%s: pos=%d out of range. Ignore\n", __FUNCTION__, pos); XPD_NOTICE(xpd, "%s: pos=%d out of range. Ignore\n", __func__, pos);
return 0; return 0;
} }
if(pos >= 16) { if(pos >= 16) {
@ -1609,7 +1609,7 @@ static int encode_rbsbits_t1(xpd_t *xpd, int pos, int bits)
BUG_ON(!priv); BUG_ON(!priv);
BUG_ON(priv->pri_protocol != PRI_PROTO_T1); BUG_ON(priv->pri_protocol != PRI_PROTO_T1);
if(pos < 0 || pos >= PHONEDEV(xpd).channels) { if(pos < 0 || pos >= PHONEDEV(xpd).channels) {
XPD_ERR(xpd, "%s: Bad pos=%d\n", __FUNCTION__, pos); XPD_ERR(xpd, "%s: Bad pos=%d\n", __func__, pos);
return 0; return 0;
} }
chan_per_reg = CHAN_PER_REGS(priv); chan_per_reg = CHAN_PER_REGS(priv);
@ -1701,7 +1701,7 @@ static int pri_rbsbits(struct dahdi_chan *chan, int bits)
return -EINVAL; return -EINVAL;
} else { } else {
XPD_NOTICE(xpd, "%s: protocol %s is not supported yet with CAS\n", XPD_NOTICE(xpd, "%s: protocol %s is not supported yet with CAS\n",
__FUNCTION__, pri_protocol_name(priv->pri_protocol)); __func__, pri_protocol_name(priv->pri_protocol));
return -EINVAL; return -EINVAL;
} }
return 0; return 0;
@ -1996,19 +1996,19 @@ static int decode_cas_e1(xpd_t *xpd, byte regnum, byte data_low)
BUG_ON(priv->pri_protocol != PRI_PROTO_E1); BUG_ON(priv->pri_protocol != PRI_PROTO_E1);
XPD_DBG(SIGNAL, xpd, "RBS: RX: data_low=0x%02X\n", data_low); XPD_DBG(SIGNAL, xpd, "RBS: RX: data_low=0x%02X\n", data_low);
if(pos >= NUM_CAS_RS_E) { if(pos >= NUM_CAS_RS_E) {
XPD_ERR(xpd, "%s: got bad pos=%d [0-%d]\n", __FUNCTION__, pos, NUM_CAS_RS_E); XPD_ERR(xpd, "%s: got bad pos=%d [0-%d]\n", __func__, pos, NUM_CAS_RS_E);
return -EINVAL; return -EINVAL;
} }
if(chan1 < 0 || chan1 > PHONEDEV(xpd).channels) { if(chan1 < 0 || chan1 > PHONEDEV(xpd).channels) {
XPD_NOTICE(xpd, "%s: %s CAS: Bad chan1 number (%d)\n", XPD_NOTICE(xpd, "%s: %s CAS: Bad chan1 number (%d)\n",
__FUNCTION__, __func__,
pri_protocol_name(priv->pri_protocol), pri_protocol_name(priv->pri_protocol),
chan1); chan1);
return -EINVAL; return -EINVAL;
} }
if(chan2 < 0 || chan2 > PHONEDEV(xpd).channels) { if(chan2 < 0 || chan2 > PHONEDEV(xpd).channels) {
XPD_NOTICE(xpd, "%s: %s CAS: Bad chan2 number (%d)\n", XPD_NOTICE(xpd, "%s: %s CAS: Bad chan2 number (%d)\n",
__FUNCTION__, __func__,
pri_protocol_name(priv->pri_protocol), pri_protocol_name(priv->pri_protocol),
chan2); chan2);
return -EINVAL; return -EINVAL;
@ -2058,12 +2058,12 @@ static int decode_cas_t1(xpd_t *xpd, byte regnum, byte data_low)
rxsig <<= 2; rxsig <<= 2;
pos = rsnum * chan_per_reg + chan_per_reg - i - 1; pos = rsnum * chan_per_reg + chan_per_reg - i - 1;
if(pos < 0 || pos >= PHONEDEV(xpd).channels) { if(pos < 0 || pos >= PHONEDEV(xpd).channels) {
XPD_ERR(xpd, "%s: Bad pos=%d\n", __FUNCTION__, pos); XPD_ERR(xpd, "%s: Bad pos=%d\n", __func__, pos);
continue; continue;
} }
chan = XPD_CHAN(xpd, pos); chan = XPD_CHAN(xpd, pos);
if(!chan) { if(!chan) {
XPD_ERR(xpd, "%s: Null channel in pos=%d\n", __FUNCTION__, pos); XPD_ERR(xpd, "%s: Null channel in pos=%d\n", __func__, pos);
continue; continue;
} }
if(chan->rxsig != rxsig) { if(chan->rxsig != rxsig) {
@ -2110,7 +2110,7 @@ static void process_cas_dchan(xpd_t *xpd, byte regnum, byte data_low)
XPD_NOTICE(xpd, XPD_NOTICE(xpd,
"%s: received register 0x%X in protocol %s. Ignore\n", "%s: received register 0x%X in protocol %s. Ignore\n",
__FUNCTION__, regnum, pri_protocol_name(priv->pri_protocol)); __func__, regnum, pri_protocol_name(priv->pri_protocol));
return; return;
} }
if(decode_cas_e1(xpd, regnum, data_low) < 0) if(decode_cas_e1(xpd, regnum, data_low) < 0)
@ -2119,14 +2119,14 @@ static void process_cas_dchan(xpd_t *xpd, byte regnum, byte data_low)
if(regnum > REG_RS12_E) { if(regnum > REG_RS12_E) {
XPD_NOTICE(xpd, XPD_NOTICE(xpd,
"%s: received register 0x%X in protocol %s. Ignore\n", "%s: received register 0x%X in protocol %s. Ignore\n",
__FUNCTION__, regnum, pri_protocol_name(priv->pri_protocol)); __func__, regnum, pri_protocol_name(priv->pri_protocol));
return; return;
} }
if(decode_cas_t1(xpd, regnum, data_low) < 0) if(decode_cas_t1(xpd, regnum, data_low) < 0)
return; return;
} else { } else {
XPD_NOTICE(xpd, "%s: protocol %s is not supported yet with CAS\n", XPD_NOTICE(xpd, "%s: protocol %s is not supported yet with CAS\n",
__FUNCTION__, pri_protocol_name(priv->pri_protocol)); __func__, pri_protocol_name(priv->pri_protocol));
} }
priv->cas_replies++; priv->cas_replies++;
} }
@ -2151,7 +2151,7 @@ static int PRI_card_register_reply(xbus_t *xbus, xpd_t *xpd, reg_cmd_t *info)
static int rate_limit; static int rate_limit;
if((rate_limit++ % 1003) < 5) if((rate_limit++ % 1003) < 5)
notify_bad_xpd(__FUNCTION__, xbus, addr , orig_xpd->xpdname); notify_bad_xpd(__func__, xbus, addr , orig_xpd->xpdname);
return -EPROTO; return -EPROTO;
} }
spin_lock_irqsave(&xpd->lock, flags); spin_lock_irqsave(&xpd->lock, flags);
@ -2518,37 +2518,37 @@ static int pri_xpd_probe(struct device *dev)
XPD_DBG(DEVICES, xpd, "SYSFS\n"); XPD_DBG(DEVICES, xpd, "SYSFS\n");
ret = device_create_file(dev, &dev_attr_pri_protocol); ret = device_create_file(dev, &dev_attr_pri_protocol);
if(ret) { if(ret) {
XPD_ERR(xpd, "%s: device_create_file(pri_protocol) failed: %d\n", __FUNCTION__, ret); XPD_ERR(xpd, "%s: device_create_file(pri_protocol) failed: %d\n", __func__, ret);
goto fail_pri_protocol; goto fail_pri_protocol;
} }
ret = device_create_file(dev, &dev_attr_pri_localloop); ret = device_create_file(dev, &dev_attr_pri_localloop);
if(ret) { if(ret) {
XPD_ERR(xpd, "%s: device_create_file(pri_localloop) failed: %d\n", __FUNCTION__, ret); XPD_ERR(xpd, "%s: device_create_file(pri_localloop) failed: %d\n", __func__, ret);
goto fail_pri_localloop; goto fail_pri_localloop;
} }
ret = device_create_file(dev, &dev_attr_pri_layer1); ret = device_create_file(dev, &dev_attr_pri_layer1);
if(ret) { if(ret) {
XPD_ERR(xpd, "%s: device_create_file(pri_layer1) failed: %d\n", __FUNCTION__, ret); XPD_ERR(xpd, "%s: device_create_file(pri_layer1) failed: %d\n", __func__, ret);
goto fail_pri_layer1; goto fail_pri_layer1;
} }
ret = device_create_file(dev, &dev_attr_pri_alarms); ret = device_create_file(dev, &dev_attr_pri_alarms);
if(ret) { if(ret) {
XPD_ERR(xpd, "%s: device_create_file(pri_alarms) failed: %d\n", __FUNCTION__, ret); XPD_ERR(xpd, "%s: device_create_file(pri_alarms) failed: %d\n", __func__, ret);
goto fail_pri_alarms; goto fail_pri_alarms;
} }
ret = device_create_file(dev, &dev_attr_pri_cas); ret = device_create_file(dev, &dev_attr_pri_cas);
if(ret) { if(ret) {
XPD_ERR(xpd, "%s: device_create_file(pri_cas) failed: %d\n", __FUNCTION__, ret); XPD_ERR(xpd, "%s: device_create_file(pri_cas) failed: %d\n", __func__, ret);
goto fail_pri_cas; goto fail_pri_cas;
} }
ret = device_create_file(dev, &dev_attr_pri_dchan); ret = device_create_file(dev, &dev_attr_pri_dchan);
if(ret) { if(ret) {
XPD_ERR(xpd, "%s: device_create_file(pri_dchan) failed: %d\n", __FUNCTION__, ret); XPD_ERR(xpd, "%s: device_create_file(pri_dchan) failed: %d\n", __func__, ret);
goto fail_pri_dchan; goto fail_pri_dchan;
} }
ret = device_create_file(dev, &dev_attr_pri_clocking); ret = device_create_file(dev, &dev_attr_pri_clocking);
if(ret) { if(ret) {
XPD_ERR(xpd, "%s: device_create_file(pri_clocking) failed: %d\n", __FUNCTION__, ret); XPD_ERR(xpd, "%s: device_create_file(pri_clocking) failed: %d\n", __func__, ret);
goto fail_pri_clocking; goto fail_pri_clocking;
} }
return 0; return 0;

View File

@ -46,33 +46,33 @@
category, THIS_MODULE->name, (xbus)->busname, (unit), (port), ## __VA_ARGS__) category, THIS_MODULE->name, (xbus)->busname, (unit), (port), ## __VA_ARGS__)
#define DBG(bits, fmt, ...) \ #define DBG(bits, fmt, ...) \
((void)((debug & (DBG_ ## bits)) && PRINTK(DEBUG, "-" #bits, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__))) ((void)((debug & (DBG_ ## bits)) && PRINTK(DEBUG, "-" #bits, "%s: " fmt, __func__, ## __VA_ARGS__)))
#define INFO(fmt, ...) PRINTK(INFO, "", fmt, ## __VA_ARGS__) #define INFO(fmt, ...) PRINTK(INFO, "", fmt, ## __VA_ARGS__)
#define NOTICE(fmt, ...) PRINTK(NOTICE, "", fmt, ## __VA_ARGS__) #define NOTICE(fmt, ...) PRINTK(NOTICE, "", fmt, ## __VA_ARGS__)
#define WARNING(fmt, ...) PRINTK(WARNING, "", fmt, ## __VA_ARGS__) #define WARNING(fmt, ...) PRINTK(WARNING, "", fmt, ## __VA_ARGS__)
#define ERR(fmt, ...) PRINTK(ERR, "", fmt, ## __VA_ARGS__) #define ERR(fmt, ...) PRINTK(ERR, "", fmt, ## __VA_ARGS__)
#define XBUS_DBG(bits, xbus, fmt, ...) \ #define XBUS_DBG(bits, xbus, fmt, ...) \
((void)((debug & (DBG_ ## bits)) && XBUS_PRINTK(DEBUG, "-" #bits, xbus, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__))) ((void)((debug & (DBG_ ## bits)) && XBUS_PRINTK(DEBUG, "-" #bits, xbus, "%s: " fmt, __func__, ## __VA_ARGS__)))
#define XBUS_INFO(xbus, fmt, ...) XBUS_PRINTK(INFO, "", xbus, fmt, ## __VA_ARGS__) #define XBUS_INFO(xbus, fmt, ...) XBUS_PRINTK(INFO, "", xbus, fmt, ## __VA_ARGS__)
#define XBUS_NOTICE(xbus, fmt, ...) XBUS_PRINTK(NOTICE, "", xbus, fmt, ## __VA_ARGS__) #define XBUS_NOTICE(xbus, fmt, ...) XBUS_PRINTK(NOTICE, "", xbus, fmt, ## __VA_ARGS__)
#define XBUS_ERR(xbus, fmt, ...) XBUS_PRINTK(ERR, "", xbus, fmt, ## __VA_ARGS__) #define XBUS_ERR(xbus, fmt, ...) XBUS_PRINTK(ERR, "", xbus, fmt, ## __VA_ARGS__)
#define XPD_DBG(bits, xpd, fmt, ...) \ #define XPD_DBG(bits, xpd, fmt, ...) \
((void)((debug & (DBG_ ## bits)) && XPD_PRINTK(DEBUG, "-" #bits, xpd, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__))) ((void)((debug & (DBG_ ## bits)) && XPD_PRINTK(DEBUG, "-" #bits, xpd, "%s: " fmt, __func__, ## __VA_ARGS__)))
#define XPD_INFO(xpd, fmt, ...) XPD_PRINTK(INFO, "", xpd, fmt, ## __VA_ARGS__) #define XPD_INFO(xpd, fmt, ...) XPD_PRINTK(INFO, "", xpd, fmt, ## __VA_ARGS__)
#define XPD_NOTICE(xpd, fmt, ...) XPD_PRINTK(NOTICE, "", xpd, fmt, ## __VA_ARGS__) #define XPD_NOTICE(xpd, fmt, ...) XPD_PRINTK(NOTICE, "", xpd, fmt, ## __VA_ARGS__)
#define XPD_WARNING(xpd, fmt, ...) XPD_PRINTK(WARNING, "", xpd, fmt, ## __VA_ARGS__) #define XPD_WARNING(xpd, fmt, ...) XPD_PRINTK(WARNING, "", xpd, fmt, ## __VA_ARGS__)
#define XPD_ERR(xpd, fmt, ...) XPD_PRINTK(ERR, "", xpd, fmt, ## __VA_ARGS__) #define XPD_ERR(xpd, fmt, ...) XPD_PRINTK(ERR, "", xpd, fmt, ## __VA_ARGS__)
#define LINE_DBG(bits, xpd, pos, fmt, ...) \ #define LINE_DBG(bits, xpd, pos, fmt, ...) \
((void)((debug & (DBG_ ## bits)) && LINE_PRINTK(DEBUG, "-" #bits, xpd, pos, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__))) ((void)((debug & (DBG_ ## bits)) && LINE_PRINTK(DEBUG, "-" #bits, xpd, pos, "%s: " fmt, __func__, ## __VA_ARGS__)))
#define LINE_NOTICE(xpd, pos, fmt, ...) LINE_PRINTK(NOTICE, "", xpd, pos, fmt, ## __VA_ARGS__) #define LINE_NOTICE(xpd, pos, fmt, ...) LINE_PRINTK(NOTICE, "", xpd, pos, fmt, ## __VA_ARGS__)
#define LINE_ERR(xpd, pos, fmt, ...) LINE_PRINTK(ERR, "", xpd, pos, fmt, ## __VA_ARGS__) #define LINE_ERR(xpd, pos, fmt, ...) LINE_PRINTK(ERR, "", xpd, pos, fmt, ## __VA_ARGS__)
#define PORT_DBG(bits, xbus, unit, port, fmt, ...) \ #define PORT_DBG(bits, xbus, unit, port, fmt, ...) \
((void)((debug & (DBG_ ## bits)) && PORT_PRINTK(DEBUG, "-" #bits, \ ((void)((debug & (DBG_ ## bits)) && PORT_PRINTK(DEBUG, "-" #bits, \
xbus, unit, port, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__))) xbus, unit, port, "%s: " fmt, __func__, ## __VA_ARGS__)))
#define PORT_NOTICE(xbus, unit, port, fmt, ...) PORT_PRINTK(NOTICE, "", xbus, unit, port, fmt, ## __VA_ARGS__) #define PORT_NOTICE(xbus, unit, port, fmt, ...) PORT_PRINTK(NOTICE, "", xbus, unit, port, fmt, ## __VA_ARGS__)
#define PORT_ERR(xbus, unit, port, fmt, ...) PORT_PRINTK(ERR, "", xbus, unit, port, fmt, ## __VA_ARGS__) #define PORT_ERR(xbus, unit, port, fmt, ...) PORT_PRINTK(ERR, "", xbus, unit, port, fmt, ## __VA_ARGS__)

View File

@ -383,7 +383,7 @@ static int xpp_mmap_proc_write(struct file *file, const char __user *buffer, uns
if (*p == '\0') break; if (*p == '\0') break;
value = simple_strtoul(p, &endp, 16); value = simple_strtoul(p, &endp, 16);
if (endp == p || value > 0xFF) { if (endp == p || value > 0xFF) {
INFO("%s: Bad input\n", __FUNCTION__); INFO("%s: Bad input\n", __func__);
count = -EINVAL; count = -EINVAL;
goto out; goto out;
} }

View File

@ -164,7 +164,7 @@ static void finalize_xbuses_array(void)
for(i = 0; i < ARRAY_SIZE(xbuses_array); i++) { for(i = 0; i < ARRAY_SIZE(xbuses_array); i++) {
if(xbuses_array[i].xbus != NULL) { if(xbuses_array[i].xbus != NULL) {
ERR("%s: xbus #%d is not NULL\n", __FUNCTION__, i); ERR("%s: xbus #%d is not NULL\n", __func__, i);
BUG(); BUG();
} }
} }
@ -272,7 +272,7 @@ void dump_xframe(const char msg[], const xbus_t *xbus, const xframe_t *xframe, i
if(xframe->xframe_magic != XFRAME_MAGIC) { if(xframe->xframe_magic != XFRAME_MAGIC) {
XBUS_ERR(xbus, "%s: bad xframe_magic %lX\n", XBUS_ERR(xbus, "%s: bad xframe_magic %lX\n",
__FUNCTION__, xframe->xframe_magic); __func__, xframe->xframe_magic);
return; return;
} }
spin_lock_irqsave(&serialize_dump_xframe, flags); spin_lock_irqsave(&serialize_dump_xframe, flags);
@ -472,13 +472,13 @@ int send_cmd_frame(xbus_t *xbus, xframe_t *xframe)
goto err; goto err;
} }
if(debug & DBG_COMMANDS) if(debug & DBG_COMMANDS)
dump_xframe(__FUNCTION__, xbus, xframe, DBG_ANY); dump_xframe(__func__, xbus, xframe, DBG_ANY);
if(!xframe_enqueue(&xbus->command_queue, xframe)) { if(!xframe_enqueue(&xbus->command_queue, xframe)) {
if((rate_limit++ % 1003) == 0) { if((rate_limit++ % 1003) == 0) {
XBUS_ERR(xbus, XBUS_ERR(xbus,
"Dropped command xframe. Cannot enqueue (%d)\n", "Dropped command xframe. Cannot enqueue (%d)\n",
rate_limit); rate_limit);
dump_xframe(__FUNCTION__, xbus, xframe, DBG_ANY); dump_xframe(__func__, xbus, xframe, DBG_ANY);
} }
xbus_setstate(xbus, XBUS_STATE_FAIL); xbus_setstate(xbus, XBUS_STATE_FAIL);
ret = -E2BIG; ret = -E2BIG;
@ -582,7 +582,7 @@ int xbus_xpd_bind(xbus_t *xbus, xpd_t *xpd, int unit, int subunit)
spin_unlock_irqrestore(&xbus->lock, flags); spin_unlock_irqrestore(&xbus->lock, flags);
/* Must be done out of atomic context */ /* Must be done out of atomic context */
if(xpd_device_register(xbus, xpd) < 0) { if(xpd_device_register(xbus, xpd) < 0) {
XPD_ERR(xpd, "%s: xpd_device_register() failed\n", __FUNCTION__); XPD_ERR(xpd, "%s: xpd_device_register() failed\n", __func__);
/* FIXME: What to do? */ /* FIXME: What to do? */
} }
return 0; return 0;
@ -595,18 +595,18 @@ int xbus_xpd_unbind(xbus_t *xbus, xpd_t *xpd)
XBUS_DBG(DEVICES, xbus, "XPD #%d\n", xpd_num); XBUS_DBG(DEVICES, xbus, "XPD #%d\n", xpd_num);
if(!VALID_XPD_NUM(xpd_num)) { if(!VALID_XPD_NUM(xpd_num)) {
XBUS_ERR(xbus, "%s: Bad xpd_num = %d\n", __FUNCTION__, xpd_num); XBUS_ERR(xbus, "%s: Bad xpd_num = %d\n", __func__, xpd_num);
BUG(); BUG();
} }
if(xbus->xpds[xpd_num] == NULL) { if(xbus->xpds[xpd_num] == NULL) {
XBUS_ERR(xbus, "%s: slot xpd_num=%d is empty\n", __FUNCTION__, xpd_num); XBUS_ERR(xbus, "%s: slot xpd_num=%d is empty\n", __func__, xpd_num);
BUG(); BUG();
} }
if(xbus->xpds[xpd_num] != xpd) { if(xbus->xpds[xpd_num] != xpd) {
xpd_t *other = xbus->xpds[xpd_num]; xpd_t *other = xbus->xpds[xpd_num];
XBUS_ERR(xbus, "%s: slot xpd_num=%d is occupied by %p (%s)\n", XBUS_ERR(xbus, "%s: slot xpd_num=%d is occupied by %p (%s)\n",
__FUNCTION__, xpd_num, other, other->xpdname); __func__, xpd_num, other, other->xpdname);
BUG(); BUG();
} }
spin_lock_irqsave(&xbus->lock, flags); spin_lock_irqsave(&xbus->lock, flags);
@ -1031,7 +1031,7 @@ void xbus_populate(void *data)
xbus = container_of(worker, xbus_t, worker); xbus = container_of(worker, xbus_t, worker);
xbus = get_xbus(__func__, xbus->num); /* return in function end */ xbus = get_xbus(__func__, xbus->num); /* return in function end */
XBUS_DBG(DEVICES, xbus, "Entering %s\n", __FUNCTION__); XBUS_DBG(DEVICES, xbus, "Entering %s\n", __func__);
spin_lock_irqsave(&worker->worker_lock, flags); spin_lock_irqsave(&worker->worker_lock, flags);
list_for_each_safe(card, next_card, &worker->card_list) { list_for_each_safe(card, next_card, &worker->card_list) {
struct card_desc_struct *card_desc = list_entry(card, struct card_desc_struct, card_list); struct card_desc_struct *card_desc = list_entry(card, struct card_desc_struct, card_list);
@ -1091,12 +1091,12 @@ int xbus_process_worker(xbus_t *xbus)
struct xbus_workqueue *worker; struct xbus_workqueue *worker;
if(!xbus) { if(!xbus) {
ERR("%s: xbus gone -- skip initialization\n", __FUNCTION__); ERR("%s: xbus gone -- skip initialization\n", __func__);
return 0; return 0;
} }
worker = &xbus->worker; worker = &xbus->worker;
if (down_trylock(&worker->running_initialization)) { if (down_trylock(&worker->running_initialization)) {
ERR("%s: xbus is disconnected -- skip initialization\n", __FUNCTION__); ERR("%s: xbus is disconnected -- skip initialization\n", __func__);
return 0; return 0;
} }
XBUS_DBG(DEVICES, xbus, "\n"); XBUS_DBG(DEVICES, xbus, "\n");
@ -1130,7 +1130,7 @@ static void worker_reset(xbus_t *xbus)
DBG(DEVICES, "%s\n", name); DBG(DEVICES, "%s\n", name);
if(!worker->xpds_init_done) { if(!worker->xpds_init_done) {
NOTICE("%s: worker(%s)->xpds_init_done=%d\n", NOTICE("%s: worker(%s)->xpds_init_done=%d\n",
__FUNCTION__, name, worker->xpds_init_done); __func__, name, worker->xpds_init_done);
} }
spin_lock_irqsave(&worker->worker_lock, flags); spin_lock_irqsave(&worker->worker_lock, flags);
list_for_each_safe(card, next_card, &worker->card_list) { list_for_each_safe(card, next_card, &worker->card_list) {
@ -1278,7 +1278,7 @@ bool xbus_setstate(xbus_t *xbus, enum xbus_state newstate)
goto bad_state; goto bad_state;
break; break;
default: default:
XBUS_NOTICE(xbus, "%s: unknown state %d\n", __FUNCTION__, newstate); XBUS_NOTICE(xbus, "%s: unknown state %d\n", __func__, newstate);
goto out; goto out;
} }
/* All good */ /* All good */
@ -1387,7 +1387,7 @@ static xbus_t *xbus_alloc(void)
xbus = KZALLOC(sizeof(xbus_t), GFP_KERNEL); xbus = KZALLOC(sizeof(xbus_t), GFP_KERNEL);
if(!xbus) { if(!xbus) {
ERR("%s: out of memory\n", __FUNCTION__); ERR("%s: out of memory\n", __func__);
return NULL; return NULL;
} }
spin_lock_irqsave(&xbuses_lock, flags); spin_lock_irqsave(&xbuses_lock, flags);
@ -1395,7 +1395,7 @@ static xbus_t *xbus_alloc(void)
if(xbuses_array[i].xbus == NULL) if(xbuses_array[i].xbus == NULL)
break; break;
if(i >= MAX_BUSES) { if(i >= MAX_BUSES) {
ERR("%s: No free slot for new bus. i=%d\n", __FUNCTION__, i); ERR("%s: No free slot for new bus. i=%d\n", __func__, i);
KZFREE(xbus); KZFREE(xbus);
xbus = NULL; xbus = NULL;
goto out; goto out;
@ -1456,7 +1456,7 @@ xbus_t *xbus_new(struct xbus_ops *ops, ushort max_send_size, struct device *tran
BUG_ON(!ops); BUG_ON(!ops);
xbus = xbus_alloc(); xbus = xbus_alloc();
if(!xbus) { if(!xbus) {
ERR("%s: Failed allocating new xbus\n", __FUNCTION__); ERR("%s: Failed allocating new xbus\n", __func__);
return NULL; return NULL;
} }
snprintf(xbus->busname, XBUS_NAMELEN, "XBUS-%02d", xbus->num); snprintf(xbus->busname, XBUS_NAMELEN, "XBUS-%02d", xbus->num);
@ -1700,7 +1700,7 @@ static int xbus_read_proc(char *page, char **start, off_t off, int count, int *e
} }
len += sprintf(page + len, "<-- len=%d\n", len); len += sprintf(page + len, "<-- len=%d\n", len);
spin_unlock_irqrestore(&xbus->lock, flags); spin_unlock_irqrestore(&xbus->lock, flags);
put_xbus(__FUNCTION__, xbus); /* from xbus_read_proc() */ put_xbus(__func__, xbus); /* from xbus_read_proc() */
out: out:
if (len <= off+count) if (len <= off+count)
*eof = 1; *eof = 1;
@ -1728,7 +1728,7 @@ static int proc_xbus_command_write(struct file *file, const char __user *buffer,
const size_t max_text = max_len * 3 + 10; const size_t max_text = max_len * 3 + 10;
if(count > max_text) { if(count > max_text) {
XBUS_ERR(xbus, "%s: line too long (%ld > %zd)\n", __FUNCTION__, count, max_len); XBUS_ERR(xbus, "%s: line too long (%ld > %zd)\n", __func__, count, max_len);
return -EFBIG; return -EFBIG;
} }
/* 3 bytes per hex-digit and space */ /* 3 bytes per hex-digit and space */
@ -1757,7 +1757,7 @@ static int proc_xbus_command_write(struct file *file, const char __user *buffer,
break; break;
if(!isxdigit(*p)) { if(!isxdigit(*p)) {
XBUS_ERR(xbus, "%s: bad hex value ASCII='0x%X' at position %ld\n", XBUS_ERR(xbus, "%s: bad hex value ASCII='0x%X' at position %ld\n",
__FUNCTION__, *p, (long)(p - buf)); __func__, *p, (long)(p - buf));
count = -EINVAL; count = -EINVAL;
goto out; goto out;
} }
@ -1768,7 +1768,7 @@ static int proc_xbus_command_write(struct file *file, const char __user *buffer,
hexdigit[1] = *p++; hexdigit[1] = *p++;
if(sscanf(hexdigit, "%2X", &val) != 1) { if(sscanf(hexdigit, "%2X", &val) != 1) {
XBUS_ERR(xbus, "%s: bad hex value '%s' at position %ld\n", XBUS_ERR(xbus, "%s: bad hex value '%s' at position %ld\n",
__FUNCTION__, hexdigit, (long)(p - buf)); __func__, hexdigit, (long)(p - buf));
count = -EINVAL; count = -EINVAL;
goto out; goto out;
} }

View File

@ -401,7 +401,7 @@ void got_new_syncer(xbus_t *xbus, enum sync_mode mode, int drift)
case SYNC_MODE_QUERY: /* ignore */ case SYNC_MODE_QUERY: /* ignore */
break; break;
default: default:
XBUS_ERR(xbus, "%s: unknown mode=0x%X\n", __FUNCTION__, mode); XBUS_ERR(xbus, "%s: unknown mode=0x%X\n", __func__, mode);
} }
out: out:
spin_unlock_irqrestore(&ref_ticker_lock, flags2); spin_unlock_irqrestore(&ref_ticker_lock, flags2);
@ -987,7 +987,7 @@ static int copy_pcm_tospan(xbus_t *xbus, xframe_t *xframe)
if((rate_limit++ % 1003) == 0) { if((rate_limit++ % 1003) == 0) {
XBUS_NOTICE(xbus, XBUS_NOTICE(xbus,
"%s: Non-PCM packet within a PCM xframe. (%d)\n", "%s: Non-PCM packet within a PCM xframe. (%d)\n",
__FUNCTION__, rate_limit); __func__, rate_limit);
dump_xframe("In PCM xframe", xbus, xframe, debug); dump_xframe("In PCM xframe", xbus, xframe, debug);
} }
goto out; goto out;
@ -999,7 +999,7 @@ static int copy_pcm_tospan(xbus_t *xbus, xframe_t *xframe)
if((rate_limit++ % 1003) == 0) { if((rate_limit++ % 1003) == 0) {
XBUS_NOTICE(xbus, XBUS_NOTICE(xbus,
"%s: Invalid packet length %d. (%d)\n", "%s: Invalid packet length %d. (%d)\n",
__FUNCTION__, len, rate_limit); __func__, len, rate_limit);
dump_xframe("BAD LENGTH", xbus, xframe, debug); dump_xframe("BAD LENGTH", xbus, xframe, debug);
} }
goto out; goto out;
@ -1009,7 +1009,7 @@ static int copy_pcm_tospan(xbus_t *xbus, xframe_t *xframe)
static int rate_limit; static int rate_limit;
if((rate_limit++ % 1003) == 0) { if((rate_limit++ % 1003) == 0) {
notify_bad_xpd(__FUNCTION__, xbus, XPACKET_ADDR(pack), "RECEIVE PCM"); notify_bad_xpd(__func__, xbus, XPACKET_ADDR(pack), "RECEIVE PCM");
dump_xframe("Unknown XPD addr", xbus, xframe, debug); dump_xframe("Unknown XPD addr", xbus, xframe, debug);
} }
goto out; goto out;
@ -1093,7 +1093,7 @@ static void xbus_tick(xbus_t *xbus)
if((rate_limit++ % 3001) == 0) if((rate_limit++ % 3001) == 0)
XBUS_ERR(xbus, XBUS_ERR(xbus,
"%s: failed to allocate new xframe\n", "%s: failed to allocate new xframe\n",
__FUNCTION__); __func__);
return; return;
} }
} }
@ -1227,7 +1227,7 @@ int exec_sync_command(const char *buf, size_t count)
CALL_PROTO(GLOBAL, SYNC_SOURCE, xbus, NULL, SYNC_MODE_QUERY, 0); CALL_PROTO(GLOBAL, SYNC_SOURCE, xbus, NULL, SYNC_MODE_QUERY, 0);
put_xbus(__func__, xbus); put_xbus(__func__, xbus);
} else { } else {
ERR("%s: cannot parse '%s'\n", __FUNCTION__, buf); ERR("%s: cannot parse '%s'\n", __func__, buf);
ret = -EINVAL; ret = -EINVAL;
} }
return ret; return ret;

View File

@ -88,7 +88,7 @@ static DEVICE_ATTR_WRITER(xbus_state_store, dev, buf, count)
xbus_activate(xbus); xbus_activate(xbus);
else { else {
XBUS_NOTICE(xbus, "%s: Illegal action %s in state %s. Ignored.\n", XBUS_NOTICE(xbus, "%s: Illegal action %s in state %s. Ignored.\n",
__FUNCTION__, buf, __func__, buf,
xbus_statename(XBUS_STATE(xbus))); xbus_statename(XBUS_STATE(xbus)));
return -EINVAL; return -EINVAL;
} }
@ -759,7 +759,7 @@ int xpd_driver_register(struct device_driver *driver)
driver->bus = &xpd_type; driver->bus = &xpd_type;
if((ret = driver_register(driver)) < 0) { if((ret = driver_register(driver)) < 0) {
ERR("%s: driver_register(%s) failed. Error number %d", ERR("%s: driver_register(%s) failed. Error number %d",
__FUNCTION__, driver->name, ret); __func__, driver->name, ret);
} }
return ret; return ret;
} }
@ -794,7 +794,7 @@ int xpd_device_register(xbus_t *xbus, xpd_t *xpd)
dev->release = xpd_release; dev->release = xpd_release;
ret = device_register(dev); ret = device_register(dev);
if(ret) { if(ret) {
XPD_ERR(xpd, "%s: device_register failed: %d\n", __FUNCTION__, ret); XPD_ERR(xpd, "%s: device_register failed: %d\n", __func__, ret);
return ret; return ret;
} }
return 0; return 0;
@ -979,7 +979,7 @@ int xbus_sysfs_create(xbus_t *xbus)
astribank->release = astribank_release; astribank->release = astribank_release;
ret = device_register(astribank); ret = device_register(astribank);
if(ret) { if(ret) {
XBUS_ERR(xbus, "%s: device_register failed: %d\n", __FUNCTION__, ret); XBUS_ERR(xbus, "%s: device_register failed: %d\n", __func__, ret);
dev_set_drvdata(astribank, NULL); dev_set_drvdata(astribank, NULL);
} }
return ret; return ret;
@ -992,17 +992,17 @@ int __init xpp_driver_init(void)
DBG(DEVICES, "SYSFS\n"); DBG(DEVICES, "SYSFS\n");
if((ret = bus_register(&toplevel_bus_type)) < 0) { if((ret = bus_register(&toplevel_bus_type)) < 0) {
ERR("%s: bus_register(%s) failed. Error number %d", ERR("%s: bus_register(%s) failed. Error number %d",
__FUNCTION__, toplevel_bus_type.name, ret); __func__, toplevel_bus_type.name, ret);
goto failed_toplevel; goto failed_toplevel;
} }
if((ret = driver_register(&xpp_driver)) < 0) { if((ret = driver_register(&xpp_driver)) < 0) {
ERR("%s: driver_register(%s) failed. Error number %d", ERR("%s: driver_register(%s) failed. Error number %d",
__FUNCTION__, xpp_driver.name, ret); __func__, xpp_driver.name, ret);
goto failed_xpp_driver; goto failed_xpp_driver;
} }
if((ret = bus_register(&xpd_type)) < 0) { if((ret = bus_register(&xpd_type)) < 0) {
ERR("%s: bus_register(%s) failed. Error number %d", ERR("%s: bus_register(%s) failed. Error number %d",
__FUNCTION__, xpd_type.name, ret); __func__, xpd_type.name, ret);
goto failed_xpd_bus; goto failed_xpd_bus;
} }
return 0; return 0;

View File

@ -39,7 +39,7 @@ typedef uint32_t __u32;
#include <stdio.h> #include <stdio.h>
#define DBG(fmt, ...) printf("DBG: %s: " fmt, __FUNCTION__, ## __VA_ARGS__) #define DBG(fmt, ...) printf("DBG: %s: " fmt, __func__, ## __VA_ARGS__)
#define INFO(fmt, ...) printf("INFO: " fmt, ## __VA_ARGS__) #define INFO(fmt, ...) printf("INFO: " fmt, ## __VA_ARGS__)
#define NOTICE(fmt, ...) printf("NOTICE: " fmt, ## __VA_ARGS__) #define NOTICE(fmt, ...) printf("NOTICE: " fmt, ## __VA_ARGS__)
#define ERR(fmt, ...) printf("ERR: " fmt, ## __VA_ARGS__) #define ERR(fmt, ...) printf("ERR: " fmt, ## __VA_ARGS__)

View File

@ -162,7 +162,7 @@ static xframe_t *transport_alloc_xframe(xbus_t *xbus, gfp_t gfp_flags)
return NULL; return NULL;
} }
spin_lock_irqsave(&xbus->transport.lock, flags); spin_lock_irqsave(&xbus->transport.lock, flags);
//XBUS_INFO(xbus, "%s (transport_refcount=%d)\n", __FUNCTION__, atomic_read(&xbus->transport.transport_refcount)); //XBUS_INFO(xbus, "%s (transport_refcount=%d)\n", __func__, atomic_read(&xbus->transport.transport_refcount));
xframe = ops->alloc_xframe(xbus, gfp_flags); xframe = ops->alloc_xframe(xbus, gfp_flags);
if(!xframe) { if(!xframe) {
static int rate_limit; static int rate_limit;
@ -187,7 +187,7 @@ static void transport_free_xframe(xbus_t *xbus, xframe_t *xframe)
ops = xbus->transport.ops; ops = xbus->transport.ops;
BUG_ON(!ops); BUG_ON(!ops);
spin_lock_irqsave(&xbus->transport.lock, flags); spin_lock_irqsave(&xbus->transport.lock, flags);
//XBUS_INFO(xbus, "%s (transport_refcount=%d)\n", __FUNCTION__, atomic_read(&xbus->transport.transport_refcount)); //XBUS_INFO(xbus, "%s (transport_refcount=%d)\n", __func__, atomic_read(&xbus->transport.transport_refcount));
ops->free_xframe(xbus, xframe); ops->free_xframe(xbus, xframe);
transportops_put(xbus); transportops_put(xbus);
spin_unlock_irqrestore(&xbus->transport.lock, flags); spin_unlock_irqrestore(&xbus->transport.lock, flags);
@ -273,7 +273,7 @@ xframe_t *get_xframe(struct xframe_queue *q)
* *
* memset(xframe->packets, 0, xframe->frame_maxlen); * memset(xframe->packets, 0, xframe->frame_maxlen);
*/ */
//XBUS_INFO(xbus, "%s\n", __FUNCTION__); //XBUS_INFO(xbus, "%s\n", __func__);
return xframe; return xframe;
} }
@ -284,7 +284,7 @@ void put_xframe(struct xframe_queue *q, xframe_t *xframe)
BUG_ON(!q); BUG_ON(!q);
xbus = (xbus_t *)q->priv; xbus = (xbus_t *)q->priv;
BUG_ON(!xbus); BUG_ON(!xbus);
//XBUS_INFO(xbus, "%s\n", __FUNCTION__); //XBUS_INFO(xbus, "%s\n", __func__);
BUG_ON(!TRANSPORT_EXIST(xbus)); BUG_ON(!TRANSPORT_EXIST(xbus));
if(unlikely(!xframe_enqueue(q, xframe))) { if(unlikely(!xframe_enqueue(q, xframe))) {
XBUS_ERR(xbus, "Failed returning xframe to %s\n", q->name); XBUS_ERR(xbus, "Failed returning xframe to %s\n", q->name);

View File

@ -210,7 +210,7 @@ void xpd_free(xpd_t *xpd)
/* /*
* This must be last, so the xbus cannot be released before the xpd * This must be last, so the xbus cannot be released before the xpd
*/ */
put_xbus(__FUNCTION__, xbus); /* was taken in xpd_alloc() */ put_xbus(__func__, xbus); /* was taken in xpd_alloc() */
} }
/* /*
@ -401,7 +401,7 @@ const char *xpd_statename(enum xpd_state st)
bool xpd_setstate(xpd_t *xpd, enum xpd_state newstate) bool xpd_setstate(xpd_t *xpd, enum xpd_state newstate)
{ {
BUG_ON(!xpd); BUG_ON(!xpd);
XPD_DBG(DEVICES, xpd, "%s: %s (%d) -> %s (%d)\n", __FUNCTION__, XPD_DBG(DEVICES, xpd, "%s: %s (%d) -> %s (%d)\n", __func__,
xpd_statename(xpd->xpd_state), xpd->xpd_state, xpd_statename(xpd->xpd_state), xpd->xpd_state,
xpd_statename(newstate), newstate); xpd_statename(newstate), newstate);
switch(newstate) { switch(newstate) {
@ -413,7 +413,7 @@ bool xpd_setstate(xpd_t *xpd, enum xpd_state newstate)
if(xpd->addr.subunit != 0) { if(xpd->addr.subunit != 0) {
XPD_NOTICE(xpd, XPD_NOTICE(xpd,
"%s: Moving to %s allowed only for subunit 0\n", "%s: Moving to %s allowed only for subunit 0\n",
__FUNCTION__, xpd_statename(newstate)); __func__, xpd_statename(newstate));
goto badstate; goto badstate;
} }
break; break;
@ -430,13 +430,13 @@ bool xpd_setstate(xpd_t *xpd, enum xpd_state newstate)
case XPD_STATE_NOHW: case XPD_STATE_NOHW:
break; break;
default: default:
XPD_ERR(xpd, "%s: Unknown newstate=%d\n", __FUNCTION__, newstate); XPD_ERR(xpd, "%s: Unknown newstate=%d\n", __func__, newstate);
} }
xpd->xpd_state = newstate; xpd->xpd_state = newstate;
return 1; return 1;
badstate: badstate:
XPD_NOTICE(xpd, "%s: cannot transition: %s (%d) -> %s (%d)\n", XPD_NOTICE(xpd, "%s: cannot transition: %s (%d) -> %s (%d)\n",
__FUNCTION__, __func__,
xpd_statename(xpd->xpd_state), xpd->xpd_state, xpd_statename(xpd->xpd_state), xpd->xpd_state,
xpd_statename(newstate), newstate); xpd_statename(newstate), newstate);
return 0; return 0;
@ -477,7 +477,7 @@ __must_check static int phonedev_init(xpd_t *xpd, const xproto_table_t *proto_ta
atomic_set(&phonedev->open_counter, 0); atomic_set(&phonedev->open_counter, 0);
for (x = 0; x < phonedev->channels; x++) { for (x = 0; x < phonedev->channels; x++) {
if (!(phonedev->chans[x] = KZALLOC(sizeof(*(phonedev->chans[x])), GFP_KERNEL))) { if (!(phonedev->chans[x] = KZALLOC(sizeof(*(phonedev->chans[x])), GFP_KERNEL))) {
ERR("%s: Unable to allocate channel %d\n", __FUNCTION__, x); ERR("%s: Unable to allocate channel %d\n", __func__, x);
goto err; goto err;
} }
phonedev->ec[x] = KZALLOC(sizeof(*(phonedev->ec[x])), phonedev->ec[x] = KZALLOC(sizeof(*(phonedev->ec[x])),
@ -513,13 +513,13 @@ __must_check xpd_t *xpd_alloc(xbus_t *xbus,
type, channels, alloc_size); type, channels, alloc_size);
if(channels > CHANNELS_PERXPD) { if(channels > CHANNELS_PERXPD) {
XBUS_ERR(xbus, "%s: type=%d: too many channels %d\n", XBUS_ERR(xbus, "%s: type=%d: too many channels %d\n",
__FUNCTION__, type, channels); __func__, type, channels);
goto err; goto err;
} }
if((xpd = KZALLOC(alloc_size, GFP_KERNEL)) == NULL) { if((xpd = KZALLOC(alloc_size, GFP_KERNEL)) == NULL) {
XBUS_ERR(xbus, "%s: type=%d: Unable to allocate memory\n", XBUS_ERR(xbus, "%s: type=%d: Unable to allocate memory\n",
__FUNCTION__, type); __func__, type);
goto err; goto err;
} }
xpd->priv = (byte *)xpd + sizeof(xpd_t); xpd->priv = (byte *)xpd + sizeof(xpd_t);
@ -576,7 +576,7 @@ void update_xpd_status(xpd_t *xpd, int alarm_flag)
struct dahdi_span *span = &PHONEDEV(xpd).span; struct dahdi_span *span = &PHONEDEV(xpd).span;
if(!SPAN_REGISTERED(xpd)) { if(!SPAN_REGISTERED(xpd)) {
// XPD_NOTICE(xpd, "%s: XPD is not registered. Skipping.\n", __FUNCTION__); // XPD_NOTICE(xpd, "%s: XPD is not registered. Skipping.\n", __func__);
return; return;
} }
switch (alarm_flag) { switch (alarm_flag) {
@ -749,7 +749,7 @@ int xpp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long arg)
if(!xpd) { if(!xpd) {
ERR("%s: channel in pos %d, was already closed. Ignore.\n", ERR("%s: channel in pos %d, was already closed. Ignore.\n",
__FUNCTION__, pos); __func__, pos);
return -ENODEV; return -ENODEV;
} }
switch (cmd) { switch (cmd) {
@ -772,13 +772,13 @@ int xpp_hooksig(struct dahdi_chan *chan, enum dahdi_txsig txsig)
if(!xpd) { if(!xpd) {
ERR("%s: channel in pos %d, was already closed. Ignore.\n", ERR("%s: channel in pos %d, was already closed. Ignore.\n",
__FUNCTION__, pos); __func__, pos);
return -ENODEV; return -ENODEV;
} }
if(!PHONE_METHOD(card_hooksig, xpd)) { if(!PHONE_METHOD(card_hooksig, xpd)) {
LINE_ERR(xpd, pos, LINE_ERR(xpd, pos,
"%s: No hooksig method for this channel. Ignore.\n", "%s: No hooksig method for this channel. Ignore.\n",
__FUNCTION__); __func__);
return -ENODEV; return -ENODEV;
} }
xbus = xpd->xbus; xbus = xpd->xbus;
@ -863,7 +863,7 @@ static void echocan_free(struct dahdi_chan *chan,
LINE_DBG(GENERAL, xpd, pos, "mode=0x%X\n", ec->status.mode); LINE_DBG(GENERAL, xpd, pos, "mode=0x%X\n", ec->status.mode);
CALL_EC_METHOD(ec_set, xbus, xpd, pos, 0); CALL_EC_METHOD(ec_set, xbus, xpd, pos, 0);
CALL_EC_METHOD(ec_update, xbus, xbus); CALL_EC_METHOD(ec_update, xbus, xbus);
put_xpd(__FUNCTION__, xpd); /* aquired in xpp_echocan_create() */ put_xpd(__func__, xpd); /* aquired in xpp_echocan_create() */
} }
static const struct dahdi_echocan_features xpp_ec_features = { static const struct dahdi_echocan_features xpp_ec_features = {
@ -935,7 +935,7 @@ int xpp_echocan_create(struct dahdi_chan *chan,
*ec = phonedev->ec[pos]; *ec = phonedev->ec[pos];
(*ec)->ops = &xpp_ec_ops; (*ec)->ops = &xpp_ec_ops;
(*ec)->features = xpp_ec_features; (*ec)->features = xpp_ec_features;
xpd = get_xpd(__FUNCTION__, xpd); /* Returned in echocan_free() */ xpd = get_xpd(__func__, xpd); /* Returned in echocan_free() */
LINE_DBG(GENERAL, xpd, pos, "(tap=%d, param_count=%d)\n", LINE_DBG(GENERAL, xpd, pos, "(tap=%d, param_count=%d)\n",
ecp->tap_length, ecp->param_count); ecp->tap_length, ecp->param_count);
ret = CALL_EC_METHOD(ec_set, xbus, xpd, pos, 1); ret = CALL_EC_METHOD(ec_set, xbus, xpd, pos, 1);

View File

@ -57,7 +57,7 @@ static DEF_PARM(uint, drop_pcm_after, 6, 0644, "Number of consecutive tx_sluggis
THIS_MODULE->name, (xusb)->index, xusb->path, xusb->serial, ## __VA_ARGS__) THIS_MODULE->name, (xusb)->index, xusb->path, xusb->serial, ## __VA_ARGS__)
#define XUSB_DBG(bits, xusb, fmt, ...) \ #define XUSB_DBG(bits, xusb, fmt, ...) \
((void)((debug & (DBG_ ## bits)) && XUSB_PRINTK(DEBUG, xusb, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__))) ((void)((debug & (DBG_ ## bits)) && XUSB_PRINTK(DEBUG, xusb, "%s: " fmt, __func__, ## __VA_ARGS__)))
#define XUSB_ERR(xusb, fmt, ...) XUSB_PRINTK(ERR, xusb, fmt, ## __VA_ARGS__) #define XUSB_ERR(xusb, fmt, ...) XUSB_PRINTK(ERR, xusb, fmt, ## __VA_ARGS__)
#define XUSB_NOTICE(xusb, fmt, ...) XUSB_PRINTK(NOTICE, xusb, fmt, ## __VA_ARGS__) #define XUSB_NOTICE(xusb, fmt, ...) XUSB_PRINTK(NOTICE, xusb, fmt, ## __VA_ARGS__)
#define XUSB_INFO(xusb, fmt, ...) XUSB_PRINTK(INFO, xusb, fmt, ## __VA_ARGS__) #define XUSB_INFO(xusb, fmt, ...) XUSB_PRINTK(INFO, xusb, fmt, ## __VA_ARGS__)
@ -399,7 +399,7 @@ static int do_send_xframe(xbus_t *xbus, xframe_t *xframe)
if((rate_limit++ % 1000) == 0) if((rate_limit++ % 1000) == 0)
XBUS_ERR(xbus, "%s: usb_submit_urb failed: %d\n", XBUS_ERR(xbus, "%s: usb_submit_urb failed: %d\n",
__FUNCTION__, ret); __func__, ret);
ret = -EBADF; ret = -EBADF;
goto failure; goto failure;
} }
@ -439,7 +439,7 @@ static int xframe_send_cmd(xbus_t *xbus, xframe_t *xframe)
{ {
BUG_ON(!xbus); BUG_ON(!xbus);
BUG_ON(!xframe); BUG_ON(!xframe);
//XBUS_INFO(xbus, "%s:\n", __FUNCTION__); //XBUS_INFO(xbus, "%s:\n", __func__);
return do_send_xframe(xbus, xframe); return do_send_xframe(xbus, xframe);
} }
@ -467,7 +467,7 @@ static bool xusb_listen(xusb_t *xusb)
if((rate_limit++ % 1000) == 0) if((rate_limit++ % 1000) == 0)
XBUS_ERR(xbus, "%s: usb_submit_urb failed: %d\n", XBUS_ERR(xbus, "%s: usb_submit_urb failed: %d\n",
__FUNCTION__, ret); __func__, ret);
FREE_RECV_XFRAME(xbus, xframe); FREE_RECV_XFRAME(xbus, xframe);
goto out; goto out;
} }

View File

@ -86,7 +86,7 @@ const xproto_table_t *xproto_get(xpd_type_t cardtype)
int ret = request_module(XPD_TYPE_PREFIX "%d", cardtype); int ret = request_module(XPD_TYPE_PREFIX "%d", cardtype);
if(ret != 0) { if(ret != 0) {
NOTICE("%s: Failed to load module for type=%d. exit status=%d.\n", NOTICE("%s: Failed to load module for type=%d. exit status=%d.\n",
__FUNCTION__, cardtype, ret); __func__, cardtype, ret);
/* Drop through: we may be lucky... */ /* Drop through: we may be lucky... */
} }
xtable = xprotocol_tables[cardtype]; xtable = xprotocol_tables[cardtype];
@ -97,7 +97,7 @@ const xproto_table_t *xproto_get(xpd_type_t cardtype)
DBG(GENERAL, "%s refcount was %d\n", xtable->name, module_refcount(xtable->owner)); DBG(GENERAL, "%s refcount was %d\n", xtable->name, module_refcount(xtable->owner));
#endif #endif
if(!try_module_get(xtable->owner)) { if(!try_module_get(xtable->owner)) {
ERR("%s: try_module_get for %s failed.\n", __FUNCTION__, xtable->name); ERR("%s: try_module_get for %s failed.\n", __func__, xtable->name);
return NULL; return NULL;
} }
} }
@ -142,7 +142,7 @@ static int packet_process(xbus_t *xbus, xpacket_t *pack)
if(!valid_xpd_addr(&XPACKET_ADDR(pack))) { if(!valid_xpd_addr(&XPACKET_ADDR(pack))) {
if(printk_ratelimit()) { if(printk_ratelimit()) {
XBUS_NOTICE(xbus, "%s: from %d%d: bad address.\n", XBUS_NOTICE(xbus, "%s: from %d%d: bad address.\n",
__FUNCTION__, __func__,
XPACKET_ADDR_UNIT(pack), XPACKET_ADDR_SUBUNIT(pack)); XPACKET_ADDR_UNIT(pack), XPACKET_ADDR_SUBUNIT(pack));
dump_packet("packet_process -- bad address", pack, debug); dump_packet("packet_process -- bad address", pack, debug);
} }
@ -159,7 +159,7 @@ static int packet_process(xbus_t *xbus, xpacket_t *pack)
if(!xpd) { if(!xpd) {
if(printk_ratelimit()) { if(printk_ratelimit()) {
XBUS_NOTICE(xbus, "%s: from %d%d opcode=0x%02X: no such global command.\n", XBUS_NOTICE(xbus, "%s: from %d%d opcode=0x%02X: no such global command.\n",
__FUNCTION__, __func__,
XPACKET_ADDR_UNIT(pack), XPACKET_ADDR_SUBUNIT(pack), op); XPACKET_ADDR_UNIT(pack), XPACKET_ADDR_SUBUNIT(pack), op);
dump_packet("packet_process -- no such global command", pack, 1); dump_packet("packet_process -- no such global command", pack, 1);
} }
@ -169,7 +169,7 @@ static int packet_process(xbus_t *xbus, xpacket_t *pack)
if(!xtable) { if(!xtable) {
if(printk_ratelimit()) if(printk_ratelimit())
XPD_ERR(xpd, "%s: no protocol table (type=%d)\n", XPD_ERR(xpd, "%s: no protocol table (type=%d)\n",
__FUNCTION__, __func__,
xpd->type); xpd->type);
goto out; goto out;
} }
@ -177,7 +177,7 @@ static int packet_process(xbus_t *xbus, xpacket_t *pack)
if(!xe) { if(!xe) {
if(printk_ratelimit()) { if(printk_ratelimit()) {
XPD_NOTICE(xpd, "%s: bad command (type=%d,opcode=0x%x)\n", XPD_NOTICE(xpd, "%s: bad command (type=%d,opcode=0x%x)\n",
__FUNCTION__, __func__,
xpd->type, op); xpd->type, op);
dump_packet("packet_process -- bad command", pack, 1); dump_packet("packet_process -- bad command", pack, 1);
} }
@ -189,7 +189,7 @@ static int packet_process(xbus_t *xbus, xpacket_t *pack)
if(!table->packet_is_valid(pack)) { if(!table->packet_is_valid(pack)) {
if(printk_ratelimit()) { if(printk_ratelimit()) {
ERR("xpp: %s: wrong size %d for opcode=0x%02X\n", ERR("xpp: %s: wrong size %d for opcode=0x%02X\n",
__FUNCTION__, XPACKET_LEN(pack), op); __func__, XPACKET_LEN(pack), op);
dump_packet("packet_process -- wrong size", pack, debug); dump_packet("packet_process -- wrong size", pack, debug);
} }
goto out; goto out;
@ -322,10 +322,10 @@ void dump_packet(const char *msg, const xpacket_t *packet, bool debug)
if(i >= sizeof(xpacket_t)) { if(i >= sizeof(xpacket_t)) {
if(limiter < ERR_REPORT_LIMIT) { if(limiter < ERR_REPORT_LIMIT) {
ERR("%s: length overflow i=%d > sizeof(xpacket_t)=%lu\n", ERR("%s: length overflow i=%d > sizeof(xpacket_t)=%lu\n",
__FUNCTION__, i+1, (long)sizeof(xpacket_t)); __func__, i+1, (long)sizeof(xpacket_t));
} else if(limiter == ERR_REPORT_LIMIT) { } else if(limiter == ERR_REPORT_LIMIT) {
ERR("%s: error packet #%d... squelsh reports.\n", ERR("%s: error packet #%d... squelsh reports.\n",
__FUNCTION__, limiter); __func__, limiter);
} }
limiter++; limiter++;
break; break;
@ -349,7 +349,7 @@ void dump_reg_cmd(const char msg[], bool writing, xbus_t *xbus,
if(regcmd->bytes > sizeof(*regcmd) - 1) { /* The size byte is not included */ if(regcmd->bytes > sizeof(*regcmd) - 1) { /* The size byte is not included */
PORT_NOTICE(xbus, unit, port, "%s: %s: Too long: regcmd->bytes = %d\n", PORT_NOTICE(xbus, unit, port, "%s: %s: Too long: regcmd->bytes = %d\n",
__FUNCTION__, msg, regcmd->bytes); __func__, msg, regcmd->bytes);
return; return;
} }
if(regcmd->is_multibyte) { if(regcmd->is_multibyte) {
@ -370,7 +370,7 @@ void dump_reg_cmd(const char msg[], bool writing, xbus_t *xbus,
} }
if(regcmd->bytes != sizeof(*regcmd) - 1) { /* The size byte is not included */ if(regcmd->bytes != sizeof(*regcmd) - 1) { /* The size byte is not included */
PORT_NOTICE(xbus, unit, port, "%s: %s: Wrong size: regcmd->bytes = %d\n", PORT_NOTICE(xbus, unit, port, "%s: %s: Wrong size: regcmd->bytes = %d\n",
__FUNCTION__, msg, regcmd->bytes); __func__, msg, regcmd->bytes);
return; return;
} }
snprintf(port_buf, MAX_PROC_WRITE, "%d%s", snprintf(port_buf, MAX_PROC_WRITE, "%d%s",
@ -416,13 +416,13 @@ const char *xproto_name(xpd_type_t xpd_type)
#define CHECK_XOP(xops, f) \ #define CHECK_XOP(xops, f) \
if(!(xops)->f) { \ if(!(xops)->f) { \
ERR("%s: missing xmethod %s [%s (%d)]\n", __FUNCTION__, #f, name, type); \ ERR("%s: missing xmethod %s [%s (%d)]\n", __func__, #f, name, type); \
return -EINVAL; \ return -EINVAL; \
} }
#define CHECK_PHONEOP(phoneops, f) \ #define CHECK_PHONEOP(phoneops, f) \
if(!(phoneops)->f) { \ if(!(phoneops)->f) { \
ERR("%s: missing phone method %s [%s (%d)]\n", __FUNCTION__, #f, name, type); \ ERR("%s: missing phone method %s [%s (%d)]\n", __func__, #f, name, type); \
return -EINVAL; \ return -EINVAL; \
} }
@ -437,12 +437,12 @@ int xproto_register(const xproto_table_t *proto_table)
type = proto_table->type; type = proto_table->type;
name = proto_table->name; name = proto_table->name;
if(type >= XPD_TYPE_NOMODULE) { if(type >= XPD_TYPE_NOMODULE) {
NOTICE("%s: Bad xproto type %d\n", __FUNCTION__, type); NOTICE("%s: Bad xproto type %d\n", __func__, type);
return -EINVAL; return -EINVAL;
} }
DBG(GENERAL, "%s (%d)\n", name, type); DBG(GENERAL, "%s (%d)\n", name, type);
if(xprotocol_tables[type]) if(xprotocol_tables[type])
NOTICE("%s: overriding registration of %s (%d)\n", __FUNCTION__, name, type); NOTICE("%s: overriding registration of %s (%d)\n", __func__, name, type);
xops = proto_table->xops; xops = proto_table->xops;
CHECK_XOP(xops, card_new); CHECK_XOP(xops, card_new);
CHECK_XOP(xops, card_init); CHECK_XOP(xops, card_init);
@ -477,11 +477,11 @@ void xproto_unregister(const xproto_table_t *proto_table)
name = proto_table->name; name = proto_table->name;
DBG(GENERAL, "%s (%d)\n", name, type); DBG(GENERAL, "%s (%d)\n", name, type);
if(type >= XPD_TYPE_NOMODULE) { if(type >= XPD_TYPE_NOMODULE) {
NOTICE("%s: Bad xproto type %s (%d)\n", __FUNCTION__, name, type); NOTICE("%s: Bad xproto type %s (%d)\n", __func__, name, type);
return; return;
} }
if(!xprotocol_tables[type]) if(!xprotocol_tables[type])
NOTICE("%s: xproto type %s (%d) is already unregistered\n", __FUNCTION__, name, type); NOTICE("%s: xproto type %s (%d) is already unregistered\n", __func__, name, type);
xprotocol_tables[type] = NULL; xprotocol_tables[type] = NULL;
} }