From patchwork Wed Aug 29 18:08:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timur Tabi X-Patchwork-Id: 180739 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 BA30E2C015E for ; Thu, 30 Aug 2012 04:08:22 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754370Ab2H2SIO (ORCPT ); Wed, 29 Aug 2012 14:08:14 -0400 Received: from ch1ehsobe002.messaging.microsoft.com ([216.32.181.182]:2411 "EHLO ch1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754277Ab2H2SIM (ORCPT ); Wed, 29 Aug 2012 14:08:12 -0400 Received: from mail41-ch1-R.bigfish.com (10.43.68.233) by CH1EHSOBE020.bigfish.com (10.43.70.77) with Microsoft SMTP Server id 14.1.225.23; Wed, 29 Aug 2012 18:08:11 +0000 Received: from mail41-ch1 (localhost [127.0.0.1]) by mail41-ch1-R.bigfish.com (Postfix) with ESMTP id 9438520060; Wed, 29 Aug 2012 18:08:11 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839hd24he5bhf0ah107ah1155h) Received: from mail41-ch1 (localhost.localdomain [127.0.0.1]) by mail41-ch1 (MessageSwitch) id 1346263689427142_16179; Wed, 29 Aug 2012 18:08:09 +0000 (UTC) Received: from CH1EHSMHS003.bigfish.com (snatpool2.int.messaging.microsoft.com [10.43.68.232]) by mail41-ch1.bigfish.com (Postfix) with ESMTP id 5B9CC3A0043; Wed, 29 Aug 2012 18:08:09 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS003.bigfish.com (10.43.70.3) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 29 Aug 2012 18:08:08 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server (TLS) id 14.2.309.3; Wed, 29 Aug 2012 13:08:07 -0500 Received: from efes.am.freescale.net (efes.am.freescale.net [10.82.123.3]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id q7TI84DU015080; Wed, 29 Aug 2012 11:08:07 -0700 From: Timur Tabi To: Andy Fleming , David Miller , Subject: [PATCH 4/7] net/fsl_pq_mdio: various small fixes Date: Wed, 29 Aug 2012 13:08:00 -0500 Message-ID: <1346263683-3664-4-git-send-email-timur@freescale.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1346263683-3664-1-git-send-email-timur@freescale.com> References: <1346263683-3664-1-git-send-email-timur@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 1) Replace printk with dev_err 2) Fix some whitespace mistakes 3) Rename "ofdev" to "pdev", since it's a platform_device now 4) Fix an inadvertent compound statement by replacing commas with semicolons Signed-off-by: Timur Tabi --- drivers/net/ethernet/freescale/fsl_pq_mdio.c | 27 ++++++++++++------------- 1 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c index d5b7590..44f00a4 100644 --- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c +++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c @@ -155,8 +155,7 @@ static int fsl_pq_mdio_reset(struct mii_bus *bus) mutex_unlock(&bus->mdio_lock); if (!status) { - printk(KERN_ERR "%s: The MII Bus is stuck!\n", - bus->name); + dev_err(&bus->dev, "timeout waiting for MII bus\n"); return -EBUSY; } @@ -173,7 +172,7 @@ static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs, struct devi * Also, we have to cast back to struct gfar because of * definition weirdness done in gianfar.h. */ - if(of_device_is_compatible(np, "fsl,gianfar-mdio") || + if (of_device_is_compatible(np, "fsl,gianfar-mdio") || of_device_is_compatible(np, "fsl,gianfar-tbi") || of_device_is_compatible(np, "gianfar")) { enet_regs = (struct gfar __iomem *)regs; @@ -227,9 +226,9 @@ static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id) #endif } -static int fsl_pq_mdio_probe(struct platform_device *ofdev) +static int fsl_pq_mdio_probe(struct platform_device *pdev) { - struct device_node *np = ofdev->dev.of_node; + struct device_node *np = pdev->dev.of_node; struct device_node *tbi; struct fsl_pq_mdio_priv *priv; struct fsl_pq_mdio __iomem *regs = NULL; @@ -252,9 +251,9 @@ static int fsl_pq_mdio_probe(struct platform_device *ofdev) } new_bus->name = "Freescale PowerQUICC MII Bus", - new_bus->read = &fsl_pq_mdio_read, - new_bus->write = &fsl_pq_mdio_write, - new_bus->reset = &fsl_pq_mdio_reset, + new_bus->read = &fsl_pq_mdio_read; + new_bus->write = &fsl_pq_mdio_write; + new_bus->reset = &fsl_pq_mdio_reset; new_bus->priv = priv; addrp = of_get_address(np, 0, &size, NULL); @@ -295,8 +294,8 @@ static int fsl_pq_mdio_probe(struct platform_device *ofdev) goto err_unmap_regs; } - new_bus->parent = &ofdev->dev; - dev_set_drvdata(&ofdev->dev, new_bus); + new_bus->parent = &pdev->dev; + dev_set_drvdata(&pdev->dev, new_bus); if (of_device_is_compatible(np, "fsl,gianfar-mdio") || of_device_is_compatible(np, "fsl,gianfar-tbi") || @@ -348,8 +347,8 @@ static int fsl_pq_mdio_probe(struct platform_device *ofdev) err = of_mdiobus_register(new_bus, np); if (err) { - printk (KERN_ERR "%s: Cannot register as MDIO bus\n", - new_bus->name); + dev_err(&pdev->dev, "cannot register %s as MDIO bus\n", + new_bus->name); goto err_free_irqs; } @@ -367,9 +366,9 @@ err_free_priv: } -static int fsl_pq_mdio_remove(struct platform_device *ofdev) +static int fsl_pq_mdio_remove(struct platform_device *pdev) { - struct device *device = &ofdev->dev; + struct device *device = &pdev->dev; struct mii_bus *bus = dev_get_drvdata(device); struct fsl_pq_mdio_priv *priv = bus->priv;