In this paper, we present a stochastic geometry based framework to analyze the coverage probability and ergodic rate with different channel allocations for device-to-device (D2D) communications. Different from existing works, we assume there are two different kinds of users, cellular users and D2D users, in the muti-channel uplink cellular network. Specifically, cellular users can upload data to the nearest base station (BS) directly through cellular channels. However, D2D users must upload data to their own D2D relays through D2D channels and then the D2D relays communicate with the nearest BS through cellular channels. There is no overlapping between cellular channels and D2D channels. Each cellular user and D2D relay adopt the channel inversion power control with maximum transmit power limit. Our results indicate that the framework can help to find the optimal channel allocation to achieve the optimal system performance in terms of coverage probability and average rate.