Skip to content

Commit 04b453c

Browse files
rddunlapgregkh
authored andcommitted
usb/phy: fix PPC64 build errors in phy-fsl-usb.c
Fix build errors when built for PPC64: These variables are only used on PPC32 so they don't need to be initialized for PPC64. ../drivers/usb/phy/phy-fsl-usb.c: In function 'usb_otg_start': ../drivers/usb/phy/phy-fsl-usb.c:865:3: error: '_fsl_readl' undeclared (first use in this function); did you mean 'fsl_readl'? _fsl_readl = _fsl_readl_be; ../drivers/usb/phy/phy-fsl-usb.c:865:16: error: '_fsl_readl_be' undeclared (first use in this function); did you mean 'fsl_readl'? _fsl_readl = _fsl_readl_be; ../drivers/usb/phy/phy-fsl-usb.c:866:3: error: '_fsl_writel' undeclared (first use in this function); did you mean 'fsl_writel'? _fsl_writel = _fsl_writel_be; ../drivers/usb/phy/phy-fsl-usb.c:866:17: error: '_fsl_writel_be' undeclared (first use in this function); did you mean 'fsl_writel'? _fsl_writel = _fsl_writel_be; ../drivers/usb/phy/phy-fsl-usb.c:868:16: error: '_fsl_readl_le' undeclared (first use in this function); did you mean 'fsl_readl'? _fsl_readl = _fsl_readl_le; ../drivers/usb/phy/phy-fsl-usb.c:869:17: error: '_fsl_writel_le' undeclared (first use in this function); did you mean 'fsl_writel'? _fsl_writel = _fsl_writel_le; and the sysfs "show" function return type should be ssize_t, not int: ../drivers/usb/phy/phy-fsl-usb.c:1042:49: error: initialization of 'ssize_t (*)(struct device *, struct device_attribute *, char *)' {aka 'long int (*)(struct device *, struct device_attribute *, char *)'} from incompatible pointer type 'int (*)(struct device *, struct device_attribute *, char *)' [-Werror=incompatible-pointer-types] static DEVICE_ATTR(fsl_usb2_otg_state, S_IRUGO, show_fsl_usb2_otg_state, NULL); Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Felipe Balbi <balbi@kernel.org> Cc: linux-usb@vger.kernel.org Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 78fbe86 commit 04b453c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/usb/phy/phy-fsl-usb.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,13 +861,15 @@ int usb_otg_start(struct platform_device *pdev)
861861
if (pdata->init && pdata->init(pdev) != 0)
862862
return -EINVAL;
863863

864+
#ifdef CONFIG_PPC32
864865
if (pdata->big_endian_mmio) {
865866
_fsl_readl = _fsl_readl_be;
866867
_fsl_writel = _fsl_writel_be;
867868
} else {
868869
_fsl_readl = _fsl_readl_le;
869870
_fsl_writel = _fsl_writel_le;
870871
}
872+
#endif
871873

872874
/* request irq */
873875
p_otg->irq = platform_get_irq(pdev, 0);
@@ -958,7 +960,7 @@ int usb_otg_start(struct platform_device *pdev)
958960
/*
959961
* state file in sysfs
960962
*/
961-
static int show_fsl_usb2_otg_state(struct device *dev,
963+
static ssize_t show_fsl_usb2_otg_state(struct device *dev,
962964
struct device_attribute *attr, char *buf)
963965
{
964966
struct otg_fsm *fsm = &fsl_otg_dev->fsm;

0 commit comments

Comments
 (0)