From: Varka Bhadram Date: Tue, 23 Jun 2015 06:11:03 +0000 (+0530) Subject: mac802154: use WARN_ON() macro X-Git-Tag: v4.3-rc1~96^2~258^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f451829dd97fb22f03844ca52a49828e2e1d666;p=platform%2Fkernel%2Flinux-exynos.git mac802154: use WARN_ON() macro This patch will generate the warning if the required driver ops were not defined. Also it removes unnecessary debug message. Signed-off-by: Varka Bhadram Acked-by: Alexander Aring Signed-off-by: Marcel Holtmann --- diff --git a/net/mac802154/main.c b/net/mac802154/main.c index 356b346..4caf04b 100644 --- a/net/mac802154/main.c +++ b/net/mac802154/main.c @@ -58,11 +58,9 @@ ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops) struct ieee802154_local *local; size_t priv_size; - if (!ops || !(ops->xmit_async || ops->xmit_sync) || !ops->ed || - !ops->start || !ops->stop || !ops->set_channel) { - pr_err("undefined IEEE802.15.4 device operations\n"); + if (WARN_ON(!ops || !(ops->xmit_async || ops->xmit_sync) || !ops->ed || + !ops->start || !ops->stop || !ops->set_channel)) return NULL; - } /* Ensure 32-byte alignment of our private data and hw private data. * We use the wpan_phy priv data for both our ieee802154_local and for