Motorola swings to a loss as expected