Re: [PATCH v7 2/5] usb: s3c-hsotg: Adding phy driver support

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

 



On Wed, Oct 31, 2012 at 8:14 PM, Lukasz Majewski <l.majewski@xxxxxxxxxxx> wrote:
> Hi Felipe,
>
>> Hi,
>>
>> On Tue, Oct 30, 2012 at 10:27:34AM +0530, Praveen Paneri wrote:
>> > @@ -3501,20 +3511,27 @@ static int __devinit s3c_hsotg_probe(struct
>> > platform_device *pdev) int ret;
>> >     int i;
>> >
>> > -   plat = pdev->dev.platform_data;
>> > -   if (!plat) {
>> > -           dev_err(&pdev->dev, "no platform data defined\n");
>> > -           return -EINVAL;
>> > -   }
>> > -
>> >     hsotg = devm_kzalloc(&pdev->dev, sizeof(struct s3c_hsotg),
>> > GFP_KERNEL); if (!hsotg) {
>> >             dev_err(dev, "cannot get memory\n");
>> >             return -ENOMEM;
>> >     }
>> >
>> > +   plat = pdev->dev.platform_data;
>> > +   if (!plat) {
>> > +           /* Fallback for transceiver */
>> > +           phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
>> > +           if (IS_ERR_OR_NULL(phy)) {
>> > +                   dev_err(&pdev->dev, "no platform data or
>> > transceiver defined\n");
>> > +                   return -EPROBE_DEFER;
>> > +           } else {
>> > +                   hsotg->phy = phy;
>> > +           }
>> > +   } else {
>> > +           hsotg->plat = plat;
>> > +   }
>>
>> I think this should be the other way around, meaning you try to grab
>> the phy, if you can't, then you fallback to pdata.
Agreed! Will swap it

regards,
Praveen
>>
>
> I agree.
>
> The new approach is to use new PHY driver. And only when failed we
> shall use legacy approach.
>
> --
> Best regards,
>
> Lukasz Majewski
>
> Samsung Poland R&D Center | Linux Platform Group
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux