Quantization is an art, not a functorart, not a functor, as comments reminded you.
Here is a waypath to start thinking about your problem. You may arbitrarily choose the quantization $$ \hat H=c \hat p {1\over \hat x} \hat p, $$ which has your classical Hamiltonian as its classical limit, and is manifestly HermiteanHermitean, among 37897 similar hamiltonians with this property. (The other answer chooses $H={c\over 2}\left ( \hat p ^2 {1\over \hat x} + {1\over \hat x} \hat p ^2 \right )$, instead, complicating the footnote ODE.)
Your proposal is notnot Hermitean. (Your other way has sacrificed linearity…)
Working in the coordinate representation, equivalent to the momentum one by Fourier transformation (the representation has little to do with quantization!), you have $$ -c\hbar^2 \left({1\over x} \psi’\right )’=E\psi, $$ which you might solve$^\natural$, and Fourier transform, as you have learned in elementary QMQM; any system may be Fourier transformed, including those with a brick-wall step function potential. You may impose the restriction of variables by a boundary condition, just as you handle the solutions of the infinite square well free hamiltonian.
$^\natural$ Try $$ x y''-y'+b x^2 y =0 $$ in Wolfram α.