From patchwork Fri Jun 29 06:36:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: sjur.brandeland@stericsson.com X-Patchwork-Id: 167990 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BBD36B7003 for ; Fri, 29 Jun 2012 16:37:06 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751258Ab2F2GhB (ORCPT ); Fri, 29 Jun 2012 02:37:01 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:65293 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751027Ab2F2GhB (ORCPT ); Fri, 29 Jun 2012 02:37:01 -0400 Received: by lbbgm6 with SMTP id gm6so4195662lbb.19 for ; Thu, 28 Jun 2012 23:36:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=6oenwvx6adprvo+9dbDzL2Fa7Ku9dEQz82gSnQwOag4=; b=L4Q/UBU3dK4RduUkVEsbscqGux9lVj9fFhER6LPAnze08YMD+yf4kNXJWigDDvz9ef S/jmYs2vOPeOyWgCiwb3trWo4wqgttWwstmhXlHQEE9qHMSjS4nnC9r4Cyrhgx/2B1/p WsOfpz0G5rKIBFXEqhg32bYe75G583BGMNiVk4Oq75uuoDDIWosi3YMl9scU0uTo6oEZ MKCeIfUq/sXCpullzW9Yh/dqRoJ0IeMKiyxP/KwMIylT29jqlqA11BucN/0ZlMCgrhf1 H+hACqgp3rWDBARX/QoA+tV/ktOq6KjjfB8As6eSZy+lqtJzmM7JvaIyICOr3e/3GPMG mcnw== Received: by 10.112.17.195 with SMTP id q3mr654671lbd.34.1340951819376; Thu, 28 Jun 2012 23:36:59 -0700 (PDT) Received: from sjur-laptop.stericsson.local ([212.4.57.94]) by mx.google.com with ESMTPS id xx8sm3234165lab.10.2012.06.28.23.36.58 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jun 2012 23:36:58 -0700 (PDT) From: sjur.brandeland@stericsson.com To: davem@davemloft.net Cc: netdev@vger.kernel.org, sjurbren@gmail.com, =?UTF-8?q?Sjur=20Br=C3=A6ndeland?= Subject: [PATCH net-next] caif-hsi: Fix merge issues. Date: Fri, 29 Jun 2012 08:36:20 +0200 Message-Id: <1340951780-27406-1-git-send-email-sjur.brandeland@stericsson.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sjur Brændeland Fix the failing merge in net-next by reverting the last net-next merge for caif_hsi.c and then merge in the commit: "caif-hsi: Bugfix - Piggyback'ed embedded CAIF frame lost" from the net repository. The commit:"caif-hsi: Add missing return in error path" from net repository was dropped, as it changed code previously removed in the net-next repository. Signed-off-by: Sjur Brændeland --- Hi Dave, >Sjur please send me any necessary fixups and please be more mindful in >the future of the incredible merge pain you put me through when you >have such fundamentally overlapping changes like that and don't >provide me with a sample merge resolution like other people do. Yes this merge went really bad, sorry for the pain I have caused you! I'll try to provide you with merge instruction or sample merge resolutions in the future if there are conflicts. Regards, Sjur --- drivers/net/caif/caif_hsi.c | 72 ++++++++++++++++--------------------------- 1 files changed, 27 insertions(+), 45 deletions(-) diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c index 087eb83..0def8b3 100644 --- a/drivers/net/caif/caif_hsi.c +++ b/drivers/net/caif/caif_hsi.c @@ -1131,51 +1131,7 @@ static void cfhsi_setup(struct net_device *dev) cfhsi->cfdev.use_stx = false; cfhsi->cfdev.use_fcs = false; cfhsi->ndev = dev; -} - -int cfhsi_probe(struct platform_device *pdev) -{ - struct cfhsi_ops *(*get_ops)(void); - struct cfhsi *cfhsi = NULL; - struct net_device *ndev; - int res; - - ndev = alloc_netdev(sizeof(struct cfhsi), "cfhsi%d", cfhsi_setup); - if (!ndev) - return -ENODEV; - - cfhsi = netdev_priv(ndev); - cfhsi->ndev = ndev; - cfhsi->pdev = pdev; - - get_ops = symbol_get(cfhsi_get_ops); - if (!get_ops) { - pr_err("%s: failed to get the cfhsi_ops\n", __func__); - return -ENODEV; - } - - /* Assign the HSI device. */ - cfhsi->ops = (*get_ops)(); - if (!cfhsi->ops) { - pr_err("%s: failed to get the cfhsi_ops\n", __func__); - goto err; - } - - /* Assign the driver to this HSI device. */ - cfhsi->ops->cb_ops = &cfhsi->cb_ops; - res = register_netdevice(ndev); - if (res) { - dev_err(&ndev->dev, "%s: Registration error: %d.\n", - __func__, res); - free_netdev(ndev); - } - /* Add CAIF HSI device to list. */ - list_add_tail(&cfhsi->list, &cfhsi_list); - - return res; -err: - symbol_put(cfhsi_get_ops); - return -ENODEV; + cfhsi->cfg = hsi_default_config; } static int cfhsi_open(struct net_device *ndev) @@ -1454,6 +1410,7 @@ static int caif_hsi_newlink(struct net *src_net, struct net_device *dev, struct nlattr *tb[], struct nlattr *data[]) { struct cfhsi *cfhsi = NULL; + struct cfhsi_ops *(*get_ops)(void); ASSERT_RTNL(); @@ -1461,7 +1418,32 @@ static int caif_hsi_newlink(struct net *src_net, struct net_device *dev, cfhsi_netlink_parms(data, cfhsi); dev_net_set(cfhsi->ndev, src_net); + get_ops = symbol_get(cfhsi_get_ops); + if (!get_ops) { + pr_err("%s: failed to get the cfhsi_ops\n", __func__); + return -ENODEV; + } + + /* Assign the HSI device. */ + cfhsi->ops = (*get_ops)(); + if (!cfhsi->ops) { + pr_err("%s: failed to get the cfhsi_ops\n", __func__); + goto err; + } + + /* Assign the driver to this HSI device. */ + cfhsi->ops->cb_ops = &cfhsi->cb_ops; + if (register_netdevice(dev)) { + pr_warn("%s: caif_hsi device registration failed\n", __func__); + goto err; + } + /* Add CAIF HSI device to list. */ + list_add_tail(&cfhsi->list, &cfhsi_list); + return 0; +err: + symbol_put(cfhsi_get_ops); + return -ENODEV; } static struct rtnl_link_ops caif_hsi_link_ops __read_mostly = {