net: irda: irttp: sync error paths of data- and udata-requests

irttp_data_request() returns meaningful errorcodes, while irttp_udata_request()
just returns -1 in similar situations. Sync the two and the loglevels of the
accompanying output.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Wolfram Sang and committed by David S. Miller 925e277f 18a31e1e

+5 -4
+5 -4
net/irda/irttp.c
··· 550 */ 551 int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb) 552 { 553 - int ret = -1; 554 555 IRDA_ASSERT(self != NULL, return -1;); 556 IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); ··· 566 567 /* Check that nothing bad happens */ 568 if (!self->connected) { 569 - IRDA_DEBUG(1, "%s(), Not connected\n", __func__); 570 goto err; 571 } 572 573 if (skb->len > self->max_seg_size) { 574 - IRDA_DEBUG(1, "%s(), UData is too large for IrLAP!\n", 575 - __func__); 576 goto err; 577 } 578
··· 550 */ 551 int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb) 552 { 553 + int ret; 554 555 IRDA_ASSERT(self != NULL, return -1;); 556 IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); ··· 566 567 /* Check that nothing bad happens */ 568 if (!self->connected) { 569 + IRDA_WARNING("%s(), Not connected\n", __func__); 570 + ret = -ENOTCONN; 571 goto err; 572 } 573 574 if (skb->len > self->max_seg_size) { 575 + IRDA_ERROR("%s(), UData is too large for IrLAP!\n", __func__); 576 + ret = -EMSGSIZE; 577 goto err; 578 } 579