Re: [RFC v1 02/14] nfc: nci: Add handle to manage nci response from nci proprietary command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi Christophe,

On Fri, May 01, 2015 at 10:19:25PM +0200, Christophe Ricard wrote:
> @@ -342,7 +343,13 @@ void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
>  		break;
>  
>  	default:
> -		pr_err("unknown rsp opcode 0x%x\n", rsp_opcode);
> +		if (ndev->ops->prop_rsp_packet)
> +			ret = ndev->ops->prop_rsp_packet(ndev, rsp_opcode, skb);
I'm not a big fan of this, as it's basically a pass through for
proprietary ops and it's left to each driver to implement their generic
handler. I'd prefer to have them explicitely define their handler for
each response and notification. Please look at that patch:

https://git.kernel.org/cgit/linux/kernel/git/sameo/nfc-next.git/commit/?h=topic/prop_rsp_ntf&id=96655968d4ae2bb3b18db4807331dceb5fe55e53

It would slightly change your code, you'd only have to define your 2
handlers and add that to your nci_ops structure. But it would be the NCI
core responsibility to call them when needed.
If you're fine with it, I'll push it to nfc-next and you can rebase your
code on top of it.

Cheers,
Samuel.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux